7 Replies Latest reply on Jul 11, 2011 12:08 PM by jaikiran

    JAXB module dependency

    adamw

      Hello,

       

      I have a webapp which, through a third-pary library, uses JAXB in the following way:

       

      JAXBContext.newInstance(typePackage, c.getClassLoader());

       

      where c is a class from the library.

      The exception I am getting from this line is:

       

      javax.xml.bind.JAXBException: Provider com.sun.xml.internal.bind.v2.ContextFactory not found

      - with linked exception:

      [java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory from [Module "deployment.jbison-frontend-knob.yml:main" from Service Module Loader]]

       

      as the platform-default provider is tried to loaded.

      I wanted to expose JAXB to my app by adding a module dependency. To do that, I add a manifest file with the following contents:

       

      Dependencies: javax.xml.bind.api

       

      but this didn't change anything.

      (I also tried adding a non-existent module, and got a deployment exception, so the manifest is picked up by the AS)

       

      Do I need to add any other module dependency? Or just bundle a jaxb impl with the application?

       

      Btw. this used to work in AS6.

       

      Adam