4

I just upgraded the server from JBoss AS 7.1 to WildFly 8. After a lot of migrating work everything works fine except docx4j. I always get the following exceptions. Does anyone have an idea?

Failed to define class org.docx4j.jaxb.NamespacePrefixMapperSunInternal in Module "deployment.ProfilerApp.ear:main" from Service Module Loader: java.lang.LinkageError: Failed to link org/docx4j/jaxb/NamespacePrefixMapperSunInternal (Module "deployment.myapp.ear:main" from Service Module Loader)
Caused by: java.lang.NoClassDefFoundError: com/sun/xml/internal/bind/marshaller/NamespacePrefixMapper
    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_55]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800) [rt.jar:1.7.0_55]
    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:345) [jboss-modules.jar:1.3.0.Final]
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:423) [jboss-modules.jar:1.3.0.Final]
    ... 225 more
Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.marshaller.NamespacePrefixMapper from [Module "deployment.myapp.ear:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final]
    ... 229 more

2014-05-23 11:34:16,243 ERROR [org.jboss.as.ejb3] (default task-5) javax.ejb.EJBTransactionRolledbackException: Unexpected Error

What I have tried now:

  1. Update docx4j to the latest version.
  2. Define com.sun.xml.bind as a dependency in jboss-deployment-structure.xml for web and server package.
  3. Add docx4j as a module for WildFly and define com.sun.xml.bind as dependency.
  4. Change to the older version of com.sun.xml.bind in Wildfly, which is the same module as my jboss-as-7.1.1
  5. Add own JAXB RI (the latest version) in the pom.xml.

But none of above works. I still get the same errors.

Community
  • 1
  • 1
Manuela
  • 1,379
  • 3
  • 16
  • 25
  • Maybe you have to add the docx4j library to the Wildfly libs directory? – Patrick May 23 '14 at 09:47
  • Hello Patrick, i checked the Wildfly modules, jaxb-impl-2.2.5 is standard there. And the bibliothek of docx4j is configured in pom.xml and it shows up in the list of resolved dependencies. – Manuela May 23 '14 at 12:19
  • @Patrick, i will have a try to define the module docx4j in wildfly or just add it to lib. Hope it works! Thank you! – Manuela May 23 '14 at 12:21
  • What does your WEB-INF/jboss-deployment-structure.xml contain? Compare JBoss 7, at http://www.docx4java.org/forums/jboss-f29/jboss-7-config-t1678.html – JasonPlutext May 24 '14 at 02:05
  • Hello Jason, they are the same:( – Manuela May 25 '14 at 06:35

1 Answers1

5

After binding the dependency by myself, the problem was solved:

<dependency>
        <groupId>com.googlecode.jaxb-namespaceprefixmapper-interfaces</groupId>
        <artifactId>JAXBNamespacePrefixMapper</artifactId>
        <version>2.2.4</version>
        <scope>runtime</scope>
     </dependency>
Manuela
  • 1,379
  • 3
  • 16
  • 25