JBOSS EAP 6.1 - How to exclude Xerces and Replace it by RT.jar (JRE) for xml parsing
aemon Jun 24, 2015 11:15 AMHello,
I have a problem with my Web App on JBOSS EAP 6.1.0.
When I parse an XML file I don't have an error but the result is different from the same Web App running on tomcat / WebSphere / Weblogic (My Web App must be compatible with all those AS).
For a better understanding, a comparison of log between Tomcat and JBOSS
Source Code corresponding to the log : (don't be scared by the this.writelog() it's just for debug with local printing)
In my understanding the problem occurs with SAX Parser which doesn't have the same behaviour between AS (Tomcat is not a full AS but it's easier to say that)
Sax Parser use rt.jar when running on tomcat instead of using xercesImpl 2.9.1 when running on JBOSS EAP 6.1.0.
I have decided to exclude xerces from the classloading and add the dependency with rt.jar in jboss-deployment-structure.xml
But I encounter a new problem : How I could set the dependency with rt.jar as it is not in a jar library but in JRE ?
my jboss-deployment-structure.xml :
Note : We exclude web services subsystem to avoid conflict with CXF.
It generate warning on deployment (I don't think there is a link with my XML Parsing problem but this is the startup log)
15:49:38,225 WARN [org.jboss.as.ee] (MSC service thread 1-9) JBAS011006: Not installing optional component org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:607) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
15:49:38,225 WARN [org.jboss.as.ee] (MSC service thread 1-9) JBAS011006: Not installing optional component org.eclipse.jetty.continuation.Servlet3Continuation$1 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$1
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:607) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
15:49:38,225 WARN [org.jboss.as.ee] (MSC service thread 1-9) JBAS011006: Not installing optional component org.eclipse.jetty.continuation.Servlet3Continuation$2 due to exception: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011054: Could not find default constructor for class org.eclipse.jetty.continuation.Servlet3Continuation$2
at org.jboss.as.ee.component.ComponentDescription$DefaultComponentConfigurator.configure(ComponentDescription.java:607) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:80) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_60]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_60]
15:49:38,365 INFO [org.infinispan.factories.GlobalComponentRegistry] (ServerService Thread Pool -- 49) ISPN000128: Infinispan version: Infinispan 'Delirium' 5.2.6.Final
Is my analysis seems correct ?
If yes, how could I exclude xerces from classloading and replace it by rt.jar ?
If not, what will be the best solution to solve it ? (using xerces 2.9.1 in my web app instead of sax from JRE ?)
Let me know if you need further information (log ?) ?