I can able to send single Customer object as a request but when i tried to
send List of Customers(List<Customer>) as request i am getting following
error : javax.servlet.ServletException: non-HTTP request or response
I am using MyEclipse REST webservices explorer
Check my code below
Service Method
@POST
@Path("add")
@Produces("application/xml")
@Consumes("application/xml")
public List<Customer> addCustomers(List<Customer> customers) {
papulateCustomer(customers);
return customers;
}
Request
<customers>
<customer>
<address>Address--Kadapa</address>
<id>20</id>
<name>Subbu</name>
</customer>
<customer>
<address>Address--Giddalur</address>
<id>10</id>
<name>Viswanath</name>
</customer>
</customers>
Stack Trace
Jan 31, 2011 12:25:39 PM org.apache.catalina.core.StandardWrapperValve
invoke
SEVERE: Servlet.service() for servlet JAX-RS REST Servlet threw exception
javax.servlet.ServletException: non-HTTP request or response
at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:595)
Please help me as soon as possible.
Thanks
Viswanath
--
View this message in context: http://jersey.576304.n2.nabble.com/how-to-send-list-of-customers-as-a-request-parameter-to-my-addCustomers-method-tp5976295p5976295.html
Sent from the Jersey mailing list archive at Nabble.com.