As described in the reply of my previous post, an exception occurred after weblogic cache was cleared.
java 代码
- weblogic.application.ModuleException:
- at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:295)
- at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
- at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:93)
- at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:360)
- at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
- Truncated. see log file for complete stacktrace
- java.lang.ClassCastException: com.ctc.wstx.stax.WstxInputFactory
- at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
- at weblogic.servlet.internal.WebAppHelper.addListenerElements(WebAppHelper.java:244)
- at weblogic.servlet.internal.WebAppHelper$IOHelperImpl.parseXML(WebAppHelper.java:224)
- at weblogic.descriptor.DescriptorCache.parseXML(DescriptorCache.java:324)
- at weblogic.servlet.internal.WebAppHelper.registerTagLibListeners(WebAppHelper.java:174)
- Truncated. see log file for complete stacktrace
- >
After consulting google, I was suggested to overwrite weblogic's default stax parser by setting the Djavax.xml.stream.XMLInputFactory property to com.ctc.wstx.stax.WstxInputFactory. However, jvm quickly complained of not being able to find WstxInputFactory class.
java 代码
- weblogic.management.ManagementException: [Management:141266]Parsing Failure in config.xml: Provider com.ctc.wstx.stax.WstxInputFactory not found
- at weblogic.management.provider.internal.RuntimeAccessImpl.<init>(RuntimeAccessImpl.java:122)
- at weblogic.management.provider.internal.RuntimeAccessService.start(RuntimeAccessService.java:38)
- at weblogic.t3.srvr.ServerServicesManager.startService(ServerServicesManager.java:374)
- at weblogic.t3.srvr.ServerServicesManager.startInStandbyState(ServerServicesManager.java:125)
- at weblogic.t3.srvr.T3Srvr.initializeStandby(T3Srvr.java:630)
- at weblogic.t3.srvr.T3Srvr.startup(T3Srvr.java:402)
- at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:361)
- at weblogic.Server.main(Server.java:67)
This is easy. Adding the lib into classpath will do. Sadly, another shock bursted right after wstx.jar was included.
java 代码
- <error> <j2ee> <bea-< span="">160197> <unable to load descriptor d:\bea\weblogic92\server\lib\consoleapp meta-inf="" application.xml of module consoleapp. the error is weblogic.descriptor.descriptorexception: unmarshaller failed="" <="" span="">
- at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:147)
- at weblogic.descriptor.DescriptorManager.createDescriptor(DescriptorManager.java:280)
- at weblogic.descriptor.DescriptorManager.createDescriptor(DescriptorManager.java:248)
- at weblogic.application.descriptor.AbstractDescriptorLoader2.getDescriptorBeanFromReader(AbstractDescriptorLoader2.java:749)
- at weblogic.application.descriptor.AbstractDescriptorLoader2.createDescriptorBean(AbstractDescriptorLoader2.java:376)
- at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBeanWithoutPlan(AbstractDescriptorLoader2.java:720)
- at weblogic.application.descriptor.AbstractDescriptorLoader2.loadDescriptorBean(AbstractDescriptorLoader2.java:729)
- at weblogic.application.ApplicationDescriptor.getApplicationDescriptor(ApplicationDescriptor.java:277)
- at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:174)
- at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
- at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
- at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
- at weblogic.deploy.internal.InternalAppProcessor.createBeansForInternalApp(InternalAppProcessor.java:396)
- at weblogic.deploy.internal.InternalAppProcessor.stageFilesAndCreateBeansForInternalApp(InternalAppProcessor.java:250)
- at weblogic.deploy.internal.InternalAppProcessor.updateConfiguration(InternalAppProcessor.java:196)
- at weblogic.management.deploy.internal.DeploymentServerService.init(DeploymentServerService.java:144)
- at weblogic.management.deploy.internal.DeploymentPreStandbyServerService.start(DeploymentPreStandbyServerService.java:32)
- at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
- at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
- at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
- Caused by: com.bea.xml.XmlException: weblogic.descriptor.BeanAlreadyExistsException: Bean already exists: "weblogic.j2ee.descriptor.ModuleBeanImpl@8120252(/Modules[weblogic.descriptor.internal.DescriptorBeanKey@8426316])"
- at com.bea.staxb.runtime.internal.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:54)
- at com.bea.staxb.runtime.internal.RuntimeBindingType$BeanRuntimeProperty.setValue(RuntimeBindingType.java:483)
- at com.bea.staxb.runtime.internal.AttributeRuntimeBindingType$QNameRuntimeProperty.fillCollection(AttributeRuntimeBindingType.java:385)
- at com.bea.staxb.runtime.internal.MultiIntermediary.getFinalValue(MultiIntermediary.java:52)
- at com.bea.staxb.runtime.internal.AttributeRuntimeBindingType.getFinalObjectFromIntermediary(AttributeRuntimeBindingType.java:145)
- at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalBindingType(UnmarshalResult.java:185)
- at com.bea.staxb.runtime.internal.UnmarshalResult.unmarshalDocument(UnmarshalResult.java:154)
- at com.bea.staxb.runtime.internal.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:65)
- at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:136)
What the hell...
Seems like wstx parser can't read weblogic descriptors... Now what? Think hard...
The default consoleapp will be loaded before my application. Why not delay the introduction of wstx libraries? Insteadof setting propeties inside jvm arguments, I put them in a static block of the codes. This guarantees a late loading.
java 代码
- static {
- System.setProperty("javax.xml.stream.XMLInputFactory",
- "com.ctc.wstx.stax.WstxInputFactory");
- System.setProperty("javax.xml.stream.XMLOutputFactory",
- "com.ctc.wstx.stax.WstxOutputFactory");
- System.setProperty("javax.xml.stream.XMLEventFactory",
- "com.ctc.wstx.stax.evt.WstxEventFactory");
- }
Keep wstx.jar inside classpath to avoid the exception below during server start.
java 代码
- javax.xml.stream.FactoryConfigurationError: Provider com.ctc.wstx.stax.WstxInputFactory not found
- at javax.xml.stream.FactoryFinder.newInstance(FactoryFinder.java:72)
- at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:120)
- at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:92)
- at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
- at weblogic.descriptor.internal.MarshallerFactory$1.createDescriptor(MarshallerFactory.java:79)
- Truncated. see log file for complete stacktrace
Now clear the cache and test again...
Yes, it's working! Finally!
分享到:
相关推荐
XFire,全称为XFire All 1.2.4,是一款高效的Web服务实现框架,它基于Java编程语言。XFire提供了一个轻量级、高性能的解决方案,用于创建、消费和部署Web服务。这个框架支持多种Web服务标准,如SOAP、WSDL(Web服务...
在本篇文章中,我们将详细介绍如何使用 CXF (Community Xenith Framework)、Spring 框架以及 JDK 1.5 来开发并部署 WebService 应用到 WebLogic 9.2 平台。尽管现在 Java 技术已经发展到了更新的版本,但这篇教程...
进行WebService开发中所用到的xfire所有相关包如:xfire-jsr181-api-1.0-M1.jar、xfire-jaxws-1.2.6.jar、xfire-java5-1.2.6.jar、xfire-core-1.2.6.jar、xfire-annotations-1.2.6.jar、xfire-aegis-1.2.6.jar、...
stax-api-1.0.1.jar stax-utils-snapshot-20040917.jar wsdl4j-1.5.2.jar wstx-asl-3.0.1.jar xfire-aegis-1.2.2.jar xfire-annotations-1.2.2.jar xfire-core-1.2.2.jar xfire-java5-1.2.2.jar xfire-jsr181-api-...
在Weblogic Server 10.3中,Axis2的StAX API实现会与Weblogic Server的XML Input Factory冲突。 结论 将应用部署在Weblogic Server 10.3中与Axis2冲突的问题可以通过删除项目WEB-INF\lib目录下的wstx-asl-3.2.4....
stax-api-1.0.1.jar stax-utils-20040917.jar wsdl4j-1.5.2.jar wstx-asl-3.0.1.jar xfire-aegis-1.2.6.jar xfire-annotations-1.2.6.jar xfire-core-1.2.6.jar xfire-java5-1.2.6.jar xfire-jsr181-api-1.0-M1.jar ...
`stax-api.jar`是Java中用于处理XML流的STAX(Streaming API for XML)的API接口库,它提供了与XML数据交互的一套标准化接口。 STAX(Streaming API for XML)是一种低级别的XML解析方法,相比DOM(Document Object...
STAX(Streaming API for XML)是Java平台上的一个XML处理API,它提供了对XML文档的事件驱动解析。与DOM(Document Object Model)不同,STAX不是加载整个XML文档到内存中形成一个树形结构,而是通过事件(如开始...
6. **性能优化**:XFire支持基于StAX的高效XML处理,减少了内存占用,提升了处理速度,这对于大型企业应用尤为重要。 需要注意的是,虽然XFire_lib.jar是Spring与XFire集成的关键,但Spring框架本身所需的其他jar...
《xfire开发所需jar包详解》 在Java开发领域,框架的选择往往直接影响到项目的效率和质量。XFire,作为一个早期的、基于Java的Web服务实现框架,为开发者提供了快速构建和部署SOAP服务的能力。本文将深入探讨xfire...
stax-api-1.0.1.jar stax-utils-snapshot-20040917.jar wsdl4j-1.5.2.jar wstx-asl-3.0.1.jar xfire-aegis-1.2.2.jar xfire-annotations-1.2.2.jar xfire-core-1.2.2.jar xfire-java5-1.2.2.jar xfire-jsr181-api-...
**STAX API 1.0-2:XML处理的关键组件** STAX,全称为Streaming API for XML,是一种用于处理XML的Java API。STAX提供了一种流式处理XML文档的方法,与DOM(Document Object Model)相比,它更加高效且内存占用更低...
stax-api-1.0.1.jar stax-utils-20040917.jar wsdl4j-1.6.1.jar wss4j-1.5.0.jar wstx-asl-3.2.9.jar xbean-spring-2.8.jar xfire-all-1.2.6.jar xfire-jsr181-api-1.0-M1.jar xfire-spring-1.2.6.jar xml-...
STAX(Streaming API for XML)是一种用于处理XML的Java API,它提供了事件驱动的解析方式,使得开发者可以高效地读取和写入XML文档。在Java世界中,STAX提供了比DOM(Document Object Model)更高效的处理XML的方式...
XFire支持多种协议,包括SOAP、RESTful风格的服务,以及JAXB、DOM、StAX等多种XML解析方式。XFire还集成了Spring框架,使得与企业级应用的整合变得更加方便。 **三、XFire的主要特性** 1. **简单易用**:XFire提供...
3. **高性能**: XFire 使用了 StAX(Streaming API for XML)进行 XML 解析,相比 DOM 和 SAX,StAX 提供了更优秀的性能和更低的内存占用。 4. **广泛的协议支持**: XFire 支持 SOAP 1.1 和 1.2,WS-Security,WS-...
3. **服务发现**:通过UDDI(Universal Description, Discovery, and Integration)接口,XFire能够实现服务的注册和查找。 4. **WS-Security**:XFire提供对WS-Security规范的支持,可以实现Web服务的安全性,包括...
- `stax-api.jar`, `stax.jar`: STAX(Streaming API for XML)是处理XML的一种低级别的API,用于读写XML流。 - `jaxb-api.jar`, `jaxb-impl.jar`: JAXB(Java Architecture for XML Binding)用于将Java类与XML ...
3. **Stax**:xfire使用StAX(Streaming API for XML)进行XML解析,它允许程序在解析XML时进行事件驱动的处理,提高了处理速度和效率。 4. **Spring Integration**:xfire可以很好地与Spring框架集成,使得服务的...
5. **其他依赖**:在集成过程中,可能还需要其他的依赖,如`stax-api.jar`和`woodstox-core-asl.jar`,它们是StAX(Streaming API for XML)的实现,用于XML的读写操作。还有可能需要`xercesImpl.jar`和`xml-apis....