1 Reply Latest reply on Feb 26, 2013 11:24 AM by michat

    Problem adding module

    michat

      Hi,

       

      although my application is for switchyard when it comes to modules I suppose this is the right place to ask.

      I need to access an external library from my app and therefore am trying to add a module for this jar.

      To be precise, I want to convert a XML string into JSON and therefore I need this lib "json-20090211.jar".

       

      This is the stack I'm getting

       

      14:55:52,322 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/switchyard].[RestEasy]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet RestEasy threw exception: org.jboss.resteasy.spi.UnhandledException: java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.String
          at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:340) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:214) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:190) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:540) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:502) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.2.Final.jar:]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)
          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_37]
      Caused by: java.lang.ClassCastException: java.lang.NoClassDefFoundError cannot be cast to java.lang.String
          at de.allianz.sva.jbossesb.eval.switchyard.rest.binding.CustomerServiceResourceRestImpl.getCustomersXml(CustomerServiceResourceRestImpl.java)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_37]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_37]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_37]
          at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_37]
          at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:155) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:257) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:222) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:211) [resteasy-jaxrs-2.3.2.Final.jar:]
          at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:525) [resteasy-jaxrs-2.3.2.Final.jar:]
          ... 18 more
      

       

      I did follow the instructions on how to add a module but my problem is, I don't know if there are any and if so how to figure out what the dependencies for this module are. Is there a way without having to look at all the source files of the library?

       

      Thanks

      Michael