Only if Tomcat deploys in a certain order: Could not initialize class org.apache.wss4j.stax.setup.WSSec

1.1k Views Asked by At

I have searched for a solution on the Internet before posting, I found nothing that helps my case.

I have a Tomcat (9.0.5) instance that contains two webapps, let's call them webapp foo and webapp bar. These webapps are compiled using Maven 3.5.3.

foo includes a Maven dependency: org.apache.wss4j:wss4j-ws-security-stax:jar:2.2.4. This Java library is also included in foo's WEB-INF/lib directory, packed inside its own .war file (Maven build process seems to work fine). foo uses CXF 3.3.5 and WSS4J 2.2.4.

Webapp bar does not include org.apache.wss4j:wss4j-ws-security-stax:jar:2.2.4, instead.

I must deploy these two webapps under the same Tomcat instance, so I upload them under ${catalina.base}/webapps and then I run Tomcat.

If Tomcat deploys foo webapp first, nothing goes wrong.

If Tomcat deploys bar webapp first, I got the following error instead:

Could not load or register WS-SecurityPolicy related classes. Please check that (the correct version of) Apache WSS4J is on the classpath: Could not initialize class org.apache.wss4j.stax.setup.WSSec

I am going crazy on this. Based on other topics I found way to enforce Tomcat deployment order, but honestly I do not like that solution. In my opinion, that is a wrong approach.

I do not have set customization on Tomcat classpath, I do not understand why this happens. You can fine below the results of mvn dependency:tree of foo and bar.

BAR:

