Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-19951

[GSS](7.3.z) Consider internal jaxb-impl module in more situations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 7.3.1.GA
    • XML Frameworks
    • None
    • 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).
    • 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.

      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).

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

                Created:
                Updated:
                Resolved: