Weblogic 11g 部署问题。未找到持久性单元

发布于 2024-11-28 00:13:31 字数 23244 浏览 0 评论 0原文

我们已经在 Weblogic 11g 版本上部署了 WAR 文件。其他规格为: Spring 2.5、Hibernate 3、JPA 1.2。 在部署 WAR 文件时,我们遇到一些与 JPA 相关的异常。 我们的 persistence.xml 文件位于 META-INF 文件夹下,我们通过 java 类加载 spring。 persistence.xml 文件是:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">

<!--
    A persistence unit is a set of listed persistent entities as well
    the configuration of an EntityManagerFactory. This must all be
    part of a bigger single Spring configuration eventually
    We can use JTA for txn mgt also
-->

<persistence-unit name="ABCPersistenceUnit"
    transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
     <jta-data-source>jdbc/CCDataSource</jta-data-source>
    <non-jta-data-source>jdbc/CCDataSource</non-jta-data-source>

    <properties>
        <property name="hibernate.query.factory_class" value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory" />
    </properties>
            <!--<properties>
         <property name="hibernate.dialect"
            value="org.hibernate.dialect.Oracle10gDialect" />
        <property name="hibernate.show_sql" value="false" />
        <property name="hibernate.format_sql" value="false" /> 
    </properties> -->
</persistence-unit>

事务配置如下:

<bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="jndi.datasource" />
    <property name="persistenceUnitName" value="ABCPersistenceUnit" />
    <property name="jpaVendorAdapter">
        <bean
            class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
            <property name="showSql" value="false" />
            <property name="databasePlatform"
                value="org.hibernate.dialect.${DataBaseDialect}" />
            <property name="generateDdl" value="false" />
        </bean>
    </property>
    <property name="jpaPropertyMap">
        <map>
            <entry key="hibernate.show_sql" value="false"/>
        </map>
    </property>
</bean>
<!-- END JPA configuration -->


<!--  *****   2. Configuration for Annotation Driven Transaction Declaration   **** -->
<!-- This configuration is used by components that are enabled for Spring-configured container
    managed transactions declared through Spring annotations. It uses JPA configured beans -->

<bean
    class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

<bean id="transactionManager"
    class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory"
        ref="entityManagerFactory" />
    <property name="dataSource" ref="jndi.datasource" />
</bean>

<!-- <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager" />-->

<tx:annotation-driven transaction-manager="transactionManager"
    proxy-target-class="false" />

例外情况是:

Caused By: java.lang.IllegalArgumentException: No persistence unit with name 'ABCPersistenceUnit' found
    at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.obtainPersistenceUnitInfo(DefaultPersistenceUnitManager.java:379)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.determinePersistenceUnitInfo(LocalContainerEntityManagerFactoryBean.java:244)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:196)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:507)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:473)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:599)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:570)
    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:180)
    at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:105)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessAfterInstantiation(PersistenceAnnotationBeanPostProcessor.java:308)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:479)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.fairisaac.edm.cc.spring.context.ApplicationContextBean.<clinit>(ApplicationContextBean.java:28)
    at com.fairisaac.edm.cc.ui.facelets.ext.CustomViewHandler.<clinit>(CustomViewHandler.java:53)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.sun.faces.util.Util.createInstance(Util.java:616)
    at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:941)
    at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:768)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:529)
    at com.sun.faces.config.GlassFishConfigureListener.contextInitialized(GlassFishConfigureListener.java:47)
    at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
    at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)



