0 Replies Latest reply on Aug 26, 2010 11:27 AM by Mary-Anne Zhang

    Can't create a new JAXBContext in Jboss after upgrading to jaxb 2.1

    Mary-Anne Zhang Newbie

      Hi,

       

      Our application is using the following environment: jwsdp-1.6, jdk 1.5, and jboss4.0.5. We want to upgrade to use the jaxb 2.1. I have used the JAXB RI 1.0 compatible mode and generated the java classes from the schema. I saw that the generated.impl package was created, and the jaxb.properties was created as well in the generated directory. However, when deploying the application in the JBoss environment, it fails to create the JAXBContext. The line that gets the Runtime error is:
      JAXBContext.newInstance("com.ilrd.gem.plaf.dm.valueobjects.generated"); where "com.ilrd.gem.plaf.dm.valueobjects.generated" contains all the generated classes and the ObjectFactory class. I've confirmed that all the classes were packaged in the .ear file. I've tried different ways to create the JAXBContext but no success.  I have created Junit tests with it and a java app, both worked fine. I wonder if anything JBoss configuration settings that I need. And if anyone can suggest potiential solutions, I'd appreciate!

       

      Here is the Exception:

      at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
          at org.jboss.system.ServiceController.install(ServiceController.java:226)
          at sun.reflect.GeneratedMethodAccessor49.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
          at $Proxy4.install(Unknown Source)
          at org.jboss.deployment.SARDeployer.create(SARDeployer.java:249)
          at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
          at org.jboss.deployment.MainDeployer.create(MainDeployer.java:959)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
          at sun.reflect.GeneratedMethodAccessor50.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
          at $Proxy8.deploy(Unknown Source)
          at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
          at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
          at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
          at $Proxy0.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:417)
          at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
          at $Proxy4.start(Unknown Source)
          at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
          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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
          at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
          at $Proxy5.deploy(Unknown Source)
          at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
          at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
          at org.jboss.Main.boot(Main.java:200)
          at org.jboss.Main$1.run(Main.java:490)
          at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.reflect.UndeclaredThrowableException
          at org.jboss.system.ServiceCreator.install(ServiceCreator.java:236)
          at org.jboss.system.ServiceConfigurator.internalInstall(ServiceConfigurator.java:449)
          at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:171)
          ... 80 more
      Caused by: java.lang.InternalError
          at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassValue(RuntimeInlineAnnotationReader.java:139)
          at com.sun.xml.bind.v2.model.annotation.RuntimeInlineAnnotationReader.getClassValue(RuntimeInlineAnnotationReader.java:53)
          at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.isApplicable(PropertyInfoImpl.java:212)
          at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.getApplicableAdapter(PropertyInfoImpl.java:223)
          at com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.<init>(PropertyInfoImpl.java:122)
          at com.sun.xml.bind.v2.model.impl.SingleTypePropertyInfoImpl.<init>(SingleTypePropertyInfoImpl.java:71)
          at com.sun.xml.bind.v2.model.impl.AttributePropertyInfoImpl.<init>(AttributePropertyInfoImpl.java:59)
          at com.sun.xml.bind.v2.model.impl.RuntimeAttributePropertyInfoImpl.<init>(RuntimeAttributePropertyInfoImpl.java:54)
          at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.createAttributeProperty(RuntimeClassInfoImpl.java:155)
          at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.addProperty(ClassInfoImpl.java:869)
          at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.findFieldProperties(ClassInfoImpl.java:405)
          at com.sun.xml.bind.v2.model.impl.ClassInfoImpl.getProperties(ClassInfoImpl.java:308)
          at com.sun.xml.bind.v2.model.impl.RuntimeClassInfoImpl.getProperties(RuntimeClassInfoImpl.java:176)
          at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:243)
          at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:100)
          at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
          at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:209)
          at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:95)
          at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:81)
          at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:315)
          at com.sun.xml.bind.v2.model.impl.RegistryInfoImpl.<init>(RegistryInfoImpl.java:99)
          at com.sun.xml.bind.v2.model.impl.ModelBuilder.addRegistry(ModelBuilder.java:357)
          at com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:327)
          at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:466)
          at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
          at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1140)
          at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154)
          at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121)
          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:201)
          at javax.xml.bind.ContextFinder.find(ContextFinder.java:362)
          at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618)
          at com.ilrd.gem.plaf.dm.valueobjects.generated.impl.JAXBContextFactory.createContext(JAXBContextFactory.java:165)
          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:127)
          at javax.xml.bind.ContextFinder.find(ContextFinder.java:248)
          at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:412)
          at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:375)
          at com.ilrd.gem.plaf.dm.operations.devices.RemovableMediaProxy.<init>(RemovableMediaProxy.java:55)
          at com.ilrd.gem.plaf.dm.service.DeviceService.<init>(DeviceService.java:59)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
          at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:1233)
          at org.jboss.mx.server.MBeanServerImpl.instantiate(MBeanServerImpl.java:286)
          at org.jboss.mx.server.MBeanServerImpl.createMBean(MBeanServerImpl.java:344)
          at org.jboss.system.ServiceCreator.install(ServiceCreator.java:157)
          ... 82 more