jersey « jersey « Java Enterprise Q&A





1. jersey deployment    stackoverflow.com

I have developed a jersy Resource class. Can someone please tell me how can i deploy it on a web/app server. Preferebly tomcat or jboss. Or a better question still, can jersey ...

2. IDE's for Standard ML of New Jersey    stackoverflow.com

I'm having to write a whole bunch of SML code this coming week so I was hoping if anyone knew:

  1. A good Standard ML IDE?
  2. Or a good text editor for Linux that ...

3. jersey Viewable and c:import tag lib    stackoverflow.com

Giver a resource class that has a method witch returns a Viewable (or generaly any jsp page). Is there a way to use the c:import or jsp:include taglib to include a ...

4. Transaction-per-request and Jersey    stackoverflow.com

I'd like to implement transaction-per-request in conjunction with Jersey resources. By that, I just mean I want a single place to manage transactions, something like:

try {
  chain.doFilter(request, response);
  ...

5. Using @Context, @Provider and ContextResolver in JAX-RS    stackoverflow.com

I'm just getting acquainted with implementing REST web services in Java using JAX-RS and I ran into the following problem. One of my resource classes requires access to a storage backend, ...

6. How Jersey extracts generic type from Collections to invoke javax.ws.rs.ext.MessageBodyWriter#writeTo()?    stackoverflow.com

In a Rest Service using the JAX-RS specification, I can define a generic service like

@GET
@Path("something")
@Produces( { MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public List<MyPojo> getMyPojoList() {
    ...
}
Something magic happens in Jersey because ...

7. Jersey Viewable with status code    stackoverflow.com

The JAX-RS implementation Jersey supports MVC style web applications through the Viewable class, which is a container for a template name and a model object. It is used like ...

8. Using JAX-RS / Jersey with Freemarker templates    stackoverflow.com

There are examples on the web showing how to use the JAX-RS implementation Jersey with custom template engines like FreeMarker. But these examples are looking a bit ...

9. Input and Output binary streams using JERSEY?    stackoverflow.com

I'm using Jersey to implement a RESTful API that is primarily retrieve and serve JSON encoded data. But I have some situations where I need to accomplish the following:

  • Export downloadable documents, ...





10. Outputting Jersey logging to a file?    stackoverflow.com

We've added these to our web.xml: com.sun.jersey.spi.container.ContainerRequestFilters com.sun.jersey.api.container.filter.LoggingFilter com.sun.jersey.spi.container.ContainerResponseFilters com.sun.jersey.api.container.filter.LoggingFilter Which is nice for debugging in my dev environment, but, I can't see any ...

11. I'm trying to mock Jersey WebResource with Mockito, and can't do it    stackoverflow.com

This is my code (Jersey 1.4 + Mockito 1.8.5):

import org.junit.Test;
import static org.junit.Assert.*;
import com.sun.jersey.api.client.WebResource;
import static org.mockito.Mockito.*;
public FooTest {
  @Test public shouldMakeAHttpCall() {
    WebResource wr ...

12. Return a file using Java Jersey    stackoverflow.com

I am using the Java Jersey to implement a REST service. One thing my service should provide is a file download option. These files are quite big and are constructed from data from ...

13. how to increase jersey WS timeout    stackoverflow.com

How do I increase the jersey WS timeout? It is waiting on a call which takes around 2 minutes. It is timing out at WS layer. Do I have to increase ...

14. How to make Jersey to use SLF4J instead of JUL?    stackoverflow.com

I've found a useful article that explains how to make Jersey to use SLF4J instead of JUL. Now my unit test looks like (and it works perfectly):

public class FooTest ...

15. Combing Metro and Jersey    stackoverflow.com

I've been at this for a little while and my mind has gone to mush. I'm wondering if anyone can help me out here. I'm trying to make a Java Web Service ...

16. how to clear screen in ML of New Jersey    stackoverflow.com

thanks in advance





17. What this strange Jersey warning means?    stackoverflow.com

What do this warning mean in Jersey 1.4:

WARNING: A sub-resource method, public final java.lang.String com.XXX.render(), 
with URI template, "/", is treated as a resource method
This is how the method looks like:
@GET
@Produces(MediaType.APPLICATION_XML)
@Path("/")
public ...

18. Jersey example in IntelliJ    stackoverflow.com

I'm new to IntelliJ. I have the traditional "HelloWorld" Jersey app running:

package restHello;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

@Path("/resource")
public class MyResource {

    @GET
    @Produces("text/plain")
    ...

19. NoClassDefFoundError on Web Application using two EAR's    stackoverflow.com

I've been stucked on an issue for a few days now, and I'm about to give up. Need your help! :) Here's the thing: I'm working on a web application, and I'm trying ...

20. Suggestions for OAuth2 libraries for integration with Jersey?    stackoverflow.com

I am working on making Jersey web services available using OAuth2 to other clients and am having a tough time finding libraries that tie in nicely with Jersey. So far ...

21. Help with Jersey auto-generation of WADL    stackoverflow.com

As described here: http://wikis.sun.com/display/Jersey/WADL I'm using Jersey 1.4 in Tomcat 6. I have tried every possible URI with a "/application.wadl" and all I get is a 404 (not available). ...

22. Responding at arbitrary timing with Jersey on Grizzly using Timer.schedule    stackoverflow.com

all. Thanks in advance. I am creating a RESTful service with Jersey on Grizzly. In the service, I would like to wait responding to a request for several seconds using "Timer.schedule", instead ...

23. Integrating ExtJS with JAX-RS    stackoverflow.com

I'm trying to integrate ExtJS with JAX-RS. I setup Jersey with POJOMappingFeature and it works fine. But I want to get rid of the glue code. Every class looks now like ...

24. Jersey provider, SpringServlet    stackoverflow.com

I'm trying to create custom provider converting XML to my type. What I did is: 1.Created provider implementing MessageBodyReader 2.Annotaded provider class with

@Provider     
@Consumes(MediaType.APPLICATION_XML)
3. created bean of ...

25. What is the fastest way to output a large amount of data?    stackoverflow.com

I have an JAX-RS web service that calls a db2 z/os database and returns about 240mb of data in a resultset. I am then creating an OutputStream to send this data ...

26. Following Jersey Tutorial    stackoverflow.com

I am trying to follow the first part of jersey tutorial using Grizzly as the web container. I am just at the "Hello World!" part and trying to run my code. ...

27. Long-Polling Jersey. Is there a way to monitoring connections    stackoverflow.com

I had to implement a long polling with jersey. I would like to monitor the connections. The clients are a smartphones and I must know what`s going on with the connectivity. ...

28. Jersey Constructor    stackoverflow.com

How it's possible to load something at the start of the system? I`m not have a "main" where my program starts !?

29. JAX-RS Custom ExceptionMapper not intercept RuntimeException    stackoverflow.com

I want to wrap underlaying RuntimeExceptions to a custom json format , making the servlet container won't dump the stacktrace to client. I follow this question : JAX-RS (Jersey) custom exception ...

30. Running Jersey with Grizzly as a executeable jar file not working    stackoverflow.com

I developing a Jersey based application and using Grizzly to test the application. As long as I run it from Eclipse everything works well! However, when I do an export to ...

31. What is a Jersey Filter?    stackoverflow.com

I wanted to know basically what is a Jersey filter and how is it related to a servlet filter? are they the same? what are the main patterns of using a ...

32. Staying DRY with JAX-RS    stackoverflow.com

I'm trying to minimize repeated code for a number of JAX-RS resource handlers, all of which require a few of the same path and query parameters. The basic url template for ...

33. Newbie: In Jersey framework, how to get HTML form object data in my case?    stackoverflow.com

When client side submit a HTML form, it will send a form object to server, like:

params={username: USER_INPUT_USERNAME,
       passworkd: USER_INPUT_PASSWORD}
Then, client ajax send the params object ...

34. Grizzly + Jersey Listening ONLY on Localhost    stackoverflow.com

I'm using Jersey with an embedded version of Grizzly and I'd like to bind/listen on localhost ONLY. I'm creating the ThreadSelector using the GrizzlyWebContainerFactory with the create call:

threadSelector = GrizzlyWebContainerFactory.create("http://127.0.0.1:8080/", initParams);
This ...

35. Jersey does not see my MessageBodyReader    stackoverflow.com

I'm trying to use jersey with my own json MessageBodyReader/MessageBodyWriter (as I am not use @XmlRootElement... annotations on my domain classes).

@Provider
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public final class MyGsonMessageBodyHandler implements MessageBodyWriter<Object>, MessageBodyReader<Object> {
...
}
Jersey uses this class ...

36. Working with "SML of new jersey"    stackoverflow.com

I download "SML of new jersey" for windows vista. I work on ML file which call "a.ml" in libary c. Now I want to load all the commands in the file to the ...

37. Leaving some {template} in builder URI with UriBuilder    stackoverflow.com

Jersey UriBuilder can replace all the templates in a URI:

UriBuilder.fromResource(this.getClass()).path("{id}/{op}").build(12, "buy")
Client side, it is exactly what we want ; Server side, in some cases, we want to keep some templates unchanged ...

38. PUT method in jersey    stackoverflow.com

I am new to Restful webservice. When I was going through the tutorials, I saw that PUT method can be used to create the resource. the creation means adding into the ...

39. Having Issues Uploading WAR File to WebSphere 6.1    stackoverflow.com

I'm trying to deploy a web service onto WebSphere using a WAR file, which I have been told directly is completely possible and has been done many times before. WebSphere ...

40. Jersey version downgrade stops connections from working    stackoverflow.com

We had to downgrade our Jersey version from 1.7 to 1.0.3.1 due to the client using Java 5 (and 1.7 did not seem compatible). When using 1.7, we were able ...

41. Jersey with Java 5    stackoverflow.com

What is the latest version of Jersey that will run with Java 5? I found the Jersey 1.3 documentation saying that Java 6 is required but I'm having ...

42. jersey: how to recognize when a connection is closed    stackoverflow.com

If I have a long waiting request (e.g. the thread handling it is blocked until another provides some data), then by the time the response is ready, the client could have ...

43. Show Jersey trace in Mule    stackoverflow.com

Jersey has a tracing feature that looks to be helpful. However the instructions on enabling it assume that I have a web.xml file to put the configuration in. ...

44. 404 instead of wadl from jersey 1.1.5.1    stackoverflow.com

Anyone know how to get a wadl with jersey 1.1.5.1? All I get is 404s. Docs say to put some stuff in your classpath and use host:port/application.wadl. I've tried this ...

45. JAX-RS/Jersey: How can I "inherit" @Provider fields?    stackoverflow.com

In JAX-RS one can define @Provider-annotated fields or inner-classes (such as for MessageBodyReader or ExceptionMapper). Sadly, I can't inherit this logic from a super class. (When I do, JAX-RS simply ignores them.) I ...

46. Deploying a Jersey webapp on Jboss 7    stackoverflow.com

Currently running some webapps on Jboss 4/5 and am testing migration to jboss7. When i try to deploy a jersey based webapp on jboss 7 (full profile with standalone-preview config file), ...

47. Defaulthttpclient scheme    stackoverflow.com

The request is using the wrong scheme (http instead of https). I can see this when i debug my client and inspect the scheme inside the HttpHost object. I'm using JerseyClient ...

48. Get all html form param name & value using jersey    stackoverflow.com

I have a html form which contains elements like this

<input type="text" value="Val1" name="Name1"/>
<input type="text" value="Val2" name="Name2"/>
<input type="hidden" value="Val3" name="Name3"/>
On server side, i use Jersey implementation to capture the form name ...

49. Jersey app-run initialization code on startup to initialize application    stackoverflow.com

I have an app built with Jersey.I need to do some initialization on startup of the webapp/war in the Tomcat 7 container by running an application specific login/code. What is the best ...

50. Jersey initialization code after webapp is fully started    stackoverflow.com

I asked this question earlier: Jersey app-run initialization code on startup to initialize application Is there any way to run this initialization code after the server has initialized the web app fully ...

51. How to use Jersey with Eclipse Helios?    stackoverflow.com

My base need is to use the Jersey framework to develop very basic REST webservices. I've read several tutorials regarding Jersey (JAX-RS framework) and writing webervices but so for I've not found ...

52. Jersey: how to use InjectableProvider with @Context annotation?    stackoverflow.com

I followed this post and created by first custom injectable provider, a LocaleProvider that scans the HTTP Request for the Accept-Language header. It works fine if I use it ...

53. Is SeekableStream thread safe?    stackoverflow.com

I have a program that is supposed to resize an image. When I run it alone (call from JUnit), it works fine. But when I call it from inside a servelet ...

54. Jersey: GrizzlyWebContainerFactory is missing in Jersey 1.9.1    stackoverflow.com

I'm getting started learning Jersey by following the tutorial From Main class of the tutorial

       System.out.println("Starting grizzly...");
       SelectorThread ...

55. How to implement a custom ViewProcessor (jax-rs)?    stackoverflow.com

Looking at the article here, there is an example of how to use a TemplateProcessor to resolve JSP views using Jersey. Apparently this class has been deprecated now ...

56. Filter for limiting the file size on upload in Jersey    stackoverflow.com

I have a HTML form that will upload a file (among other form fields) to my server. There, I am using Java and Jersey, and have created a filter which will ...

57. Hello World with Jersey and Grizzly (from User Guide)    stackoverflow.com

I'm looking at the Jersey User Guide and trying to set up a Hello World example using a Jersey web service and an embedded Grizzly server. I'm running through Section ...

58. Atmosphere/Jersey bidirectional conversation    stackoverflow.com

I've seen a number of Atmosphere examples including pub-sub. I want to do something like pub-sub (client subscribes to a channel that is unique to that client; server periodically publishes to ...