<Unable to unprepare application 'CommonUI-1'.
java.lang.ClassNotFoundException: org.hibernate.event.EventListeners$2
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
    at org.hibernate.event.EventListeners.destroyListeners(EventListeners.java:215)
    at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:850)
    at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:46)
    at weblogic.deployment.BasePersistenceUnitInfoImpl.close(BasePersistenceUnitInfoImpl.java:652)
    at weblogic.deployment.PersistenceUnitInfoImpl.close(PersistenceUnitInfoImpl.java:19)
    at weblogic.deployment.AbstractPersistenceUnitRegistry.close(AbstractPersistenceUnitRegistry.java:384)
    at weblogic.deployment.ModulePersistenceUnitRegistry.close(ModulePersistenceUnitRegistry.java:142)
    at weblogic.servlet.internal.WebAppModule.closePersistenceUnitRegistry(WebAppModule.java:1797)
    at weblogic.servlet.internal.WebAppModule.unprepare(WebAppModule.java:535)
    at weblogic.application.internal.flow.ModuleStateDriver$1.previous(ModuleStateDriver.java:339)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.ModuleStateDriver.unprepare(ModuleStateDriver.java:167)
    at weblogic.application.internal.flow.ScopedModuleDriver.unprepare(ScopedModuleDriver.java:212)
    at weblogic.application.internal.flow.ModuleListenerInvoker.unprepare(ModuleListenerInvoker.java:285)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.previous(DeploymentCallbackFlow.java:523)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.unprepare(DeploymentCallbackFlow.java:211)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.unprepare(DeploymentCallbackFlow.java:202)
    at weblogic.application.internal.BaseDeployment$1.previous(BaseDeployment.java:619)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.BaseDeployment.unprepare(BaseDeployment.java:248)
    at weblogic.application.internal.SingleModuleDeployment.unprepare(SingleModuleDeployment.java:43)
    at weblogic.application.internal.DeploymentStateChecker.unprepare(DeploymentStateChecker.java:205)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.unprepare(AppContainerInvoker.java:117)
    at weblogic.deploy.internal.targetserver.BasicDeployment.unprepare(BasicDeployment.java:287)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:363)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused By: java.lang.ClassNotFoundException: org.hibernate.event.EventListeners$2
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
    at org.hibernate.event.EventListeners.destroyListeners(EventListeners.java:215)
    at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:850)
    at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:46)
    at weblogic.deployment.BasePersistenceUnitInfoImpl.close(BasePersistenceUnitInfoImpl.java:652)
    at weblogic.deployment.PersistenceUnitInfoImpl.close(PersistenceUnitInfoImpl.java:19)
    at weblogic.deployment.AbstractPersistenceUnitRegistry.close(AbstractPersistenceUnitRegistry.java:384)
    at weblogic.deployment.ModulePersistenceUnitRegistry.close(ModulePersistenceUnitRegistry.java:142)
    at weblogic.servlet.internal.WebAppModule.closePersistenceUnitRegistry(WebAppModule.java:1797)
    at weblogic.servlet.internal.WebAppModule.unprepare(WebAppModule.java:535)
    at weblogic.application.internal.flow.ModuleStateDriver$1.previous(ModuleStateDriver.java:339)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.ModuleStateDriver.unprepare(ModuleStateDriver.java:167)
    at weblogic.application.internal.flow.ScopedModuleDriver.unprepare(ScopedModuleDriver.java:212)
    at weblogic.application.internal.flow.ModuleListenerInvoker.unprepare(ModuleListenerInvoker.java:285)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.previous(DeploymentCallbackFlow.java:523)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.unprepare(DeploymentCallbackFlow.java:211)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.unprepare(DeploymentCallbackFlow.java:202)
    at weblogic.application.internal.BaseDeployment$1.previous(BaseDeployment.java:619)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.BaseDeployment.unprepare(BaseDeployment.java:248)
    at weblogic.application.internal.SingleModuleDeployment.unprepare(SingleModuleDeployment.java:43)
    at weblogic.application.internal.DeploymentStateChecker.unprepare(DeploymentStateChecker.java:205)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.unprepare(AppContainerInvoker.java:117)
    at weblogic.deploy.internal.targetserver.BasicDeployment.unprepare(BasicDeployment.java:287)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:363)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) 

有人可以告诉我可能是什么问题吗? 谢谢, 萨希尔。

We have Deployed our WAR file on Weblogic 11g version. The other specifications are :
Spring 2.5, Hibernate 3, JPA 1.2.
While deploying the WAR file, we are getting some exceptions related to JPA.
Our persistence.xml file is under META-INF folder, and we are loading spring through a java class.
The persistence.xml file is:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">

<!--
    A persistence unit is a set of listed persistent entities as well
    the configuration of an EntityManagerFactory. This must all be
    part of a bigger single Spring configuration eventually
    We can use JTA for txn mgt also
-->

<persistence-unit name="ABCPersistenceUnit"
    transaction-type="RESOURCE_LOCAL">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
     <jta-data-source>jdbc/CCDataSource</jta-data-source>
    <non-jta-data-source>jdbc/CCDataSource</non-jta-data-source>

    <properties>
        <property name="hibernate.query.factory_class" value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory" />
    </properties>
            <!--<properties>
         <property name="hibernate.dialect"
            value="org.hibernate.dialect.Oracle10gDialect" />
        <property name="hibernate.show_sql" value="false" />
        <property name="hibernate.format_sql" value="false" /> 
    </properties> -->
</persistence-unit>

Transaction configuration is as :

<bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
    <property name="dataSource" ref="jndi.datasource" />
    <property name="persistenceUnitName" value="ABCPersistenceUnit" />
    <property name="jpaVendorAdapter">
        <bean
            class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
            <property name="showSql" value="false" />
            <property name="databasePlatform"
                value="org.hibernate.dialect.${DataBaseDialect}" />
            <property name="generateDdl" value="false" />
        </bean>
    </property>
    <property name="jpaPropertyMap">
        <map>
            <entry key="hibernate.show_sql" value="false"/>
        </map>
    </property>
</bean>
<!-- END JPA configuration -->


<!--  *****   2. Configuration for Annotation Driven Transaction Declaration   **** -->
<!-- This configuration is used by components that are enabled for Spring-configured container
    managed transactions declared through Spring annotations. It uses JPA configured beans -->

<bean
    class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

<bean id="transactionManager"
    class="org.springframework.orm.jpa.JpaTransactionManager">
    <property name="entityManagerFactory"
        ref="entityManagerFactory" />
    <property name="dataSource" ref="jndi.datasource" />
</bean>

<!-- <bean id="transactionManager" class="org.springframework.transaction.jta.WebSphereUowTransactionManager" />-->

<tx:annotation-driven transaction-manager="transactionManager"
    proxy-target-class="false" />

The exceptions are:

Caused By: java.lang.IllegalArgumentException: No persistence unit with name 'ABCPersistenceUnit' found
    at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.obtainPersistenceUnitInfo(DefaultPersistenceUnitManager.java:379)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.determinePersistenceUnitInfo(LocalContainerEntityManagerFactoryBean.java:244)
    at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:196)
    at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:291)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findDefaultEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:507)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.findEntityManagerFactory(PersistenceAnnotationBeanPostProcessor.java:473)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.resolveEntityManager(PersistenceAnnotationBeanPostProcessor.java:599)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor$PersistenceElement.getResourceToInject(PersistenceAnnotationBeanPostProcessor.java:570)
    at org.springframework.beans.factory.annotation.InjectionMetadata$InjectedElement.inject(InjectionMetadata.java:180)
    at org.springframework.beans.factory.annotation.InjectionMetadata.injectFields(InjectionMetadata.java:105)
    at org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor.postProcessAfterInstantiation(PersistenceAnnotationBeanPostProcessor.java:308)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:959)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:219)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
    at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:479)
    at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
    at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
    at com.fairisaac.edm.cc.spring.context.ApplicationContextBean.<clinit>(ApplicationContextBean.java:28)
    at com.fairisaac.edm.cc.ui.facelets.ext.CustomViewHandler.<clinit>(CustomViewHandler.java:53)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.sun.faces.util.Util.createInstance(Util.java:616)
    at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:941)
    at com.sun.faces.config.ConfigureListener.configure(ConfigureListener.java:768)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:529)
    at com.sun.faces.config.GlassFishConfigureListener.contextInitialized(GlassFishConfigureListener.java:47)
    at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:481)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1872)
    at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153)
    at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:482)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
    at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:247)
    at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:119)
    at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:27)
    at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:636)
    at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
    at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:205)
    at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:43)
    at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:161)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:184)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:361)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)



