apache-wink

error invoking RESTful webservice on WebSphere 8.5.5.2 server

拜拜、爱过 提交于 2020-01-16 04:10:32
问题 I have deployed the RESTful application using Apache Wink packaged in EAR on WebSphere 8.5.5.2 ND. When the application starts it gives me the " Initialization successful " message: [5/14/15 15:56:03:588 CDT] 0000006d RestServlet I org.apache.wink.server.internal.servlet.RestServlet getApplication The system is using the my.domain.mobile.rest.RestfulResourceLoader JAX-RS application class that is named in the javax.ws.rs.Application init-param initialization parameter. [5/14/15 15:56:03:605

Override Jackson Object Mapper properties on Websphere 8.5.5 using Apache Wink

家住魔仙堡 提交于 2020-01-01 09:36:31
问题 We are using IBM(s) bundled Apache Wink to offer JAXRS endpoints for our application. We are coding towards Websphere 8.5.5. Since we are servlet 3.0 compliant we use the 'programmatic' way of configuring the JaxRS application, meaning no entries in web.xml and we rely on class scanning for annotated jax rs resources. In general it works fine. @ApplicationPath("/api/v1/") public class MyApplication extends Application{ This version of Websphere along with Apache Wink, uses Jackson 1.6.x for

Override Jackson Object Mapper properties on Websphere 8.5.5 using Apache Wink

北战南征 提交于 2020-01-01 09:34:14
问题 We are using IBM(s) bundled Apache Wink to offer JAXRS endpoints for our application. We are coding towards Websphere 8.5.5. Since we are servlet 3.0 compliant we use the 'programmatic' way of configuring the JaxRS application, meaning no entries in web.xml and we rely on class scanning for annotated jax rs resources. In general it works fine. @ApplicationPath("/api/v1/") public class MyApplication extends Application{ This version of Websphere along with Apache Wink, uses Jackson 1.6.x for

Why doesn't UriInfo.getQueryParameters() decode '+'?

怎甘沉沦 提交于 2019-12-24 04:06:13
问题 I know I can work around this, but it seems very strange that the behaviour is different if you use an annotated query parameter, compared with pulling the parameter out of the parameter map (which should be decoded according to the javadoc). Is this a bug, or just a quirk? @GET @Path("/") @Produces(MediaType.APPLICATION_JSON) public Response getAssets(@Context UriInfo info, @QueryParam("q") String searchQuery) { // The request URI is http://myhost.com/appRoot?q=foo+bar%20baz // At this point

restful call Wrong MediaType format for MediaType:“*; q=.2”

跟風遠走 提交于 2019-12-23 03:11:24
问题 Trying to execute restful web service using POST method. Here is the relevant part of my interface: @Path("/customers") public interface CustomerResource { @POST @Consumes(MediaType.APPLICATION_XML) public Response createCustomer(InputStream is); ..... } The implementation: // Create customer public Response createCustomer(InputStream is) { logger.debug("In createCustomer"); Customer customer = readCustomer(is); customer.setId(idCounter.incrementAndGet()); customerDB.put(customer.getId(),

Share variables between JAX-RS requests

情到浓时终转凉″ 提交于 2019-12-18 04:18:27
问题 I have what I think is a very basic question about JAX-RS but I somehow can't easily find the answer. I am trying to refactor a REST service which uses a "standard" Javax servlet -- routing requests to methods by hand -- into an "cleaner" JAX-RS implementation. The current application sets some variables during the servlet init(). It assigns those as attributes of the HttpServlet class so they are available during each doGet() and can be passed as parameters to request processing methods. For

what's wrong with my simple JSON JAX-RS web service?

这一生的挚爱 提交于 2019-12-12 03:11:46
问题 I have a simple web service written with Apache Wink 1.0, I want to receive and return JSON data. According the Wink docs, this should work ... @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public JSONObject postJSON(JSONObject requestJSON) { JSONObject jobj = new JSONObject(); return jobj; } ... but I see this error when I try to hit the web service ... org.apache.wink.server.internal.handlers.PopulateResponseMediaTypeHandler - Content-Type not specified

How do I inject a Spring bean into Apache Wink?

[亡魂溺海] 提交于 2019-12-11 09:08:36
问题 How do I inject Spring-managed beans into Apache Wink? I have a wink application started in web.xml that starts fine if I stub out a dummy data service @Autowired under an interface within it. I have implemented a JPA service to provide the data implementing the same interface, set up via Spring 2.5.6. This works fine in isolation too. I think I just need to inject my JPA service instead of my dummy service, but I can't figure out how to do that - tried @Service annotations and <context

Apache Wink Accept() fails with NullPointerException

耗尽温柔 提交于 2019-12-10 09:46:59
问题 I am deploying my RESTful web application on jBoss EAP 6.1 (7.2.1Final) with Wink 1.2 and getting following exception on all the request; <b>JBWEB000070: exception</b> <pre>java.lang.NullPointerException org.apache.wink.common.internal.http.Accept.valueOf(Accept.java:139) org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptHeader(HttpHeadersImpl.java:152) org.apache.wink.server.internal.contexts.HttpHeadersImpl.getAcceptableMediaTypes(HttpHeadersImpl.java:106) org.apache.wink

Unit testing Apache Wink REST service with MockServletInvocationTest

十年热恋 提交于 2019-12-08 13:09:03
问题 I use Apache Wink 1.2.1. I would like to unit test my REST service, and I'd rather doing it without using a RestClient. I haven't found any example, but after a lot of searching around I guessed that MockServletInvocationTest was the right starting point ... however I have not been able to make it work. Here is a minimal example that fails for me. My REST service: @Path("greetings") public class GreetingsResource { @GET @Produces(MediaType.TEXT_PLAIN) public String hello() { return "Hello