[INFO] -------------------< bar >--------------------
[INFO] Building bar
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.3:tree (default-cli) @ bar-web ---
[INFO] bar.modules:bar-web:war:5.0.1-SNAPSHOT
[INFO] +- bar.modules:bar-core:jar:5.0.1-SNAPSHOT:compile
[INFO] |  +- bar.modules:bar-jpa:jar:5.0.1-SNAPSHOT:compile
[INFO] |  |  +- org.hibernate:hibernate-entitymanager:jar:4.3.5.Final:compile
[INFO] |  |  |  +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] |  |  |  +- org.hibernate:hibernate-core:jar:4.3.5.Final:compile
[INFO] |  |  |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  |  |  \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] |  |  |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  |  +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.4.Final:compile
[INFO] |  |  |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
[INFO] |  |  |  \- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] |  |  \- org.springframework.data:spring-data-jpa:jar:1.6.0.RELEASE:compile
[INFO] |  |     +- org.springframework.data:spring-data-commons:jar:1.8.0.RELEASE:compile
[INFO] |  |     +- org.springframework:spring-orm:jar:3.2.9.RELEASE:compile
[INFO] |  |     \- org.slf4j:jcl-over-slf4j:jar:1.7.7:runtime
[INFO] |  +- bar.modules:firmaremota-rest-core:jar:1.3.0:compile
[INFO] |  +- org.springframework:spring-aop:jar:3.2.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-context-support:jar:3.2.9.RELEASE:compile
[INFO] |  +- org.apache.commons:commons-collections4:jar:4.0:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.3.2:compile
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.3:compile
[INFO] |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.6:compile
[INFO] |  +- org.apache.httpcomponents:httpmime:jar:4.5.3:compile
[INFO] |  +- commons-httpclient:commons-httpclient:jar:3.1:compile
[INFO] |  +- org.aspectj:aspectjrt:jar:1.7.0:compile
[INFO] |  +- org.aspectj:aspectjweaver:jar:1.7.0:compile
[INFO] |  +- org.hibernate:hibernate-validator:jar:4.3.1.Final:compile
[INFO] |  |  \- org.jboss.logging:jboss-logging:jar:3.1.0.CR2:compile
[INFO] |  +- com.helger:peppol-smp-client:jar:5.2.7:compile
[INFO] |  |  +- com.helger:peppol-commons:jar:5.2.7:compile
[INFO] |  |  |  +- com.helger:ph-security:jar:8.6.6:compile
[INFO] |  |  |  +- com.helger:ph-xml:jar:8.6.6:compile
[INFO] |  |  |  +- com.helger:ph-json:jar:8.6.6:compile
[INFO] |  |  |  +- com.helger:ph-xsds-xmldsig:jar:1.0.1:compile
[INFO] |  |  |  \- dnsjava:dnsjava:jar:2.1.8:compile
[INFO] |  |  +- com.helger:ph-httpclient:jar:8.8.2:compile
[INFO] |  |  |  \- com.helger:ph-http:jar:8.8.2:compile
[INFO] |  |  |     \- com.helger:ph-network:jar:8.8.2:compile
[INFO] |  |  \- com.helger:ph-settings:jar:8.6.6:compile
[INFO] |  +- com.helger:peppol-directory-businesscard:jar:0.5.1:compile
[INFO] |  |  +- com.helger:ph-commons:jar:8.6.6:compile
[INFO] |  |  |  \- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |  +- com.helger:ph-jaxb:jar:8.6.6:compile
[INFO] |  |  +- com.helger:ph-datetime:jar:8.6.6:compile
[INFO] |  |  \- org.slf4j:jul-to-slf4j:jar:1.7.25:compile
[INFO] |  +- commons-codec:commons-codec:jar:1.8:compile
[INFO] |  +- org.bouncycastle:bcprov-jdk15on:jar:1.60:compile
[INFO] |  +- org.codehaus.groovy:groovy:jar:2.4.10:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.7:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.0:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.8.7:compile
[INFO] |  +- org.glassfish.metro:webservices-rt:jar:2.3:compile
[INFO] |  |  \- org.glassfish.metro:webservices-api:jar:2.3:compile
[INFO] |  |     \- javax.annotation:javax.annotation-api:jar:1.2-b03:runtime
[INFO] |  +- no.difi.oxalis:oxalis-document-sniffer:jar:4.1.1:compile
[INFO] |  +- no.difi.vefa:peppol-icd:jar:1.1.3:compile
[INFO] |  |  \- no.difi.vefa:peppol-common:jar:1.1.3:compile
[INFO] |  +- no.difi.vefa:peppol-sbdh:jar:1.1.3:compile
[INFO] |  |  +- no.difi.commons:commons-sbdh:jar:0.9.5:compile
[INFO] |  |  \- com.google.guava:guava:jar:28.1-jre:compile
[INFO] |  |     +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |     +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  |     +- org.checkerframework:checker-qual:jar:2.8.1:compile
[INFO] |  |     +- com.google.errorprone:error_prone_annotations:jar:2.3.2:compile
[INFO] |  |     +- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  |     \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.18:compile
[INFO] |  +- com.oracle:ojdbc16:jar:11.2.0.3.0:compile
[INFO] |  +- javax.mail:javax.mail-api:jar:1.6.0:compile
[INFO] |  +- com.sun.mail:javax.mail:jar:1.5.1:compile
[INFO] |  |  \- javax.activation:activation:jar:1.1:compile
[INFO] |  +- org.springframework:spring-aspects:jar:3.2.9.RELEASE:compile
[INFO] |  +- net.sourceforge.saxon:saxon:jar:9.1.0.8:compile
[INFO] |  +- net.sourceforge.saxon:saxon:jar:dom:9.1.0.8:compile
[INFO] |  +- org.bouncycastle:bcmail-jdk15on:jar:1.60:compile
[INFO] |  |  \- org.bouncycastle:bcpkix-jdk15on:jar:1.60:compile
[INFO] |  \- org.passay:passay:jar:1.5.0:compile
[INFO] +- bar.modules:bar-entity:jar:5.0.1-SNAPSHOT:compile
[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] |     \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- bar.modules:bar-job:jar:5.0.1-SNAPSHOT:compile
[INFO] |  \- org.quartz-scheduler:quartz:jar:2.2.1:compile
[INFO] |     \- c3p0:c3p0:jar:0.9.1.1:compile
[INFO] +- bar.modules:oxalis-bar-integration:jar:1.0.0:compile
[INFO] +- org.springframework:spring-oxm:jar:3.2.9.RELEASE:compile
[INFO] |  +- org.springframework:spring-beans:jar:3.2.9.RELEASE:compile
[INFO] |  \- org.springframework:spring-core:jar:3.2.9.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.2.9.RELEASE:test
[INFO] +- org.springframework.security:spring-security-core:jar:3.2.7.RELEASE:compile
[INFO] |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  \- org.springframework:spring-expression:jar:3.2.13.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-web:jar:3.2.7.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-taglibs:jar:3.2.7.RELEASE:compile
[INFO] |  \- org.springframework.security:spring-security-acl:jar:3.2.7.RELEASE:compile
[INFO] |     +- org.springframework:spring-jdbc:jar:3.2.13.RELEASE:compile
[INFO] |     \- org.springframework:spring-tx:jar:3.2.13.RELEASE:compile
[INFO] +- org.springframework.security:spring-security-config:jar:3.2.7.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.2.9.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.2.9.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:3.2.9.RELEASE:compile
[INFO] +- org.jvnet.jax-ws-commons.spring:jaxws-spring:jar:1.9:compile
[INFO] |  \- org.apache.xbean:xbean-spring:jar:3.14:compile
[INFO] +- com.google.code.gson:gson:jar:2.2.2:compile
[INFO] +- joda-time:joda-time:jar:2.3:compile
[INFO] +- javax:javaee-web-api:jar:6.0:provided
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.3.1:compile
[INFO] +- commons-io:commons-io:jar:2.4:compile
[INFO] +- org.apache.poi:poi:jar:3.16:compile
[INFO] +- org.apache.pdfbox:pdfbox:jar:2.0.0:compile
[INFO] |  +- org.apache.pdfbox:fontbox:jar:2.0.0:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.1.2:compile
[INFO] |  +- ch.qos.logback:logback-core:jar:1.1.2:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.6:compile
[INFO] +- org.webjars:bootstrap:jar:3.3.7-1:compile
[INFO] |  \- org.webjars:jquery:jar:1.11.1:compile
[INFO] +- org.webjars:jquery-ui:jar:1.12.1:compile
[INFO] +- org.webjars:jquery-ui-themes:jar:1.12.1:compile
[INFO] +- org.webjars:datatables:jar:1.10.13:compile
[INFO] +- org.webjars:html5shiv:jar:3.7.2:compile
[INFO] +- org.webjars:respond:jar:1.4.2:compile
[INFO] +- org.webjars:font-awesome:jar:4.6.3:compile
[INFO] +- org.webjars.bower:tinymce:jar:4.4.3:compile
[INFO] +- org.webjars.bower:moment:jar:2.18.1:compile
[INFO] +- xerces:xercesImpl:jar:2.12.0:compile
[INFO] |  \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] +- org.mockito:mockito-core:jar:1.9.5:test
[INFO] |  +- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] |  \- org.objenesis:objenesis:jar:1.0:test
[INFO] \- junit:junit:jar:4.11:test

