glassfish
  1. glassfish
  2. GLASSFISH-11748

JAXB does not work in vanilla OSGi bundle context

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: V3
    • Fix Version/s: 3.1
    • Component/s: web_services
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      11,748

      Description

      I am deploying a vanilla OSGi bundle in GlassFish. This has nothing to do with
      any Java EE programming model. It tries to obtain a JAXBContext to do some XML
      unmarshalling, but gets NPE as the stack below shows:

      java.lang.NullPointerException
      at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:95)
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:204)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:375)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:565)
      at sahoo.metainfservicetest.Activator.start(Activator.java:9)
      at
      org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:640)
      at org.apache.felix.framework.Felix.activateBundle(Felix.java:1700)
      at org.apache.felix.framework.Felix.startBundle(Felix.java:1622)
      at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:915)
      at org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl.java:114)
      at
      org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand(Activator.java:286)
      at org.apache.felix.shell.remote.Shell.run(Shell.java:109)
      at java.lang.Thread.run(Thread.java:619)

      To reproduce, use the attached test case. Run it like this:
      mvn package
      cp target/metainfservicetest-1.0-SNAPSHOT.jar domain1/autodeploy/bundles/
      See server.log

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Martin Grebac
            Reporter:
            Sanjeeb Sahoo
          • Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: