I am deploying a JSF app with TomEE 7 and after creating a Web Services the application runs, but not the WS, which gives me an HTTP 500 error.
SEVERE - Error deploying CXF webservice for servlet xxxxx
java.lang.ClassCastException: org.apache.xerces.parsers.XIncludeAwareParserConfiguration cannot be cast to org.apache.xerces.xni.parser.XMLParserConfiguration
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.<init>(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
It seems there is some xerces
class or jar conflict as seen here and here. In my lib folder there is no xerces, but one of the dependencies in my pom.xml loads its latest version (C:\Users\user1\.m2\repository\xerces\xercesImpl\2.11.0\xercesImpl-2.11.0.jar
), which is included in the lib of the app. However, this was like this before the WS were created, and it was working fine. The rest of the application loads fine, it is just that the Servlet for the Web Service cannot load.
I have tried to exclude xerces
from the dependencies in pom.xml
but the error is still there. How can I fix this?
tomee lib/
activemq-broker-5.13.3.jar
activemq-client-5.13.3.jar
activemq-jdbc-store-5.13.3.jar
activemq-kahadb-store-5.13.3.jar
activemq-openwire-legacy-5.13.3.jar
activemq-protobuf-1.1.jar
activemq-ra-5.13.3.jar
bcprov-jdk15on-1.51.jar
bval-core-1.1.1.jar
bval-jsr-1.1.1.jar
catalina-ant.jar
catalina-ha.jar
catalina-storeconfig.jar
catalina-tribes.jar
catalina.jar
commonj.sdo-2.1.1.jar
commons-beanutils-core-1.8.3.jar
commons-cli-1.2.jar
commons-codec-1.10.jar
commons-collections-3.2.2.jar
commons-dbcp2-2.1.jar
commons-digester-1.8.jar
commons-lang-2.6.jar
commons-lang3-3.4.jar
commons-logging-1.1.1.jar
commons-pool2-2.3.jar
cryptacular-1.0.jar
cxf-core-3.1.6.jar
cxf-rt-bindings-soap-3.1.6.jar
cxf-rt-bindings-xml-3.1.6.jar
cxf-rt-databinding-jaxb-3.1.6.jar
cxf-rt-frontend-jaxrs-3.1.6.jar
cxf-rt-frontend-jaxws-3.1.6.jar
cxf-rt-frontend-simple-3.1.6.jar
cxf-rt-management-3.1.6.jar
cxf-rt-rs-client-3.1.6.jar
cxf-rt-rs-extension-providers-3.1.6.jar
cxf-rt-rs-extension-search-3.1.6.jar
cxf-rt-rs-json-basic-3.1.6.jar
cxf-rt-rs-security-cors-3.1.6.jar
cxf-rt-rs-security-jose-3.1.6.jar
cxf-rt-rs-security-jose-jaxrs-3.1.6.jar
cxf-rt-rs-security-oauth2-3.1.6.jar
cxf-rt-rs-service-description-3.1.6.jar
cxf-rt-security-3.1.6.jar
cxf-rt-security-saml-3.1.6.jar
cxf-rt-transports-http-3.1.6.jar
cxf-rt-ws-addr-3.1.6.jar
cxf-rt-ws-policy-3.1.6.jar
cxf-rt-ws-security-3.1.6.jar
cxf-rt-wsdl-3.1.6.jar
ecj-4.5.1.jar
eclipselink-2.6.3.jar
el-api.jar
geronimo-connector-3.1.3.jar
geronimo-javamail_1.4_mail-1.9.0-alpha-2.jar
geronimo-transaction-3.1.3.jar
hawtbuf-1.11.jar
howl-1.0.1-1.jar
hsqldb-2.3.2.jar
jasper-el.jar
jasper.jar
jaspic-api.jar
jasypt-1.9.2.jar
java-support-7.1.1.jar
javaee-api-7.0.jar
javax.faces-2.2.12.jar
javax.json-1.0.4.jar
jaxb-api-2.2.6.jar
joda-time-2.7.jar
johnzon-core-0.9.3-incubating.jar
johnzon-jaxrs-0.9.3-incubating.jar
johnzon-mapper-0.9.3-incubating.jar
jsp-api.jar
mbean-annotation-api-7.0.0.jar
mimepull-1.7.jar
neethi-3.0.3.jar
openejb-api-7.0.0.jar
openejb-client-7.0.0.jar
openejb-core-7.0.0.jar
openejb-core-eclipselink-7.0.0.jar
openejb-cxf-7.0.0.jar
openejb-cxf-rs-7.0.0.jar
openejb-cxf-transport-7.0.0.jar
openejb-ejbd-7.0.0.jar
openejb-hsql-7.0.0.jar
openejb-http-7.0.0.jar
openejb-javaagent.jar
openejb-jee-7.0.0.jar
openejb-jee-accessors-7.0.0.jar
openejb-jpa-integration-7.0.0.jar
openejb-jstl-1.2.jar
openejb-loader-7.0.0.jar
openejb-rest-7.0.0.jar
openejb-server-7.0.0.jar
openejb-webservices-7.0.0.jar
openjpa-2.4.1.jar
opensaml-core-3.1.1.jar
opensaml-profile-api-3.1.1.jar
opensaml-saml-api-3.1.1.jar
opensaml-saml-impl-3.1.1.jar
opensaml-security-api-3.1.1.jar
opensaml-security-impl-3.1.1.jar
opensaml-soap-api-3.1.1.jar
opensaml-xacml-api-3.1.1.jar
opensaml-xacml-impl-3.1.1.jar
opensaml-xacml-saml-api-3.1.1.jar
opensaml-xacml-saml-impl-3.1.1.jar
opensaml-xmlsec-api-3.1.1.jar
opensaml-xmlsec-impl-3.1.1.jar
openwebbeans-ee-1.6.3.jar
openwebbeans-ee-common-1.6.3.jar
openwebbeans-ejb-1.6.3.jar
openwebbeans-el22-1.6.3.jar
openwebbeans-impl-1.6.3.jar
openwebbeans-jsf-1.6.3.jar
openwebbeans-spi-1.6.3.jar
openwebbeans-web-1.6.3.jar
quartz-openejb-shade-2.2.1.jar
saaj-impl-1.3.18.jar
serp-1.14.1.jar
servlet-api.jar
slf4j-api-1.7.21.jar
slf4j-jdk14-1.7.21.jar
stax2-api-3.1.4.jar
swizzle-stream-1.6.2.jar
sxc-jaxb-core-0.8.jar
sxc-runtime-0.8.jar
tomcat-api.jar
tomcat-coyote.jar
tomcat-dbcp.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar
tomcat-jdbc.jar
tomcat-jni.jar
tomcat-util-scan.jar
tomcat-util.jar
tomcat-websocket.jar
tomee-catalina-7.0.0.jar
tomee-common-7.0.0.jar
tomee-jaxrs-7.0.0.jar
tomee-jdbc-7.0.0.jar
tomee-loader-7.0.0.jar
tomee-mojarra-7.0.0.jar
tomee-webapp-7.0.0.jar
tomee-webservices-7.0.0.jar
validation-api-1.1.0.Final.jar
websocket-api.jar
woodstox-core-asl-4.4.1.jar
wsdl4j-1.6.3.jar
wss4j-bindings-2.1.4.jar
wss4j-policy-2.1.4.jar
wss4j-ws-security-common-2.1.4.jar
wss4j-ws-security-dom-2.1.4.jar
wss4j-ws-security-policy-stax-2.1.4.jar
wss4j-ws-security-stax-2.1.4.jar
xbean-asm5-shaded-4.5.jar
xbean-bundleutils-4.5.jar
xbean-finder-shaded-4.5.jar
xbean-naming-4.5.jar
xbean-reflect-4.5.jar
xml-apis-1.4.01.jar
xml-resolver-1.2.jar
xmlschema-core-2.2.1.jar
xmlsec-1.5.8.jar
EDIT
If I delete all reference to xerces inside my webapp in the tomee directory and use this in my pom.xml:
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
Then I don't have the conflict and the servlet loads -- although other things fail now and I cannot call the Web Service because there is no binding, all probably related to the missing xerces.
If the conflict was provoked by a duplicated library or mismatched versions, how can I identify where? Because it seems there is no xerces in TomEE, only in my Web app.