Note that there are some explanatory texts on larger screens.

plurals
  1. POJersey restful service communication (IncompatibleClassChangeError)
    primarykey
    data
    text
    <p>I`ve created a restful service facade based on jersey 1.12 on the JDK 1.6 http server. When I start my application in eclipse everything works fine. I can communicate with the facade without any troubles but when I start my application via the console with my startup script I got an IncompatibleClassChangeError when I access the service. </p> <p>I was able to narrow down the problem. The problem is by sending the response. Because I can communicate with the service normally (the request is processed) but I don´t get a response. Do you have any clue about this? </p> <p>startup script</p> <pre><code>#!/usr/bin/env bash libpath= for i in $(ls lib/*|grep ".jar"); do libpath=$( echo "$i:$libpath"); done java -cp "$(echo $libpath)build/jar/myjar.jar" org.....Startup </code></pre> <p>Exception that will be thrown</p> <pre><code>WARNUNG: Class org....facade.ServiceFacadeImpl is ignored as an instance is registered in the set of singletons Call getMutationList: NP_005378 Exception in thread "pool-1-thread-1" java.lang.IncompatibleClassChangeError: Class javax.ws.rs.core.Response$Status does not implement the requested interface javax.ws.rs.core.Response$StatusType </code></pre> <p>Part of my facade</p> <pre><code>@GET @Path("/mutations/{id}/{from}/{size}") @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON }) public MutationPosContainer getMutationList(@PathParam("id") String id, @PathParam("from") Integer from, @PathParam("size") Integer size) { ... if (posContainer == null) throw new BadRequestException(); else return posContainer; } </code></pre> <p>Application Handler </p> <pre><code>public class SnapDbApplication extends Application { private ServiceFacade facade; public SnapDbApplication(ServiceFacade facade) { this.facade = facade; } @Override public Set&lt;Class&lt;?&gt;&gt; getClasses() { Set&lt;Class&lt;?&gt;&gt; s = new HashSet&lt;Class&lt;?&gt;&gt;(); s.add(this.facade.getClass()); return s; } @Override public Set&lt;Object&gt; getSingletons() { Set&lt;Object&gt; s = new HashSet&lt;Object&gt;(); s.add(this.facade); return s; } } </code></pre> <p>Edit: classpath</p> <pre><code>java -cp lib/xstream-1.4.2.jar:lib/xmlbeans-2.3.0.jar:lib/xml-resolver-1.2.jar:lib/xalan-2.7.0.jar: lib/wstx-asl-3.2.9.jar:lib/wsdl4j-1.6.2.jar:lib/woden-impl-dom-1.0M9.jar:lib/woden-impl-commons-1.0M9.jar: lib/woden-api-1.0M9.jar:lib/tribes-6.0.16.jar:lib/snpxsd.jar: lib/regexp-1.2.jar:lib/org.springframework.web.struts-sources-3.1.1.RELEASE.jar: lib/org.springframework.web.struts-3.1.1.RELEASE.jar: lib/org.springframework.web.servlet-sources-3.1.1.RELEASE.jar: lib/org.springframework.web.servlet-3.1.1.RELEASE.jar: ... :lib/jersey-server-1.12.jar:lib/jersey-multipart-1.12.jar:lib/jersey-json-1.12.jar: lib/jersey-core-1.12.jar:lib/jersey-client-1.12.jar:lib/jaxws-tools-2.1.3.jar:lib/jaxen-1.1.1.jar:lib/jaxb-xjc-2.1.7.jar: lib/jaxb-impl-2.1.7.jar:lib/jaxb-api-2.1.jar: lib/jalopy-1.5rc3.jar:lib/httpcore-4.0.jar: lib/http-20070405.jar:lib/hamcrest-library-1:build/jar/myapp.jar org.startup.Startup </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload