[jboss-jira] [JBoss JIRA] (WFLY-12827) Class not found com.sun.xml.internal.ws.encoding.StringDataContentHandler

Dominik Derwiński (Jira) issues at jboss.org
Wed Nov 27 02:35:00 EST 2019


    [ https://issues.jboss.org/browse/WFLY-12827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13818328#comment-13818328 ] 

Dominik Derwiński edited comment on WFLY-12827 at 11/27/19 2:35 AM:
--------------------------------------------------------------------

For now I have confirmed your findings that mailcap[-default] files are only in jakarta.activation-1.2.1.jar and jakarta.mail-1.6.4.jar, and they do not reference those wrong classes directly.

I have also found out that WildFly uses com.sun.activation:jakarta.activation:1.21 which contains com.sun.activation.registries and com.sun.activation.viewers packages, whereas pulling JAXB and JAX-WS reference implementations (org.glassfish.jaxb:jaxb-runtime:2.3.2 and com.sun.xml.ws:jaxws-rt:2.3.2) into my projects (I don't want to deal with specifics of using two different implementations of those standards in EE apps, and standalone apps + test classes; and on JDK 11 have no choice but to add them as dependencies), pulls jakarta.activation:jakarta.activation-api:jar:1.2.1, which contains same classes as com.sun.activation:jakarta.activation:1.21 in javax.activation package, but no com.sun.* packages and no mailcap.default file.

Similar issues may arise from pulling jakarta.mail:jakarta.mail-api:jar:1.6.4 (no mailcap file) instead of com.sun.mail:jakarta.mail:1.6.4 (has mailcap file and depends on com.sun.activation:jakarta.activation).

Seems like it may be a problem of my own making, created by the confusion of removing classes in JDK and Jakarta EE renames. I'll check if the problem will be gone with fixing the dependencies. It will be extra work to exclude standard activation api dependencies from JAXB and JAX-WS RIs (I use duplicate finder to prevent duplicate classes on classpath).


was (Author: morvael):
For now I have confirmed your findings that mailcap[-default] files are only in jakarta.activation-1.2.1.jar and jakarta.mail-1.6.4.jar, and they do not reference those wrong classes directly.

I have also found out that WildFly uses com.sun.activation:jakarta.activation:1.21 which contains com.sun.activation.registries and com.sun.activation.viewers packages, whereas pulling JAXB and JAX-WS reference implementations (org.glassfish.jaxb:jaxb-runtime:2.3.2 and com.sun.xml.ws:jaxws-rt:2.3.2) into my projects (I don't want to deal with specifics of using two different implementations of those standards in EE apps, and standalone apps + test classes; and on JDK 11 have no choice but to add them as dependencies), pulls jakarta.activation:jakarta.activation-api:jar:1.2.1, which contains same classes as com.sun.activation:jakarta.activation:1.21 in javax.activation package, but no com.sun.* packages and no mailcap.default file.

Similar issues may arise from pulling jakarta.mail:jakarta.mail-api:jar:1.6.4 (no mailcap file) instead of com.sun.mail:jakarta.mail:1.6.4 (has mailcap file and depends on com.sun.activation:jakarta.activation).

Seems like it may be a problem of my own making, created by the confusion of removing classes in JDK and Jakarta EE renames. I'll check if the problem will be gone with fixing the dependencies.

> Class not found com.sun.xml.internal.ws.encoding.StringDataContentHandler
> -------------------------------------------------------------------------
>
>                 Key: WFLY-12827
>                 URL: https://issues.jboss.org/browse/WFLY-12827
>             Project: WildFly
>          Issue Type: Bug
>          Components: Mail
>    Affects Versions: 18.0.1.Final
>            Reporter: Dominik Derwiński
>            Assignee: Tomaž Cerar
>            Priority: Major
>
> Trying to send email I get:
> {noformat}
> [2019-11-26 03:10:04.781] [javax.activation] [EE-ManagedThreadFactory-default-Thread-18] [FINE ] [com.sun.activation.registries.LogSupport] [log] [43] : MailcapCommandMap: createDataContentHandler for text/plain
> [2019-11-26 03:10:04.781] [javax.activation] [EE-ManagedThreadFactory-default-Thread-18] [FINE ] [com.sun.activation.registries.LogSupport] [log] [43] :   search DB #0
> [2019-11-26 03:10:04.781] [javax.activation] [EE-ManagedThreadFactory-default-Thread-18] [FINE ] [com.sun.activation.registries.LogSupport] [log] [43] :     got content-handler
> [2019-11-26 03:10:04.781] [javax.activation] [EE-ManagedThreadFactory-default-Thread-18] [FINE ] [com.sun.activation.registries.LogSupport] [log] [43] :       class com.sun.xml.internal.ws.encoding.StringDataContentHandler
> [2019-11-26 03:10:04.781] [javax.activation] [EE-ManagedThreadFactory-default-Thread-18] [FINE ] [com.sun.activation.registries.LogSupport] [log] [49] : Can't load DCH com.sun.xml.internal.ws.encoding.StringDataContentHandler: java.lang.ClassNotFoundException: com.sun.xml.internal.ws.encoding.StringDataContentHandler from [Module "javax.activation.api" version 1.2.1 from local module loader @82de64a (finder: local module finder @659499f1 (roots: /u01/wildfly/wildfly18/modules,/u01/wildfly/wildfly18/modules/system/layers/base))]
>         at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
>         at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
>         at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
>         at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
>         at java.base/java.lang.Class.forName0(Native Method)
>         at java.base/java.lang.Class.forName(Class.java:315)
>         at javax.activation.api at 1.2.1//javax.activation.MailcapCommandMap.getDataContentHandler(MailcapCommandMap.java:598)
>         at javax.activation.api at 1.2.1//javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:555)
>         at javax.activation.api at 1.2.1//javax.activation.DataHandler.getDataContentHandler(DataHandler.java:600)
>         at javax.activation.api at 1.2.1//javax.activation.DataHandler.writeTo(DataHandler.java:299)
>         at javax.mail.api at 1.6.4//javax.mail.internet.MimeUtility.getEncoding(MimeUtility.java:316)
>         at javax.mail.api at 1.6.4//javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1551)
>         at javax.mail.api at 1.6.4//javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1148)
>         at javax.mail.api at 1.6.4//javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:498)
>         at javax.mail.api at 1.6.4//javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1509)
>         at javax.mail.api at 1.6.4//javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2238)
>         at javax.mail.api at 1.6.4//javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2198)
>         at javax.mail.api at 1.6.4//javax.mail.Transport.send(Transport.java:99)
> {noformat}
> Maybe it's just missing module dependency for javax.mail.api, maybe you need to include JAXB and JAXWS libraries in WildFly modules for use on JDK 11+, when they were removed from JDK.



--
This message was sent by Atlassian Jira
(v7.13.8#713008)



More information about the jboss-jira mailing list