gpt4 book ai didi

hibernate - java.lang.NoSuchMethodError : javax/persistence/spi/PersistenceUnitInfo. getValidationMode()Ljavax/persistence/ValidationMode

转载 作者:行者123 更新时间:2023-12-04 16:36:09 28 4
gpt4 key购买 nike

当我在Weblogic中部署我的war文件(在Tomcat中工作正常)时,我总是收到错误消息。

我的技术Spring 3 Hibernatejpawebservice(Metro)

我的图书馆


我的错误是

####>(BasePersistenceUnitInfoImpl.java:158)
在weblogic.deployment.PersistenceUnitInfoImpl。(PersistenceUnitInfoImpl.java:39)
在weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349)
在weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:124)
在weblogic.deployment.ModulePersistenceUnitRegistry。(ModulePersistenceUnitRegistry.java:58)
在weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1790)
在weblogic.servlet.internal.WebAppServletContext.initClassLoader(WebAppServletContext.java:3028)
在weblogic.servlet.internal.WebAppServletContext。(WebAppServletContext.java:447)
在weblogic.servlet.internal.WebAppServletContext。(WebAppServletContext.java:493)
在weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
在weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:972)
在weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:382)
在weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
在weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
在weblogic.application.internal.flow.DeploymentCallbackFlow $ 1.next(DeploymentCallbackFlow.java:517)
在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
在weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
在weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
在weblogic.application.internal.BaseDeployment $ 1.next(BaseDeployment.java:613)
在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
在weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
在weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
在weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
在weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
在weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
在weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
在weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
在weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
在weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
在weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
在weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)处
在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access $ 000(DeploymentReceiverCallbackDeliverer.java:13)
在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer $ 1.run(DeploymentReceiverCallbackDeliverer.java:46)
在weblogic.work.SelfTuningWorkManagerImpl $ WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
在weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
在weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
原因:java.lang.NoSuchMethodError:javax/persistence/spi/PersistenceUnitInfo.getValidationMode()Ljavax/persistence/ValidationMode;
在org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:621)
在org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)
在weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
在weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
在weblogic.deployment.BasePersistenceUnitInfoImpl。(BasePersistenceUnitInfoImpl.java:158)
在weblogic.deployment.PersistenceUnitInfoImpl。(PersistenceUnitInfoImpl.java:39)
在weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349)
在weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:124)
在weblogic.deployment.ModulePersistenceUnitRegistry。(ModulePersistenceUnitRegistry.java:58)
在weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1790)
在weblogic.servlet.internal.WebAppServletContext.initClassLoader(WebAppServletContext.java:3028)
在weblogic.servlet.internal.WebAppServletContext。(WebAppServletContext.java:447)
在weblogic.servlet.internal.WebAppServletContext。(WebAppServletContext.java:493)
在weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
在weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:972)
在weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:382)
在weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
在weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
在weblogic.application.internal.flow.DeploymentCallbackFlow $ 1.next(DeploymentCallbackFlow.java:517)
在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
在weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
在weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
在weblogic.application.internal.BaseDeployment $ 1.next(BaseDeployment.java:613)
在weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
在weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:184)
在weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:43)
在weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
在weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
在weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:207)
在weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
在weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
在weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
在weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
在weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
在weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)处
在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access $ 000(DeploymentReceiverCallbackDeliverer.java:13)
在weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer $ 1.run(DeploymentReceiverCallbackDeliverer.java:46)
在weblogic.work.SelfTuningWorkManagerImpl $ WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
在weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
在weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

有人知道吗?

(在weblogic 11g中部署时出错)
1)错误是什么?
2)此错误的原因是什么?
3)在需要jar文件的war文件中。不接受吗?
4) jar 有冲突吗?

最佳答案

将此添加到您的weblogic.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app ...>
...
<container-descriptor>
<prefer-application-packages>
<package-name>antlr.*</package-name>
<package-name>org.hibernate.*</package-name>
<package-name>javax.persistence.*</package-name>
</prefer-application-packages>
</container-descriptor>
</weblogic-web-app>

我尝试了 <prefer-web-inf-classes>true</prefer-web-inf-classes>,没有运气。我正在使用Weblogic 11g(10.3.6),Hibernate 4.1.9和Spring 3.2.1。这样,持久性就像一种魅力!

来源 here

关于hibernate - java.lang.NoSuchMethodError : javax/persistence/spi/PersistenceUnitInfo. getValidationMode()Ljavax/persistence/ValidationMode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7990633/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com