Great information.  The problem is resolved. Thanks

I download apache-servicemix-5.4.0 and I saw lib/endorsed contains following 
jars
org.apache.karaf.exception-2.4.1.jar                      
org.apache.servicemix.specs.saaj-api-1.3-2.4.0.jar
org.apache.servicemix.specs.activation-api-1.1-2.4.0.jar  
org.apache.servicemix.specs.stax-api-1.2-2.4.0.jar
org.apache.servicemix.specs.jaxb-api-2.2-2.4.0.jar        serializer-2.7.2.jar
org.apache.servicemix.specs.jaxp-api-1.4-2.4.0.jar        xalan-2.7.2.jar
org.apache.servicemix.specs.jaxws-api-2.2-2.4.0.jar       xercesImpl-2.11.0.jar

I tested and worked.  Then I narrow down which servicemix jar fix the problem I 
reported in previous email. 
I found org.apache.servicemix.specs.jaxp-api-1.4-2.4.0.jar fix the problem 

It works with endorsed:
org.apache.servicemix.specs.jaxp-api-1.4-2.4.0.jar  serializer-2.7.2.jar  
xalan-2.7.2.jar  xercesImpl-2.11.0.jar

Summary
CXF 3.0.2; Java 7 and xercesImpl 2.11.0 works when endoursed has Jar 
org.apache.servicemix.specs.jaxp-api-1.4-2.4.0.jar  

Thank.

Ed

-----Original Message-----
From: Daniel Kulp [mailto:[email protected]] 
Sent: Wednesday, March 18, 2015 11:23 AM
To: Xu, Ed
Cc: [email protected]
Subject: Re: CXF and xercesImpl.jar conflict. 

It looks like that xml-api jar packages only version 1.0 of the STAX-API.   We 
would require 1.2 (released in 2009) or newer.  (1.3 is the latest).  

You could try the servicemix bundle.  It looks like they pull in 1.2 to 
override the version in xml-api:

http://repo1.maven.org/maven2/org/apache/servicemix/specs/org.apache.servicemix.specs.jaxp-api-1.4/2.4.0/



Dan



