Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-13968

Consider internal jaxb-impl module in more situations

    XMLWordPrintable

Details

    • Hide
      • Build the attached jaxb-exclusion app (mvn clean package).
      • Deploy inside EAP.
      • Start the EAP defining a global System Property to the old ContextFactory defined in the impl module:
        ./standalone.sh -Djavax.xml.bind.context.factory=com.sun.xml.bind.v2.ContextFactory
        

      The same happens if we define the same property in a jaxb.properties file.

      Show
      Build the attached jaxb-exclusion app ( mvn clean package ). Deploy inside EAP. Start the EAP defining a global System Property to the old ContextFactory defined in the impl module: ./standalone.sh -Djavax.xml.bind.context.factory=com.sun.xml.bind.v2.ContextFactory Access the URL http://localhost:8080/jaxb-exclusion/TestServlet A exception will be thrown in the log: "javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath." The same happens if we define the same property in a jaxb.properties file.
    • Workaround Exists
    • Hide

      Include the jaxb implementation library provided by the EAP in the application (this way the factory is in the thread context class loader). For example using a jboss-deployment-structure.xml:

      <jboss-deployment-structure>
        <deployment>
          <dependencies>
            <module name="com.sun.xml.bind"/>
          </dependencies>
        </deployment>
      </jboss-deployment-structure>
      

      The impl module can also be added to all applications as a global module (instead of a j-d-s.xml for each application).

      Show
      Include the jaxb implementation library provided by the EAP in the application (this way the factory is in the thread context class loader). For example using a jboss-deployment-structure.xml : <jboss-deployment-structure> <deployment> <dependencies> <module name= "com.sun.xml.bind" /> </dependencies> </deployment> </jboss-deployment-structure> The impl module can also be added to all applications as a global module (instead of a j-d-s.xml for each application).
    • ---
    • ---

    Description

      Currently the ContextFinder.java also looks for the jaxb factories inside the module impl in two situations (to search factory JAXBContextFactory and old JAXBContext using the services). But it does not do the same when using the factory specified in a system property or inside a jaxb.properties file. The idea is making this uniform and do always the same (searching in the TCCL and then, if not found, inside the internal module impl for each specification step).

      Attachments

        Issue Links

          Activity

            People

              rhn-support-rmartinc Ricardo Martin Camarero
              rhn-support-rmartinc Ricardo Martin Camarero
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: