Spring Hibernate Application从Tomcat迁移到Weblogic

时间:2015-06-22 14:55:48

标签: hibernate spring-mvc tomcat weblogic weblogic-10.x

我正在尝试将Web应用程序从tomcat 8移动到Weblogic 10.3.6。

我正在

<22-Jun-2015 15:39:14 o'clock BST> <Error> <Console> <BEA-240003> 
<Console encountered the following error 
weblogic.application.ModuleException: Failed to load webapp: 'abc.war' at 
weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:395)
                at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
                at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
                at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
                at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
                at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
                at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
                at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
                at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
                at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
                at weblogic.application.internal.SingleModuleDeployment.prepare(SingleModuleDeployment.java:44)
                at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
                at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
                at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
                at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
                at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
                at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
                at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
                at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
                at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
                at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
                at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
                at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
                at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
                at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
                at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
        Caused by: java.lang.IllegalArgumentException: interface javax.persistence.EntityManagerFactory is not visible from class loader
                at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:616)
                at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:592)
                at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:244)
                at java.lang.reflect.WeakCache.get(WeakCache.java:141)
                at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:455)
                at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:738)
                at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:412)
                at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
                at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
                at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:39)
                at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349)
                at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:124)
                at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:58)
                at weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1827)
                at weblogic.servlet.internal.WebAppServletContext.initClassLoader(WebAppServletContext.java:3029)
                at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:448)
                at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:494)
                at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
                at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)
                at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:384)
        >

我添加了Weblogic.xml

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd 
 http://xmlns.oracle.com/weblogic/weblogic-web-app 
 http://xmlns.oracle.com/weblogic/weblogic-web-app/2.0/weblogic-web-app.xsd">
    <context-root>/myapps</context-root>
    <container-descriptor>
        <prefer-application-packages>
            <package-name>org.antlr.*</package-name>
            <package-name>org.hibernate.*</package-name>
            <package-name>javax.persistence.*</package-name>
        </prefer-application-packages>
    </container-descriptor>
</weblogic-web-app>

它在Tomcat中运行良好,但在Weblogic中运行不佳。

请帮我解决。

0 个答案:

没有答案