jersey

Dropwizard Application crashed by AbstractJAXBProvider

戏子无情 提交于 2019-12-14 03:55:17
问题 I have a server application implemented using Dropwizard and Gradle as Build System. Now I want to integrate Apache Mahout for some recommender system action. After adding the Mahout dependency and try to run, I get exceptions. My initial dependencies look like dependencies { compile 'io.dropwizard:dropwizard-core:0.9.1' compile 'io.dropwizard:dropwizard-jdbi:0.9.1' compile 'mysql:mysql-connector-java:5.1.37' compile 'redis.clients:jedis:2.8.0' compile 'com.google.guava:guava:18.0' compile

Enabling JSON using jersey and grizzly

允我心安 提交于 2019-12-14 03:46:49
问题 I am playing with Jersey hosted with Grizzly and want to be able to consume and produce JSON, however I am getting 500 from the server in get request and media type unsupported in POST my server code is org.glassfish.jersey.server.ResourceConfig rc = new ResourceConfig(); rc.packages("RestServer.controllers"); final Map<String, Object> initParams = new HashMap<String, Object>(); initParams.put("com.sun.jersey.config.property.packages", "rest"); initParams.put("com.sun.jersey.api.json

Whenever I try to run Tomcat with Jersey, it refuses to load

↘锁芯ラ 提交于 2019-12-14 03:25:47
问题 Basically I am trying to create a simple Hello World program using Rational Software Architect. To create the server I use Tomcat and Jersey. I found that when I create the server without putting the jersey jar files into WEB-INF/lib but rather I create a custom user library with all the jar files, Tomcat will compile fine but the url will not load the "Hello World" text, just a 404 error. I simple do http://localhost:8080/ project name /rest/ class path name and nothing will come up. I think

How to pass a custom object in REST webservice

帅比萌擦擦* 提交于 2019-12-14 02:19:23
问题 i'm having problems transfering a custom object to the client. How can i transfer a custom object to the client and receive it back to the webservice? i'm transferring a file by chunks. i want to know how i should write my client. i tried passing it as MediaType.APPLICATION_JSON in client but i get no result meaning it doesn't get passed back to the webservice. Below is a bit of code im working on. Webservice @POST @Path("/fileTransfer") @Consumes({MediaType.APPLICATION_JSON}) @Produces(

Why am i getting 405 Method Not Allowed while doing a POST Request

亡梦爱人 提交于 2019-12-14 01:17:44
问题 I am new to the rest services. I am trying to create a service that accepts json string from a client. I am getting 405 error when I am calling this service using JQuery. Below is the Java code for ws: This is the way i am posting a request to JERSEY POST RESTFUL Webservice . var orderinfo = {'ordersplitjson': ordersplitjson, 'customer_id': cust_id , 'homedelivery': homedelivery, 'seatnum' :seatnum , 'locationname':location_nam , 'rownum':rownum}; var json_data = JSON.stringify(orderinfo);

Why do I get null values in JSP?

若如初见. 提交于 2019-12-13 21:39:17
问题 I want to use a web form to submit some information and then a JSP page will display the entered form information. However when I clicked the submit button in the form, it goes the correct JSP file but all form values are displayed as "null". I'm using Jersey to do the POST request. The form is: <form action="/MyRestWS/rest/customer/created" method="POST"> <table border="1"> <tr> <td>Customer name:</td> <td><input type="text" name="name"></td> </tr> <tr> <td>Customer ID:</td> <td><input type=

Restful Web Service returning 404, bad web.xml?

独自空忆成欢 提交于 2019-12-13 20:04:11
问题 There are other people asking this question, but the answers they got aren't working for me. I'm running a Jersey rest server as discussed in this link in Tomcat 7. My Resource class is Hello as shown below: package com.rest.videos; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @Path("/hello") public class Hello { // This method is called if TEXT_PLAIN is request @GET @Produces(MediaType.TEXT_PLAIN) public String

Jersey/Grizzly POST fails for large URI

本小妞迷上赌 提交于 2019-12-13 18:50:24
问题 Relevant: this and that I'm developing a POST webservice (jersey/grizzly, for research purposes only) which should be able to handle large URIs. But if a URI exceeds above 8000 characters I get a 400 Bad Request Exception with no further explanation. I debugged/tracked it down to the grizzly maxHttpHeaderSize attribute. I tried to set this attribute but failed. Here is how I start the server and the request: GrizzlyServerFactory.createHttpServer(BASE_URI, new PackagesResourceConfig("org.test"

Shiro Annotations on a jersey resource

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 17:37:09
问题 when I am using shiro to do @RequiresAuthorization on a jersey resource i'm getting the following exception: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'securedFileResourceImpl' must be of type [org.apache.shiro.samples.sprhib.web.resources.SecuredFileResourceImpl], but was actually of type [$Proxy81] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:349) at org.springframework.beans.factory.support