无法在Jboss Fuse ESB中加载实体

时间:2014-11-11 09:40:29

标签: jpa jbossfuse

我的META-INF / Persistence xml如下

  <persistence-unit name="jpapoc" transaction-type="RESOURCE_LOCAL">

    <class>com.xxx.jpa.PersonEntity</class>
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <properties>
    <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
        <property name="hibernate.hbm2ddl.auto" value="create" />
     </properties>
  </persistence-unit>

我的META-INF / spring / beans.xml如下

  <cxf:cxfEndpoint address="/services/sm" id="sm"
    serviceClass="com.xxx.jpa.MyWebService">
    <cxf:properties>
        <entry key="dataFormat" value="POJO" />
        <entry key="setDefaultBus" value="true" />
    </cxf:properties>
  </cxf:cxfEndpoint>

 <bean id="myProcessor" class="com.xxx.jpa.PersonProcessor">
     <property name="entityManagerFactory" ref="entityManagerFactory"/>
 </bean>
 <bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="persistenceUnitName" value="jpapoc" />
    <property name="jpaVendorAdapter">
        <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
            <property name="databasePlatform" value="org.hibernate.dialect.Oracle10gDialect" />
        </bean>
    </property>
    <property name="dataSource" ref="dataSource" />
</bean>

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
    destroy-method="close">
    <property name="driverClass" value="oracle.jdbc.driver.OracleDriver" />
    <property name="jdbcUrl" value="jdbc:oracle:thin:@localhost:1523:xx" />
    <property name="user" value="test" />
    <property name="password" value="test" />
</bean>

<camel:camelContext>
    <camel:route>
        <camel:from uri="cxf:bean:sm?synchronous=true" />
        <camel:process ref="myProcessor" />
    </camel:route>
</camel:camelContext>

当我尝试在Jboss Fuse ESB中部署此应用程序时,我收到引起:java.lang.ClassNotFoundException:org.hibernate.entitymanager找不到com.xxx.jpa.PersonEntity

我在Person Entity类中使用了@Entity,并且在pom.xml中也使用了dymanic import但是它仍然没有工作

1 个答案:

答案 0 :(得分:-1)

很难在没有代码的情况下指出问题。但是,如果它包含com.xxx.jpa.PersonEntity类,您可以检查捆绑的jar文件。还可以尝试将Meta-Persistence=META-INF/persistence.xml指令添加到pom文件中