spring-ws-security has a transitive dependency to pre jakarta javamail
cachescrubber opened this issue · 1 comments
cachescrubber commented
Using spring-ws-security and spring-boot-starter-mail >= 3.0 causes a java.lang.NoClassDefFoundError: javax/activation/DataContentHandler
at runtime.
I could mitigate it by excluding org.apache.geronimo.javamail:geronimo-javamail_1.4_mail
:.
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-security</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.geronimo.javamail</groupId>
<artifactId>geronimo-javamail_1.4_mail</artifactId>
</exclusion>
</exclusions>
</dependency>
fixed with #1358.
[INFO] +- org.springframework.ws:spring-ws-security:jar:4.0.3:compile
[INFO] | +- org.springframework.security:spring-security-core:jar:6.0.3:compile
[INFO] | | \- org.springframework.security:spring-security-crypto:jar:6.0.3:compile
[INFO] | +- org.apache.wss4j:wss4j-ws-security-dom:jar:2.4.1:compile
[INFO] | | +- org.apache.wss4j:wss4j-ws-security-common:jar:2.4.1:compile
[INFO] | | | +- org.opensaml:opensaml-saml-impl:jar:3.4.6:compile
[INFO] | | | | +- org.opensaml:opensaml-profile-api:jar:3.4.6:compile
[INFO] | | | | | \- org.opensaml:opensaml-core:jar:3.4.6:compile
[INFO] | | | | | \- io.dropwizard.metrics:metrics-core:jar:4.2.18:compile
[INFO] | | | | +- org.opensaml:opensaml-saml-api:jar:3.4.6:compile
[INFO] | | | | | +- org.opensaml:opensaml-xmlsec-api:jar:3.4.6:compile
[INFO] | | | | | \- org.opensaml:opensaml-soap-api:jar:3.4.6:compile
[INFO] | | | | +- org.opensaml:opensaml-security-impl:jar:3.4.6:compile
[INFO] | | | | | \- org.opensaml:opensaml-security-api:jar:3.4.6:compile
[INFO] | | | | | \- org.bouncycastle:bcprov-jdk15on:jar:1.59:compile
[INFO] | | | | +- org.opensaml:opensaml-xmlsec-impl:jar:3.4.6:compile
[INFO] | | | | \- net.shibboleth.utilities:java-support:jar:7.5.2:compile
[INFO] | | | +- joda-time:joda-time:jar:2.10.10:compile
[INFO] | | | +- com.google.guava:guava:jar:30.1-jre:compile
[INFO] | | | | \- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | | | +- org.opensaml:opensaml-xacml-impl:jar:3.4.6:compile
[INFO] | | | | \- org.opensaml:opensaml-xacml-api:jar:3.4.6:compile
[INFO] | | | +- org.opensaml:opensaml-xacml-saml-impl:jar:3.4.6:compile
[INFO] | | | | \- org.opensaml:opensaml-xacml-saml-api:jar:3.4.6:compile
[INFO] | | | +- org.jasypt:jasypt:jar:1.9.3:compile
[INFO] | | | \- org.apache.geronimo.javamail:geronimo-javamail_1.4_mail:jar:1.8.4:compile
cachescrubber commented
I forgot the stack trace
java.lang.NoClassDefFoundError: javax/activation/DataContentHandler
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at jakarta.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:613)
at jakarta.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:573)
at jakarta.activation.DataHandler.getDataContentHandler(DataHandler.java:591)
at jakarta.activation.DataHandler.writeTo(DataHandler.java:290)
at jakarta.mail.internet.MimeUtility.getEncoding(MimeUtility.java:316)
at jakarta.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1580)
at jakarta.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2265)
at jakarta.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2225)
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:459)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:323)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:312)
at de.x.y.customer.vc.oss.service.EmailForwardingService.forward(EmailForwardingService.java:67)
...