<Unable to unprepare application 'CommonUI-1'.
java.lang.ClassNotFoundException: org.hibernate.event.EventListeners$2
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
    at org.hibernate.event.EventListeners.destroyListeners(EventListeners.java:215)
    at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:850)
    at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:46)
    at weblogic.deployment.BasePersistenceUnitInfoImpl.close(BasePersistenceUnitInfoImpl.java:652)
    at weblogic.deployment.PersistenceUnitInfoImpl.close(PersistenceUnitInfoImpl.java:19)
    at weblogic.deployment.AbstractPersistenceUnitRegistry.close(AbstractPersistenceUnitRegistry.java:384)
    at weblogic.deployment.ModulePersistenceUnitRegistry.close(ModulePersistenceUnitRegistry.java:142)
    at weblogic.servlet.internal.WebAppModule.closePersistenceUnitRegistry(WebAppModule.java:1797)
    at weblogic.servlet.internal.WebAppModule.unprepare(WebAppModule.java:535)
    at weblogic.application.internal.flow.ModuleStateDriver$1.previous(ModuleStateDriver.java:339)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.ModuleStateDriver.unprepare(ModuleStateDriver.java:167)
    at weblogic.application.internal.flow.ScopedModuleDriver.unprepare(ScopedModuleDriver.java:212)
    at weblogic.application.internal.flow.ModuleListenerInvoker.unprepare(ModuleListenerInvoker.java:285)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.previous(DeploymentCallbackFlow.java:523)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.unprepare(DeploymentCallbackFlow.java:211)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.unprepare(DeploymentCallbackFlow.java:202)
    at weblogic.application.internal.BaseDeployment$1.previous(BaseDeployment.java:619)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.BaseDeployment.unprepare(BaseDeployment.java:248)
    at weblogic.application.internal.SingleModuleDeployment.unprepare(SingleModuleDeployment.java:43)
    at weblogic.application.internal.DeploymentStateChecker.unprepare(DeploymentStateChecker.java:205)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.unprepare(AppContainerInvoker.java:117)
    at weblogic.deploy.internal.targetserver.BasicDeployment.unprepare(BasicDeployment.java:287)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:363)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused By: java.lang.ClassNotFoundException: org.hibernate.event.EventListeners$2
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
    at org.hibernate.event.EventListeners.destroyListeners(EventListeners.java:215)
    at org.hibernate.impl.SessionFactoryImpl.close(SessionFactoryImpl.java:850)
    at org.hibernate.ejb.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:46)
    at weblogic.deployment.BasePersistenceUnitInfoImpl.close(BasePersistenceUnitInfoImpl.java:652)
    at weblogic.deployment.PersistenceUnitInfoImpl.close(PersistenceUnitInfoImpl.java:19)
    at weblogic.deployment.AbstractPersistenceUnitRegistry.close(AbstractPersistenceUnitRegistry.java:384)
    at weblogic.deployment.ModulePersistenceUnitRegistry.close(ModulePersistenceUnitRegistry.java:142)
    at weblogic.servlet.internal.WebAppModule.closePersistenceUnitRegistry(WebAppModule.java:1797)
    at weblogic.servlet.internal.WebAppModule.unprepare(WebAppModule.java:535)
    at weblogic.application.internal.flow.ModuleStateDriver$1.previous(ModuleStateDriver.java:339)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.ModuleStateDriver.unprepare(ModuleStateDriver.java:167)
    at weblogic.application.internal.flow.ScopedModuleDriver.unprepare(ScopedModuleDriver.java:212)
    at weblogic.application.internal.flow.ModuleListenerInvoker.unprepare(ModuleListenerInvoker.java:285)
    at weblogic.application.internal.flow.DeploymentCallbackFlow$1.previous(DeploymentCallbackFlow.java:523)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.unprepare(DeploymentCallbackFlow.java:211)
    at weblogic.application.internal.flow.DeploymentCallbackFlow.unprepare(DeploymentCallbackFlow.java:202)
    at weblogic.application.internal.BaseDeployment$1.previous(BaseDeployment.java:619)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:223)
    at weblogic.application.utils.StateMachineDriver.previousState(StateMachineDriver.java:215)
    at weblogic.application.internal.BaseDeployment.unprepare(BaseDeployment.java:248)
    at weblogic.application.internal.SingleModuleDeployment.unprepare(SingleModuleDeployment.java:43)
    at weblogic.application.internal.DeploymentStateChecker.unprepare(DeploymentStateChecker.java:205)
    at weblogic.deploy.internal.targetserver.AppContainerInvoker.unprepare(AppContainerInvoker.java:117)
    at weblogic.deploy.internal.targetserver.BasicDeployment.unprepare(BasicDeployment.java:287)
    at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:363)
    at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
    at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:200)
    at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
    at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:240)
    at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
    at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
    at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:180)
    at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:96)
    at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) 

Can someone please tell me what could be the issue.
Thanks,
Sahil.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

莫多说 2024-12-05 00:13:31

Spring 似乎无法找到 persistence.xml。您必须将其放在 WEB-INF/classes/META-INF/persistence.xml 下

Appears like the persistence.xml cannot be found by Spring. You will have to place it under WEB-INF/classes/META-INF/persistence.xml

等风也等你 2024-12-05 00:13:31

我发现当您尝试将持久性存档与其自己的 persistence.xml 文件一起使用时,就会发生这种情况。将 persistence.xml 移动到 EJB.jar 文件的 META-INF 可以修复该问题。您仍然可以将实体 bean 放在单独的 .jar 文件中,只需确保带有会话 bean 的 EJB jar 文件包含 persistence.xml 文件。

I find that this happens when you try to use a persistence archive with it's own persistence.xml file. Moving the persistence.xml to the META-INF of the EJB.jar file fixes it. You can still have your entity beans in a separate .jar file, you just need to make sure the EJB jar file with your session beans contains the persistence.xml file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文