Spring MVC 3.0.0 应用程序不会在 Weblogic Server 11gR1 上引导 - ClassCastException

发布于 2024-08-19 18:24:00 字数 12302 浏览 6 评论 0 原文

我有一个基于 Spring MVC (3.0.0.RELEASE) 的应用程序,需要部署到 Oracle Weblogic Server 11gR1。它在 Spring TC Server 上运行良好。当我部署应用程序 WAR 文件(通过 STS/Eclipse“服务器”视图或“自动部署”文件夹,或通过 Web 管理手动部署)时,出现以下异常:

    <Feb 3, 2010 9:17:20 AM GMT> <Error> <org.springframework.web.context.ContextLoader> <BEA-000000> <Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/webapp-config.xml]; nested exception is java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
 at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
 at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:458)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:388)
 at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
 at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
 at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.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:121)
 at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
 at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
 at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
 at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
 at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
 at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 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:83)
 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:1267)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
 at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:39)
 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:196)
 at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
 at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
 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:173)
 at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
 at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

这是由以下原因引起的:

Caused By: java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory
 at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
 at org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:89)
 at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
 at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
 at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:458)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:388)
 at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
 at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
 at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.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:121)
 at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
 at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
 at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
 at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
 at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
 at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 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:83)
 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:1267)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
 at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:39)
 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:196)
 at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
 at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
 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:173)
 at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
 at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

现在这是在我之后已经发现需要设置:

<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>

在 weblogic.xml 中(这解决了我之前的无数问题 - 类路径完全被搞砸了,我在 Spring 的“getBeanDefinitionDefaults(...)”中遇到了“NoSuchMethodError”问题,该问题捆绑在我的 WAR 的 WEB 中-INF/lib 目录)。

调查显示 javax.xml.parsers.DocumentBuilderFactory 来自 xml-apis-1.0.b2.jar,它是由 maven 从 commons-digester、dom4j 和简而言之,我需要它来运行我的 Spring 应用程序,

我已经检查过(并仔细检查过),并且我没有将 weblogic 类与我的战争捆绑在一起,所以我不会开枪。 "

我也在 java.net 论坛上看到过这篇文章: http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs81/notes/resolved_sp03.html 这似乎也没有做任何事情。

我不明白的是,我告诉Weblogic更喜欢我的WEB-INF/lib中的jar,我需要的jar就在那里,并且错误来自Spring,而不是Weblogic(即我没有强迫服务器本身使用它无法处理的 jar。)

我没有在这个问题中添加更多的 Spring 配置,因为我不确定它的相关性。但是,如果这有帮助,请告诉我,我会添加它。

希望有人能帮忙。

雷格斯,安德鲁

I have a Spring MVC (3.0.0.RELEASE) based application I need to deploy to Oracle Weblogic Server 11gR1. It works fine on Spring TC Server. When I deploy my application WAR file (either via STS/Eclipse "Servers" view or to the "auto-deploy" folder, or manually via the web admin) I get the following exception:

    <Feb 3, 2010 9:17:20 AM GMT> <Error> <org.springframework.web.context.ContextLoader> <BEA-000000> <Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/webapp-config.xml]; nested exception is java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
 at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
 at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:458)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:388)
 at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
 at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
 at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.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:121)
 at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
 at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
 at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
 at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
 at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
 at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 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:83)
 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:1267)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
 at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:39)
 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:196)
 at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
 at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
 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:173)
 at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
 at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

Which is caused by:

Caused By: java.lang.ClassCastException: weblogic.xml.jaxp.RegistryDocumentBuilderFactory cannot be cast to javax.xml.parsers.DocumentBuilderFactory
 at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
 at org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:89)
 at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
 at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
 at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
 at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93)
 at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
 at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:458)
 at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:388)
 at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261)
 at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:192)
 at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.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:121)
 at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:181)
 at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1801)
 at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3045)
 at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1397)
 at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:460)
 at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:425)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 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:83)
 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:1267)
 at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
 at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:409)
 at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:39)
 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:196)
 at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
 at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
 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:173)
 at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
 at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)

Now this is after I have already discovered the need to set:

<wls:prefer-web-inf-classes>true</wls:prefer-web-inf-classes>

in weblogic.xml (that fixed my myriad of earlier problems - the classpath was totally screwed and I was getting "NoSuchMethodError" problems for Spring's "getBeanDefinitionDefaults(...) which was bundled in my WAR's WEB-INF/lib directory).

Investigation has shown that javax.xml.parsers.DocumentBuilderFactory comes from xml-apis-1.0.b2.jar which is being brought in by maven from commons-digester, dom4j and jdom. In short, I need it for my Spring App to run.

I've checked (and double checked) and I'm not bundling the weblogic class with my war so I'm not shooting myself in my own foot.

I've also seen this post on the java.net forums: http://forums.java.net/jive/thread.jspa?messageID=216363 - the Log4J workaround didn't work (I presume because the root of the problem isn't Log4J) and this bug fix note on oracle.com (search for "CR172469") http://download-llnw.oracle.com/docs/cd/E13222_01/wls/docs81/notes/resolved_sp03.html This seems to do nothing either.

What I don't understand is, I'm telling Weblogic to prefer the jars in my WEB-INF/lib, the jar I need is in there, and the error is coming from Spring, not Weblogic (i.e. I'm not forcing the server itself to use a jar it can't handle.)

I've held off from adding more of my Spring config to this question as I'm not sure its relevant. If however this would help, please let me know and I'll add it.

Hope someone can help.

Regs, Andrew

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

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

发布评论

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

评论(1

风为裳 2024-08-26 18:24:00

您的应用程序几乎肯定不应该在其内部包含任何 javax.* 类 - 这些通常由应用程序服务器处理。如果你这样做,你最终会得到像这样的ClassCastExceptions

您需要阻止 Maven 拖入诸如 xml-apis-1.0.b2.jar 之类的内容,它不属于您的应用程序内部。

如果解决了这个问题,那么您就不需要担心特定于 weblogic 的类加载器设置。

Your application should almost certainly not be including any javax.* classes within itself - these are usually handled by the appserver. If you do this, you end up with ClassCastExceptions just like this.

You need to stop maven from dragging in stuff like xml-apis-1.0.b2.jar, it doesn't belong inside your application.

If you fix that, then you won't need to worry about weblogic-specific classloader settings.

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