2 Replies Latest reply on May 22, 2008 7:44 AM by jessica134

    Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/namesp

    jessica134

      Hy, I'am a new user in this forum.

      I have a difficulty please:

      When I use JaxB in Eclipse with maven2 to load .jar, all it works.
      But when I deploy my project, there is an error on JAXBContext jc = JAXBContext.newInstance( "my package" ); The error in Jboss is:

      Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/namespace/QName;
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2259)
      at java.lang.Class.getDeclaredField(Class.java:1852)
      at com.sun.xml.bind.v2.model.nav.ReflectionNavigator.getDeclaredField(ReflectionNavigator.java:218)
      at com.sun.xml.bind.v2.model.nav.ReflectionNavigator.getDeclaredField(ReflectionNavigator.java:22)
      at com.sun.xml.bind.v2.model.impl.RegistryInfoImpl.(RegistryInfoImpl.java:45)
      at com.sun.xml.bind.v2.model.impl.ModelBuilder.addRegistry(ModelBuilder.java:304)
      at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:274)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:416)
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:270)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:103)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:81)
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:152)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:133)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:286)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:244)
      at org.publimap.webapp.metadata.MetadataActionsBean.retour(MetadataActionsBean.java:288)
      at org.publimap.webapp.metadata.MetadataActionsBean.saveMetadataXmlFile(MetadataActionsBean.java:272)
      at org.publimap.webapp.metadata.MetadataActionsBean$$FastClassByCGLIB$$14a7eafe.invoke()
      at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
      at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
      ... 123 more


      My config:
      jboss-4.0.5.GA
      Eclipse Platform Version: 3.3.0
      Jaxb: 2.1.3

      Thanks :)

        • 1. Re: Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/na
          jaikiran

           


          Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/namespace/QName;

          Are you sure you have packaged the all the necessary jar files including the one containing javax/xml/namespace/QName with your application?

          • 2. Re: Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/na
            jessica134

            Thanks for you responce :)

            Yes I'm sure, bc maven creates .jar. and I put these .jar on Jboss:

            Firstrly, I put these generated .jar in folder

            C:\JBoss\jboss-4.0.5.GA\server\default\deploy\jbossws.sar\ of Jboss but it doesn't work (same error: Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/namespace/QName;)

            Then, I try to put these .jar in

            C:\JBoss\jboss-4.0.5.GA\lib\endorsed\ but it doesn't work. (same error)

            I've seen, that Jboss has .jar of Jaxb (jaxb-api.jar and jaxb-impl.jar) in bossws.sar. So, I moved it and put my .jar but it doesn't work. (same error)

            I've seen that there are .jar of Jboss that contains the class javax/xml/namespace/QName, I've tried to move it and put my .jar, but again the same error.

            I've seen also in

            C:\JBoss\jboss-4.0.5.GA\server\default\deploy\jbossws.sar\ there is wsdl4j.jar that contains the folders javax/xml/namespace/ but there isn't the Class Qname. So I tried to move it and put my .jars, but Jboss give me errors:

            java.lang.NoClassDefFoundError: javax/jws/WebService

            I tried to add the class Qname in the jar wsdl4j.jar, but again the error:

            Caused by: java.lang.NoClassDefFoundError: Ljavax/xml/namespace/QName

            I have no idea what I can do :(
            I'm sure that the problem is on Jboss bc I haven't error in eclipse, but i don't know where is the problem