2 Replies Latest reply on Feb 17, 2009 12:39 AM by Claus Ibsen

    javax.xml.namespace.QName issue

    Oliver Newell Newbie

      Hello -

       

      I have a SMX 4 issue where a OSGi bundle that imports javax.xml.namespace isn't able to find javax.xml.namespace.QName at runtime (class not found). The bundle itself loads into SMX 4 just fine, and the manifest definitely imports javax.xml.namespace.

       

      I see that SMX 4 isn't exposing the version of  the javax.xml.namespace package that comes with Java 1.5/1.6, but is using and Apache reference implementation instead. The

      Jar is in:

       

      org/apache/servicemix/specs/org.apache.servicemix.specs.jaxp-api-1.4/1.2.0.0-fuse

       

      I see that this Jar is installed in my SMX 4 instance when I start it up, and it looks like it exports the javax.xml.namespace package, so I'm baffled. Has anyone else come across this?

       

      -Oliver

        • 1. Re: javax.xml.namespace.QName issue
          Oliver Newell Newbie

          I figured this one out. I had loaded an XmlBeans bundle from the Spring OSGi bundle repository, and it didn't have an import for the javax.xml.namespace in the Manifest. So it was that bundle trying to load javax.xml.namespace.QName, not my application bundle.

           

          I think the Spring bundle was probably tested in an OSGi container that included the built-in Java 1.5/1.6 javax.xml.namespace package by default (which SMX doesn't - it substitutes an Apache version). So that's why it worked for whoever built it. I guess substituting for JDK packages still has its gotchas, even in an OSGi world!

           

          I'm pretty new to OSGi, but it seems like there are quite a few class loading details to be aware of. One thing that would be beneficial is for class loading error messages to print out a bit of information about the bundle that is trying to load the class. That would have been a timesaver in this case since I got faked out and thought it was my App bundle having the problem.

           

          -Oliver

          • 2. Re: javax.xml.namespace.QName issue
            Claus Ibsen Master

            Good idea about the detailed error message.

             

            Feel free to raise a RFE at the JIRA for it:

            http://issues.apache.org/activemq/browse/SM