FOO:

[INFO] -------------------< foo >--------------------
[INFO] Building foo
[INFO] --------------------------------[ war ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ bar-war ---
[INFO] foo.modules:bar-war:war:1.0.0
[INFO] +- foo.modules:bar-notier-core:jar:1.0.0:compile
[INFO] |  +- javax.servlet:servlet-api:jar:2.5:compile
[INFO] |  +- com.sun.jersey:jersey-server:jar:1.17.1:compile
[INFO] |  |  \- com.sun.jersey:jersey-core:jar:1.17.1:compile
[INFO] |  +- com.sun.jersey.contribs:jersey-guice:jar:1.11:compile
[INFO] |  |  +- javax.inject:javax.inject:jar:1:compile
[INFO] |  |  \- com.sun.jersey:jersey-servlet:jar:1.11:compile
[INFO] |  +- foo.modules:bar-notier-integration:jar:1.0.0:compile
[INFO] |  +- org.apache.commons:commons-dbcp2:jar:2.2.0:compile
[INFO] |  |  \- org.apache.commons:commons-pool2:jar:2.5.0:compile
[INFO] |  +- no.difi.oxalis:bar-outbound:jar:4.1.1:compile
[INFO] |  |  +- no.difi.oxalis:bar-document-sniffer:jar:4.1.1:compile
[INFO] |  |  |  \- no.difi.vefa:peppol-icd:jar:1.1.3:compile
[INFO] |  |  +- no.difi.vefa:peppol-lookup:jar:1.1.3:compile
[INFO] |  |  |  +- no.difi.commons:commons-busdox:jar:0.9.5:compile
[INFO] |  |  |  +- no.difi.commons:commons-bdx:jar:0.9.5:compile
[INFO] |  |  |  \- dnsjava:dnsjava:jar:2.1.9:compile
[INFO] |  |  \- no.difi.vefa:peppol-security:jar:1.1.3:compile
[INFO] |  |     \- no.difi.commons:commons-certvalidator:jar:2.2.0:compile
[INFO] |  |        \- net.klakegg.pkix:pkix-ocsp:jar:0.9.0:compile
[INFO] |  +- no.difi.oxalis:bar-commons:jar:4.1.1:compile
[INFO] |  +- com.google.inject.extensions:guice-servlet:jar:4.2.2:compile
[INFO] |  +- commons-io:commons-io:jar:1.3.2:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.26:compile
[INFO] |  +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] |  |  \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] |  \- javax.transaction:jta:jar:1.1:compile
[INFO] +- foo.modules:bar-rest:jar:1.0.0:compile
[INFO] |  \- org.apache.httpcomponents:httpclient:jar:4.5.6:compile
[INFO] |     +- org.apache.httpcomponents:httpcore:jar:4.4.10:compile
[INFO] |     \- commons-codec:commons-codec:jar:1.11:compile
[INFO] +- javax.servlet:javax.servlet-api:jar:4.0.1:provided
[INFO] +- no.difi.oxalis:bar-as4:jar:4.1.9:compile
[INFO] |  +- org.apache.cxf:cxf-core:jar:3.3.5:compile
[INFO] |  |  +- org.glassfish.jaxb:jaxb-runtime:jar:2.3.2:compile
[INFO] |  |  |  +- org.glassfish.jaxb:txw2:jar:2.3.2:compile
[INFO] |  |  |  +- com.sun.istack:istack-commons-runtime:jar:3.0.8:compile
[INFO] |  |  |  +- org.jvnet.staxex:stax-ex:jar:1.8.1:compile
[INFO] |  |  |  \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.16:compile
[INFO] |  |  +- com.fasterxml.woodstox:woodstox-core:jar:5.0.3:compile
[INFO] |  |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] |  |  \- org.apache.ws.xmlschema:xmlschema-core:jar:2.2.5:compile
[INFO] |  +- org.apache.cxf:cxf-rt-security:jar:3.3.5:compile
[INFO] |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:3.3.5:compile
[INFO] |  +- org.apache.cxf:cxf-rt-databinding-jaxb:jar:3.3.5:compile
[INFO] |  +- org.apache.cxf:cxf-rt-wsdl:jar:3.3.5:compile
[INFO] |  |  +- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] |  |  \- org.ow2.asm:asm:jar:7.1:compile
[INFO] |  +- org.apache.cxf:cxf-rt-features-logging:jar:3.3.5:compile
[INFO] |  +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:3.3.5:compile
[INFO] |  |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-bindings-xml:jar:3.3.5:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-frontend-simple:jar:3.3.5:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-ws-addr:jar:3.3.5:compile
[INFO] |  +- org.apache.cxf:cxf-rt-transports-http:jar:3.3.5:compile
[INFO] |  +- org.apache.cxf:cxf-rt-ws-policy:jar:3.3.5:compile
[INFO] |  +- org.apache.cxf:cxf-rt-ws-security:jar:3.3.5:compile
[INFO] |  |  +- org.apache.cxf:cxf-rt-security-saml:jar:3.3.5:compile
[INFO] |  |  +- net.sf.ehcache:ehcache:jar:2.10.6:compile
[INFO] |  |  +- org.apache.wss4j:wss4j-ws-security-stax:jar:2.2.4:compile
[INFO] |  |  |  \- org.apache.wss4j:wss4j-bindings:jar:2.2.4:compile
[INFO] |  |  \- org.apache.wss4j:wss4j-ws-security-policy-stax:jar:2.2.4:compile
[INFO] |  +- org.apache.wss4j:wss4j-ws-security-common:jar:2.2.4:compile
[INFO] |  |  +- org.apache.santuario:xmlsec:jar:2.1.4:compile
[INFO] |  |  +- org.opensaml:opensaml-saml-impl:jar:3.3.0:compile
[INFO] |  |  |  +- org.opensaml:opensaml-profile-api:jar:3.3.0:compile
[INFO] |  |  |  |  \- org.opensaml:opensaml-core:jar:3.3.0:compile
[INFO] |  |  |  |     \- io.dropwizard.metrics:metrics-core:jar:3.1.2:compile
[INFO] |  |  |  +- org.opensaml:opensaml-saml-api:jar:3.3.0:compile
[INFO] |  |  |  |  +- org.opensaml:opensaml-xmlsec-api:jar:3.3.0:compile
[INFO] |  |  |  |  \- org.opensaml:opensaml-soap-api:jar:3.3.0:compile
[INFO] |  |  |  +- org.opensaml:opensaml-security-impl:jar:3.3.0:compile
[INFO] |  |  |  |  \- org.opensaml:opensaml-security-api:jar:3.3.0:compile
[INFO] |  |  |  |     \- org.cryptacular:cryptacular:jar:1.1.1:compile
[INFO] |  |  |  +- org.opensaml:opensaml-xmlsec-impl:jar:3.3.0:compile
[INFO] |  |  |  \- net.shibboleth.utilities:java-support:jar:7.3.0:compile
[INFO] |  |  +- org.opensaml:opensaml-xacml-impl:jar:3.3.0:compile
[INFO] |  |  |  \- org.opensaml:opensaml-xacml-api:jar:3.3.0:compile
[INFO] |  |  +- org.opensaml:opensaml-xacml-saml-impl:jar:3.3.0:compile
[INFO] |  |  |  \- org.opensaml:opensaml-xacml-saml-api:jar:3.3.0:compile
[INFO] |  |  \- org.jasypt:jasypt:jar:1.9.3:compile
[INFO] |  +- org.apache.wss4j:wss4j-ws-security-dom:jar:2.2.4:compile
[INFO] |  +- org.apache.wss4j:wss4j-policy:jar:2.2.4:compile
[INFO] |  +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.2:compile
[INFO] |  +- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] |  \- org.apache.neethi:neethi:jar:3.1.1:compile
[INFO] +- foo.modules:bar-notier-rest-server:jar:1.0.0:compile
[INFO] +- no.difi.oxalis:bar-inbound:jar:4.1.1:compile
[INFO] |  +- com.google.guava:guava:jar:27.0.1-jre:compile
[INFO] |  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  |  +- org.checkerframework:checker-qual:jar:2.5.2:compile
[INFO] |  |  +- com.google.errorprone:error_prone_annotations:jar:2.2.0:compile
[INFO] |  |  +- com.google.j2objc:j2objc-annotations:jar:1.1:compile
[INFO] |  |  \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.17:compile
[INFO] |  +- joda-time:joda-time:jar:2.10.1:compile
[INFO] |  +- no.difi.oxalis:bar-as2:jar:4.1.1:compile
[INFO] |  |  \- javax.mail:mail:jar:1.4.7:compile
[INFO] |  +- org.bouncycastle:bcmail-jdk15on:jar:1.57:compile
[INFO] |  |  +- org.bouncycastle:bcprov-jdk15on:jar:1.57:compile
[INFO] |  |  \- org.bouncycastle:bcpkix-jdk15on:jar:1.57:compile
[INFO] |  \- io.opentracing.contrib:opentracing-web-servlet-filter:jar:0.2.2:compile
[INFO] |     +- io.opentracing:opentracing-api:jar:0.33.0:compile
[INFO] |     \- io.opentracing:opentracing-util:jar:0.31.0:compile
[INFO] +- foo.modules:bar-quartz:jar:1.0.0:compile
[INFO] |  \- org.quartz-scheduler:quartz:jar:2.2.1:compile
[INFO] |     \- c3p0:c3p0:jar:0.9.1.1:compile
[INFO] +- foo.modules:bar-persist:jar:1.0.0:compile
[INFO] |  +- javax.mail:javax.mail-api:jar:1.5.6:compile
[INFO] |  +- org.quartz-scheduler:quartz-jobs:jar:2.2.1:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.2.2:compile
[INFO] |  +- no.difi.oxalis:bar-api:jar:4.1.1:compile
[INFO] |  |  \- no.difi.vefa:peppol-common:jar:1.1.3:compile
[INFO] |  +- org.slf4j:jcl-over-slf4j:jar:1.7.26:compile
[INFO] |  +- com.google.inject:guice:jar:4.2.2:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- no.difi.vefa:peppol-mode:jar:1.1.3:compile
[INFO] |  |  \- com.typesafe:config:jar:1.3.4:compile
[INFO] |  +- no.difi.vefa:peppol-sbdh:jar:1.1.3:compile
[INFO] |  |  \- no.difi.commons:commons-sbdh:jar:0.9.5:compile
[INFO] |  +- no.difi.vefa:peppol-evidence:jar:1.1.3:compile
[INFO] |  +- io.zipkin.brave:brave:jar:5.6.5:compile
[INFO] |  |  +- io.zipkin.zipkin2:zipkin:jar:2.14.2:compile
[INFO] |  |  \- io.zipkin.reporter2:zipkin-reporter:jar:2.8.4:compile
[INFO] |  +- io.zipkin.reporter2:zipkin-sender-urlconnection:jar:2.7.10:compile
[INFO] |  +- io.opentracing:opentracing-noop:jar:0.33.0:compile
[INFO] |  +- io.opentracing.contrib:opentracing-apache-httpclient:jar:0.1.0:compile
[INFO] |  +- io.opentracing.contrib:opentracing-spanmanager:jar:0.0.5:compile
[INFO] |  \- io.opentracing.brave:brave-opentracing:jar:0.33.7:compile
[INFO] +- org.projectlombok:lombok:jar:1.18.4:provided
[INFO] \- org.kohsuke.metainf-services:metainf-services:jar:1.8:provided

Any further help is truly appreciate. Thank you in advance.

EDIT:

Based on Konstantin Pribluda suggestion I added this in my ${catalina.base}/conf/context.xml:

    <Loader delegate="true" />

After this, I got the following error:

Could not load or register WS-SecurityPolicy related classes. Please check that (the correct version of) Apache WSS4J is on the classpath: org/apache/xml/security/exceptions/XMLSecurityException

It seems to be the same error, but on another class.

1

There are 1 best solutions below

2
On

Could be problem with delegation and classloader precedence. In java class resolves own dependencies from own classloader, and higher up in hierarchy. This can lead to classes from your application being ignored even if theyare included in war. Try to play around with delegate setting of classloader. Detailed explanation:

https://tomcat.apache.org/tomcat-9.0-doc/class-loader-howto.html