1 Reply Latest reply on Jul 30, 2012 10:51 AM by yigongjoyce

    Not able to start rest easy

    Anshu Gupta Newbie

      Hi ,

       

      I am trying to make a sample Rest Service.

      I have a Interface which call my EJB. I have all the path annotation in my interface. I have a implementation class for REST which will call my EJB.

      My Environment - JDK 1.7, Jboss 7, Win 7(64Bit)

      I have not put anything in my web.xml as suggested by Jboss Reference guide. I have extended Application class to put custom path. I tried without extending as well but got the error.

       

      The problem I am facing is, while trying to invoke the rest service I am getting following exception.

       

      16:41:41,735 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/CloudAppRestApi]] (http-localhost-127.0.0.1-8080-2) StandardWrapper.Throwable: java.lang.NoClassDefFoundError: com/sun/xml/bind/marshaller/NamespacePrefixMapper

          at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_05]

          at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) [rt.jar:1.7.0_05]

          at java.lang.Class.getConstructors(Unknown Source) [rt.jar:1.7.0_05]

          at org.jboss.resteasy.util.PickConstructor.pickSingletonConstructor(PickConstructor.java:27) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyProviderFactory.getProviderInstance(ResteasyProviderFactory.java:1032) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyProviderFactory.addContextResolver(ResteasyProviderFactory.java:620) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:834) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:743) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyDeployment.registerProvider(ResteasyDeployment.java:505) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:305) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:225) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:67) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:952) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

          at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_05]

      Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.marshaller.NamespacePrefixMapper from [Module "deployment.CloudApp.ear:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

          ... 27 more

       

      16:41:41,748 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/CloudAppRestApi].[com.onvelop.resteasy.config.OnvelopRestApplication]] (http-localhost-127.0.0.1-8080-2) Allocate exception for servlet com.onvelop.resteasy.config.OnvelopRestApplication: java.lang.ClassNotFoundException: com.sun.xml.bind.marshaller.NamespacePrefixMapper from [Module "deployment.CloudApp.ear:main" from Service Module Loader]

          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

          at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_05]

          at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) [rt.jar:1.7.0_05]

          at java.lang.Class.getConstructors(Unknown Source) [rt.jar:1.7.0_05]

          at org.jboss.resteasy.util.PickConstructor.pickSingletonConstructor(PickConstructor.java:27) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyProviderFactory.getProviderInstance(ResteasyProviderFactory.java:1032) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyProviderFactory.addContextResolver(ResteasyProviderFactory.java:620) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:834) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyProviderFactory.registerProvider(ResteasyProviderFactory.java:743) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyDeployment.registerProvider(ResteasyDeployment.java:505) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyDeployment.registration(ResteasyDeployment.java:305) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:225) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:67) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) [resteasy-jaxrs-2.3.2.Final.jar:]

          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:952) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

          at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_05]

       

      Please provide pointers.

       

      Thanks,

      Anshu