Hide Forgot
project_key: EDG simple sequence put key "test" value "test" (serialized to byte array, with MIME type application/x-java-serialized-object) get key "test" Content-type: text/plain causes: {code} 16:37:05,877 SEVERE [org.jboss.resteasy.core.SynchronousDispatcher] (http-test1-192.168.11.101-8080-1) Failed executing GET /rest/___defaultcache/test: org.jboss.resteasy.spi.WriterException: java.lang.NullPointerException at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:262) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:579) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:500) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.2.1.GA.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) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57) [jboss-as-web-7.1.0.Alpha1-SNAPSHOT.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [jbossweb-7.0.0.CR4.jar:7.1.0.Alpha1-SNAPSHOT] at java.lang.Thread.run(Thread.java:662) [:1.6.0_25] Caused by: java.lang.NullPointerException at com.thoughtworks.xstream.mapper.ClassAliasingMapper.addClassAlias(ClassAliasingMapper.java:44) [xstream-1.3.1.jar:] at com.thoughtworks.xstream.XStream.alias(XStream.java:939) [xstream-1.3.1.jar:] at com.thoughtworks.xstream.XStream.setupAliases(XStream.java:588) [xstream-1.3.1.jar:] at com.thoughtworks.xstream.XStream.<init>(XStream.java:443) [xstream-1.3.1.jar:] at com.thoughtworks.xstream.XStream.<init>(XStream.java:385) [xstream-1.3.1.jar:] at com.thoughtworks.xstream.XStream.<init>(XStream.java:323) [xstream-1.3.1.jar:] at org.infinispan.rest.Server.xstream(Server.scala:51) [classes:] at org.infinispan.rest.Server$$anonfun$getEntry$1$$anonfun$apply$2.apply(Server.scala:71) [classes:] at org.infinispan.rest.Server$$anonfun$getEntry$1$$anonfun$apply$2.apply(Server.scala:71) [classes:] at org.infinispan.rest.Server$$anon$1.write(Server.scala:90) [classes:] at org.jboss.resteasy.plugins.providers.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:32) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.plugins.providers.StreamingOutputProvider.writeTo(StreamingOutputProvider.java:17) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:117) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.plugins.interceptors.encoding.GZIPEncodingInterceptor.write(GZIPEncodingInterceptor.java:63) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.core.interception.MessageBodyWriterContextImpl.proceed(MessageBodyWriterContextImpl.java:123) [resteasy-jaxrs-2.2.1.GA.jar:] at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:250) [resteasy-jaxrs-2.2.1.GA.jar:] ... 20 more {code}
rest-test.zip - project with the test case
Attachment: Added: rest-test.zip
Trustin emailed me about this and I must say it looks odd. Michal, does it happen with any REST server call? I was wondering whether this is an issue with AS7's modular classloading.
It's an AS7 classloading issue: The problem is in modules/com/thoughtworks/xstream/main/ it doesn't declare it's dependency on module javax.api. It tries to load the class "javax.security.auth.Subject" and fails (and doesn't count with the failure, therefore the NPE) This should be probably However I still wonder why it tries to use xstream - it's for application/xml and there's no such thing mentioned in the testcase.
fix: declare the dependency in modules/com/thoughtworks/xstream/main/module.xml {code} <module xmlns="urn:jboss:module:1.0" name="com.thoughtworks.xstream"> <resources> <resource-root path="xstream-1.3.1.jar"/> <!-- Insert resources here --> </resources> <dependencies> <module name="javax.api"/> </dependencies> </module> {code}
Committed the suggested fix. Thanks Michal!
Docs QE Status: Removed: NEW