I decided to try it out, outside of the IDE, and after a while I get the
following exceptions thrown in the webbrowser. Following is the stack trace
that was reported in the logs:
jul 12, 2012 4:29:40 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [test.servlets.testServlet] in
context with path [/nameproject] threw exception
javax.ws.rs.WebApplicationException: javax.xml.bind.UnmarshalException
- with linked exception:
[java.net.SocketException: Connection reset]
at
com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.readFrom(AbstractRootElementProvider.java:113)
at
com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:554)
at
com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:506)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:684)
at com.sun.jersey.api.client.WebResource.post(WebResource.java:251)
at test.servlets.testServlet.doPost(testServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.xml.bind.UnmarshalException
- with linked exception:
[java.net.SocketException: Connection reset]
at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(Unknown
Source)
at
com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(Unknown
Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Unknown Source)
at
com.sun.jersey.core.impl.provider.entity.XMLRootElementProvider.readFrom(XMLRootElementProvider.java:115)
at
com.sun.jersey.core.provider.jaxb.AbstractRootElementProvider.readFrom(AbstractRootElementProvider.java:111)
... 23 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at sun.net.www.http.ChunkedInputStream.fastRead(Unknown Source)
at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
at java.io.FilterInputStream.read(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager$RewindableInputStream.read(Unknown
Source)
at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(Unknown
Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown
Source)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown
Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown
Source)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
Source)
... 29 more
2012/7/12 Peter Joole <peter.joole_at_gmail.com>
> The problem that I'm facing is that from a certain amount of characters,
> the server is stalled, I don't get a response, and it says like "Waiting
> for localhost ...". This happens as soon as the string count is higher than
> 15200 characters.
>
> So to make sure the problem isn't with anything else I just made a test
> web service that gets a JAXB class as xml and it just puts it in a new
> object and sends it back to the client. Everythings goings as expected, but
> as soon as the is above 15200 characters, I'm not getting any response. I'm
> also not getting any exception. As a test text I'm passing on the whole
> prototype javascript library, but even with a normal text it is showing the
> same problem, so the problem shouldn't be the javascript code that is
> getting passed.
>
> So the whole javascript code (more than 144.000 characters are passed
> succesfully with a post to the service. But the response doesn't come back.
>
> The setup is pretty simple:
>
> My JAXB class:
>
> @XmlRootElement(name = "test")
> @XmlAccessorType(XmlAccessType.FIELD)
> public class testREST
> {
> @XmlElement
> private String code;
> //Needed for JAXB
> public testREST ()
> {
> }
>
> public String getCode()
> {
> return code;
> }
>
> public void setCode(String code)
> {
> this.code = code;
> }
> }
>
> And the service:
>
> @POST
> @Consumes(MediaType.APPLICATION_XML)
> @Produces(MediaType.APPLICATION_XML)
> public testREST getJavascript( testREST resource)
> {
> testREST resp = new testREST ();
> resp.setCode(resource.getCode());
> return resource;
> }
>
> And the client:
>
> Client client = Client.create();
> client.setFollowRedirects(true);
> WebResource resource = client.resource("urltotheresource");
> testREST test = new testREST ();
> test.setCode(request.getParameter("input")); //The input is the text that
> comes from a textarea from a simple form.
> testREST responseWebService = resource.post( testREST.class, test);
>
> So is this a limitation, a bug, do I need to configure my client or am I
> just doing something wrong?
>
>