> On Mar 18, 2015, at 11:40 AM, [email protected] wrote:
> 
> Thanks Daniel.
> I remove xml-api.jar.
> 
> C:\WorkAxis\AxisTest\endorsed directory  contains
>> xercesImpl-2.11.0.jar
> 
> Run the testing with " -Djava.endorsed.dirs=C:\WorkAxis\AxisTest\endorsed".
> I had error:
> java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
>       at org.apache.xerces.dom.DeferredDocumentImpl.getNodeObject(Unknown 
> Source)
>       at 
> org.apache.xerces.dom.DeferredDocumentImpl.synchronizeChildren(Unknown Source)
>       at org.apache.xerces.dom.CoreDocumentImpl.getDocumentElement(Unknown 
> Source)
>       at 
> org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:872)
>       at 
> org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:778)
>       at 
> org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
>       at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
> 
> This means xml api in Java 7 does not work with xercesImpl-2.11.0.jar.
> I am using Xerces2 Java Parser 2.11.0  
> (http://xerces.apache.org/xerces2-j/index.html) which I got from Xalan-J 
> 2.7.2 (http://xalan.apache.org/xalan-j/).
> 
> I see your idea and did another testing C:\WorkAxis\AxisTest\endorsed 
> directory  contains xercesImpl-2.6.2.jar
> 
> Run the testing with " -Djava.endorsed.dirs=C:\WorkAxis\AxisTest\endorsed".
> I had no error. 
> 
> Summary
> 1. xerces 2.11.0 is latest version.  It does not work with CXF 3.0.2.
> 2. xerces  consists of   xml-apis.jar and xercesImpl.jar 
>     xercesImpl 2.11.0.jar +Java 7 does not work
>     xercesImpl 2.6.2.jar + Java 7 works.
> 
> I read MANIFES.MF of xml-apis.jar of xerces 2.11.0.
> 
> Name: org/xml/sax/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Simple API for XML
> Specification-Vendor: David Megginson
> Specification-Version: 2.0.2 (sax2r3)
> Implementation-Title: org.xml.sax
> Implementation-Version: 2.0.2
> Implementation-Vendor: David Megginson
> Implementation-URL: http://www.saxproject.org/
> 
> Name: org/w3c/dom/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Document Object Model (DOM) Level 3 Core
> Specification-Vendor: World Wide Web Consortium
> Specification-Version: 1.0
> Implementation-Title: org.w3c.dom
> Implementation-Version: 1.0
> Implementation-Vendor: World Wide Web Consortium
> Implementation-URL: http://www.w3c.org/DOM/
> 
> Name: org/w3c/dom/ls/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Document Object Model (DOM) Level 3 Load and Save
> Specification-Vendor: World Wide Web Consortium
> Specification-Version: 1.0
> Implementation-Title: org.w3c.dom.ls
> Implementation-Version: 1.0
> Implementation-Vendor: World Wide Web Consortium
> Implementation-URL: http://www.w3c.org/DOM/
> 
> Name: javax/xml/stream/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Streaming API for XML (StAX) 1.0
> Specification-Vendor: BEA Systems, Inc.
> Specification-Version: 1.0
> Implementation-Title: javax.xml.stream
> Implementation-Version: 1.4.01
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> 
> Name: javax/xml/datatype/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Java API for XML Processing (JAXP) 1.4
> Specification-Vendor: Sun Microsystems Inc.
> Specification-Version: 1.4
> Implementation-Title: javax.xml.datatype
> Implementation-Version: 1.4.01
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> 
> Name: javax/xml/namespace/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Java API for XML Processing (JAXP) 1.4
> Specification-Vendor: Sun Microsystems Inc.
> Specification-Version: 1.4
> Implementation-Title: javax.xml.namespace
> Implementation-Version: 1.4.01
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> 
> Name: javax/xml/parsers/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Java API for XML Processing (JAXP) 1.4
> Specification-Vendor: Sun Microsystems Inc.
> Specification-Version: 1.4
> Implementation-Title: javax.xml.parsers
> Implementation-Version: 1.4.01
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> 
> Name: javax/xml/transform/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Java API for XML Processing (JAXP) 1.4
> Specification-Vendor: Sun Microsystems Inc.
> Specification-Version: 1.4
> Implementation-Title: javax.xml.transform
> Implementation-Version: 1.4.01
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> 
> Name: javax/xml/validation/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Java API for XML Processing (JAXP) 1.4
> Specification-Vendor: Sun Microsystems Inc.
> Specification-Version: 1.4
> Implementation-Title: javax.xml.validation
> Implementation-Version: 1.4.01
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> 
> Name: javax/xml/xpath/
> Comment: xml-commons for http://xml.apache.org/ subproject's use
> Specification-Title: Java API for XML Processing (JAXP) 1.4
> Specification-Vendor: Sun Microsystems Inc.
> Specification-Version: 1.4
> Implementation-Title: javax.xml.xpath
> Implementation-Version: 1.4.01
> Implementation-Vendor: Apache Software Foundation
> Implementation-URL: http://xml.apache.org/commons/
> 
> I believe CXF 3.0.2 uses some XML feature which conflicts new XML API (see 
> error in previous email).
> But, I do not know which part. 
> 
> Any thoughts?
> 
> Thanks
> 
> Ed.
> 
> 
> -----Original Message-----
> From: Daniel Kulp [mailto:[email protected]]
> Sent: Tuesday, March 17, 2015 2:59 PM
> To: [email protected]; Xu, Ed
> Subject: Re: CXF and xercesImpl.jar conflict. 
> 
> 
> Remove the xml-apis jar out of there.   The version in the JDK is newer than 
> what is in the xml-api jar so you should just need the API’s in the JDK.
> 
> Dan
> 
> 
>> On Mar 17, 2015, at 3:54 PM, [email protected] wrote:
>> 
>> While using CXF in an existing SOAP web service Application which uses 
>> xercesImpl.jar (version 2.11.0) , following runtime errors happened.  
>> 
>> Mar 17, 2015 2:03:11 PM org.apache.catalina.startup.Catalina start
>> INFO: Server startup in 4647 ms
>> Mar 17, 2015 2:04:11 PM org.apache.catalina.core.StandardWrapperValve
>> invoke
>> SEVERE: Servlet.service() for servlet [cxf] in context with path 
>> [/axis] threw exception [Servlet execution threw an exception] with 
>> root cause
>> java.lang.NoSuchMethodError: 
>> javax.xml.stream.XMLEventFactory.newFactory()Ljavax/xml/stream/XMLEventFactory;
>>      at 
>> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor$HeadersProcessor.<clinit>(ReadHeadersInterceptor.java:281)
>>      at 
>> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:185)
>>      at 
>> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:65)
>>      at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
>>      at 
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>      at 
>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:243)
>>      at 
>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
>>      at 
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:197)
>>      at 
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:149)
>>      at 
>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
>>      at 
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:290)
>>      at 
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:209)
>>      at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
>>      at 
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:265)
>>      at 
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>>      at 
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>>      at 
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
>>      at 
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
>>      at 
>> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>>      at 
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
>>      at 
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
>>      at 
>> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
>>      at 
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>>      at 
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>>      at 
>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
>>      at 
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
>>      at 
>> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
>>      at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>      at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>      at java.lang.Thread.run(Thread.java:722)
>> 
>> Note:  
>> 1. The application run with " 
>> -Djava.endorsed.dirs=C:\WorkAxis\AxisTest\endorsed"
>> C:\WorkAxis\AxisTest\endorsed directory  contains  xalan 2.7.2 jar 
>> files which are 
>> xalan-2.7.2.jar;serializer-2.7.2.jar;xml-apis-1.4.01.jar and 
>> xercesImpl-2.11.0.jar
>> 
>> 2. If the application run without " 
>> -Djava.endorsed.dirs=C:\WorkAxis\AxisTest\endorsed". 
>> There is no error.   But, this cannot be our solution because we have to use 
>> xercersImpl.jar.  
>> 
>> Problem: Using xercersImpl.jar will cause CXF runtime exception.  
>> Question: Is there a way that CXF SOAP web service  can use xercesImpl.jar ?
>> 
>> 
>> Thank you !!
>> 
>> Ed Xu
> 
> --
> Daniel Kulp
> [email protected] - http://dankulp.com/blog Talend Community Coder - 
> http://coders.talend.com
> 

--
Daniel Kulp
[email protected] - http://dankulp.com/blog Talend Community Coder - 
http://coders.talend.com

Reply via email to