jersey

MessageBodyWriter not found for media type=application/octet-stream, type=class org.apache.poi.xssf.usermodel.XSSFWorkbook

帅比萌擦擦* 提交于 2019-12-20 01:11:10
问题 I have the below class that tries to return some data in the form of an excel spreadsheet. I'm getting the error MessageBodyWriter not found for media type=application/octet-stream, type=class org.apache.poi.xssf.usermodel.XSSFWorkbook I've also tried @Produces("application/vnd.ms-excel") , but have gotten similar errors. Anyone have a suggestion as to how I can get this to return a spreadsheet? The last time I got an error message similar to this (complaining that a message body writer

class cast exception in weblogic

随声附和 提交于 2019-12-19 21:21:33
问题 I have a web application (WAR file) which uses jersey jars.Now when i am trying to deploy this i am getting class cast exception(Some bootstrap servlet uses jersey)..On analysis i found that weblogic itself have jersey jars in common\modules..and my web app have different version of jersey jars. Now if i delete the common/modules jersey jar then my web app got deployed.I want to know how can i make my web app to use its own version of jersey jars so that it gets deployed without deleting

class cast exception in weblogic

北慕城南 提交于 2019-12-19 21:20:40
问题 I have a web application (WAR file) which uses jersey jars.Now when i am trying to deploy this i am getting class cast exception(Some bootstrap servlet uses jersey)..On analysis i found that weblogic itself have jersey jars in common\modules..and my web app have different version of jersey jars. Now if i delete the common/modules jersey jar then my web app got deployed.I want to know how can i make my web app to use its own version of jersey jars so that it gets deployed without deleting

Jersey: what does “couldn't find grammar element” mean?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-19 17:46:20
问题 After upgrading Jersey from version 1.15 to 1.17 it started to log the following messages: Apr 2, 2013 5:13:06 PM com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator attachTypes INFO: Couldn't find grammar element for class java.lang.String An example of a service that produces such a message: @GET @Path("/bla/{a}") @Produces("application/json") public String doStuff(@PathParam("a") String a) { return a; } My first impression would be to consider this an error message,

apache http client org.apache.http.NoHttpResponseException: The target server failed to respond

廉价感情. 提交于 2019-12-19 16:58:53
问题 I am using apache http client to test my WS. I have write a get WS in jersey. URL for this WS is http://localhost:8080/mobilestore/rest/sysgestockmobilews/getinventory?xml=dataString to call this WS using url i have write a method which is as follow public static void getInventory(String input) throws ClientProtocolException, IOException { System.out.println(input); String url = URL + "getinventory"; HttpClient client = new DefaultHttpClient(); List<NameValuePair> nameValuePairs = new

Jersey No WebApplication provider is present when jersey-* dependency added

萝らか妹 提交于 2019-12-19 13:38:11
问题 I have a simple Spring & Jersey application, which works perfectly well for consuming requests through a simple Resource. However, I'd like to return a JSON response - containing a simple JSON serialization of an object. To achieve this, I've added a maven dependency for jersey-json . As soon as I add this dependency, however, I get this error at server startup: com.sun.jersey.api.container.ContainerException: No WebApplication provider is present at com.sun.jersey.spi.container

How to ignore multiple clicks from an impatient user?

拜拜、爱过 提交于 2019-12-19 12:08:09
问题 I have a query to answer remote clients' standard request. Standard in the sense that it takes no params from outside the server. Whenever anyone submits a request to a URL, say http://www.example.com/query, s/he gets the contents of an reply.xml in the body of the response, depending on what the database delivers at that time. The contents of reply.xml changes only across the contents of the database on the server, and doesn't change on anything external like who does the query, on which

Way to Consume Json request as Json object in Jersey Rest Service

戏子无情 提交于 2019-12-19 11:47:39
问题 Hi I tried googling around but cannot find solution that I want to achieve. Example to map json to java object we do @POST @Consumes(application/json) @Produces(application/json) public Response createUpdateDeleteManualClinicalData(MyJavaPojo definedPojo) { // this maps any json to a java object, but in my case I am dealing with generic json structure } What I want to achieve is Keep it as json object itself public Response createUpdateDeleteManualClinicalData(JSONObject json) Work around: I

MessageBody Writer / Reader

二次信任 提交于 2019-12-19 11:41:54
问题 I'm trying to make Jersey supports GSON and for this I have read that I need to implement a Custom MessageBodyWriter and MessageBodyReader . Now my problem is that I couldn't find any clear definition of these 2 interfaces. From the doc : public interface MessageBodyWriter<T> Contract for a provider that supports the conversion of a Java type to a stream. To add a MessageBodyWriter implementation, annotate the implementation class with @Provider. A MessageBodyWriter implementation may be

How to mix server-side Jax-rs call with native files without prefix?

依然范特西╮ 提交于 2019-12-19 10:32:47
问题 We are currently using a Jersey JAX-RS implementation to handle our REST requests (server-side Jersey). Our web.xml file is configured so all /rest/* requests are handled by Jersey. That's fine. Our server is currently Tomcat6, and using Java6 ( on Ubuntu 11.04 ) So, ://myserver/rest/customer/ is ok and Jersey calls the class with @Path("/customer") prefix. Now we also have static content, for example ://myserver/images/... wich loads fine. Is there a way to do so that we can get rid of the