Mantis - Resin
Viewing Issue Advanced Details
1993 tweak always 09-05-07 13:49 09-06-07 17:01
stbu  
 
normal  
closed 3.1.2  
fixed  
none    
none 3.1.3  
0001993: JAX-WS: javax.servlet.ServletException: javax.xml.stream.XMLStreamException: Unexpected end of stream
I have done some tests with JAX-WS inspired by http://www.caucho.com/resin-3.1/examples/soa-jaxws/index.xtp [^] in Resin-Pro-3.1.2

I've packed a Web Service Provider in a WAR named wsprovider-javaee.war which consists of a simple Web Service Implementation example.AddNumbers.

For the Client, I've packed a WAR named wsconsumer-javaee.war which consists of the interface consumer.AddNumbersService and an index.jsp which
is invoking the Web Service as configured in the resin-web.xml

<..>
  <web-service-client jndi-name="soap/AddNumbersService">
    <url>soap:http://localhost:8080/wsprovider-javaee/addnum</url> [^]
    <interface>consumer.AddNumbersService</interface>
  </web-service-client>
<..>

Both were deployed in Resin-3.1.2 (Professional).

While making tests, I've recognized on the console this Exception:

com.caucho.server.webapp.ErrorPageManager javax.servlet.ServletException: javax.xml.stream.XMLStreamException: Unexpected end of stream
at com.caucho.soa.servlet.SoapProtocolServlet.service(SoapProtocolServlet.java:103)
at com.caucho.server.dispatch.WebServiceFilterChain.doFilter(WebServiceFilterChain.java:108)
at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.xml.stream.XMLStreamException: Unexpected end of stream
at com.caucho.xml.stream.StaxUtil.constantToString(StaxUtil.java:354)
at com.caucho.xml.stream.XMLStreamReaderImpl.require(XMLStreamReaderImpl.java:508)
at com.caucho.soap.skeleton.DirectSkeleton.invoke(DirectSkeleton.java:367)
at com.caucho.soa.encoding.SoapEncoding.invoke(SoapEncoding.java:100)
at com.caucho.soa.servlet.SoapProtocolServlet.service(SoapProtocolServlet.java:94)
... 8 more


I've enabled debug logging in resin.conf

<..>
  <log path='logs/debug.log' timestamp='[%H:%M:%S.%s] ' format=" ${app.contextPath} ${log.level} ${log.loggerName} ${log.message}">
    <logger name="com.caucho" level="finest"/>
  </log>
<..>

which has produced the following output:


[20:38:02.109] /wsconsumer-javaee FINEST com.caucho.server.webapp.WebApp real-path /index.jsp -> c:\downloads\resin-pro-3.1.2\webapps\wsconsumer-javaee\index.jsp
[20:38:02.109] /wsconsumer-javaee FINE com.caucho.server.dispatch.ServletMapper invoke (uri:/index.jsp -> resin-jsp)
[20:38:02.125] /wsconsumer-javaee INFO com.caucho.jsp.TldManager Loading .tld files from global classpath
[20:38:02.984] /wsconsumer-javaee FINE com.caucho.jsp.PageManager uri:/index.jsp(cp:/wsconsumer-javaee,app:/c:/downloads/resin-pro-3.1.2/webapps/wsconsumer-javaee) -> /c:/downloads/resin-pro-3.1.2/webapps/wsconsumer-javaee/index.jsp
[20:38:03.000] /wsconsumer-javaee FINEST com.caucho.jsp.JspManager java.lang.ClassNotFoundException: _jsp._index__jsp
[20:38:03.125] /wsconsumer-javaee CONFIG com.caucho.java.JavaCompiler Compiling _jsp/_index__jsp.java
[20:38:04.656] /wsconsumer-javaee FINE com.caucho.server.session.SessionImpl create session abceiRj1nYC6wf3FPvvtr
[20:38:04.656] /wsconsumer-javaee FINE com.caucho.server.session.SessionImpl create session abceiRj1nYC6wf3FPvvtr
[20:38:04.687] /wsconsumer-javaee FINEST com.caucho.jaxb.JAXBUtil Introspecting class consumer.AddNumbersService
[20:38:04.687] /wsconsumer-javaee FINEST com.caucho.jaxb.JAXBUtil Introspecting method add
[20:38:04.687] /wsconsumer-javaee FINEST com.caucho.jaxb.JAXBUtil Introspecting type int
[20:38:04.687] /wsconsumer-javaee FINEST com.caucho.jaxb.JAXBUtil Introspecting type int
[20:38:04.687] /wsconsumer-javaee FINEST com.caucho.jaxb.JAXBUtil Introspecting type int
[20:38:04.703] /wsconsumer-javaee FINER com.caucho.soap.wsdl.WSDLParser Getting WSDL: http://localhost:8080/wsprovider-javaee/addnum [^]
[20:38:04.703] FINE com.caucho.server.port.TcpConnection starting connection TcpConnection[id=resin-tcp-connection-*:8080-2,socket=JniSocketImpl$22007194[93256800],port=Port[null:8080]], total=6
[20:38:04.718] FINE com.caucho.server.http.HttpRequest [2] GET /wsprovider-javaee/addnum HTTP/1.1
[20:38:04.718] FINE com.caucho.server.http.HttpRequest [2] Remote-IP: 127.0.0.1:4162
[20:38:04.718] FINE com.caucho.server.http.HttpRequest [2] Host: localhost:8080
[20:38:04.718] FINE com.caucho.server.http.HttpRequest [2] User-Agent: Mozilla/4.0 (compatible; Resin 1.0; JDK)
[20:38:04.812] /wsprovider-javaee WARNING com.caucho.server.webapp.ErrorPageManager javax.servlet.ServletException: javax.xml.stream.XMLStreamException: Unexpected end of stream
[20:38:04.812] at com.caucho.soa.servlet.SoapProtocolServlet.service(SoapProtocolServlet.java:103)
[20:38:04.812] at com.caucho.server.dispatch.WebServiceFilterChain.doFilter(WebServiceFilterChain.java:108)
[20:38:04.812] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:175)
[20:38:04.812] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:240)
[20:38:04.812] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:263)
[20:38:04.812] at com.caucho.server.port.TcpConnection.run(TcpConnection.java:481)
[20:38:04.812] at com.caucho.util.ThreadPool$Item.runTasks(ThreadPool.java:685)
[20:38:04.812] at com.caucho.util.ThreadPool$Item.run(ThreadPool.java:607)
[20:38:04.812] at java.lang.Thread.run(Thread.java:595)
[20:38:04.812] Caused by: javax.xml.stream.XMLStreamException: Unexpected end of stream
[20:38:04.812] at com.caucho.xml.stream.StaxUtil.constantToString(StaxUtil.java:354)
[20:38:04.812] at com.caucho.xml.stream.XMLStreamReaderImpl.require(XMLStreamReaderImpl.java:508)
[20:38:04.812] at com.caucho.soap.skeleton.DirectSkeleton.invoke(DirectSkeleton.java:367)
[20:38:04.812] at com.caucho.soa.encoding.SoapEncoding.invoke(SoapEncoding.java:100)
[20:38:04.812] at com.caucho.soa.servlet.SoapProtocolServlet.service(SoapProtocolServlet.java:94)
[20:38:04.812] ... 8 more
[20:38:04.812]
[20:38:05.328] /wsprovider-javaee FINE com.caucho.server.connection.AbstractHttpResponse [2] HTTP/1.1 500 Internal Server Error
[20:38:05.328] /wsprovider-javaee FINE com.caucho.server.connection.AbstractHttpResponse [2] Transfer-Encoding: chunked
[20:38:05.328] /wsprovider-javaee FINE com.caucho.server.connection.ResponseStream [2] write-chunk(7)
[20:38:05.328] FINE com.caucho.server.http.HttpRequest [2] keepalive
[20:38:05.328] /wsconsumer-javaee FINE com.caucho.vfs.HttpStream server: Resin/3.1.2
[20:38:05.328] /wsconsumer-javaee FINE com.caucho.vfs.HttpStream content-type: text/html
[20:38:05.328] /wsconsumer-javaee FINE com.caucho.vfs.HttpStream transfer-encoding: chunked
[20:38:05.328] /wsconsumer-javaee FINE com.caucho.vfs.HttpStream date: Wed, 05 Sep 2007 18:38:04 GMT
[20:38:05.328] FINE com.caucho.server.port.TcpConnection [2] keepalive (thread)
[20:38:05.328] /wsconsumer-javaee FINE com.caucho.soap.skeleton.AbstractAction Unable to read WSDL from location http://localhost:8080/wsprovider-javaee/addnum: [^] javax.xml.ws.WebServiceException: Unable to parse WSDL: http://localhost:8080/wsprovider-javaee/addnum [^]
[20:38:05.328] FINE com.caucho.server.port.TcpConnection closing connection TcpConnection[id=resin-tcp-connection-*:8080-2,socket=JniSocketImpl$22007194[93256800],port=Port[null:8080]], total=7
[20:38:05.421] /wsconsumer-javaee FINER com.caucho.soap.skeleton.DirectSkeleton Adding DocumentWrappedAction[add] to DirectSkeleton[interface consumer.AddNumbersService]
[20:38:05.437] FINE com.caucho.server.port.TcpConnection starting connection TcpConnection[id=resin-tcp-connection-*:8080-3,socket=JniSocketImpl$14772101[93256288],port=Port[null:8080]], total=7
[20:38:05.437] FINE com.caucho.server.http.HttpRequest [3] POST /wsprovider-javaee/addnum HTTP/1.1
[20:38:05.437] FINE com.caucho.server.http.HttpRequest [3] Remote-IP: 127.0.0.1:4163
[20:38:05.515] FINE com.caucho.server.http.HttpRequest [3] User-Agent: Java/1.5.0_02
[20:38:05.515] FINE com.caucho.server.http.HttpRequest [3] Host: localhost:8080
[20:38:05.531] FINE com.caucho.server.http.HttpRequest [3] Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
[20:38:05.531] FINE com.caucho.server.http.HttpRequest [3] Connection: keep-alive
[20:38:05.531] FINE com.caucho.server.http.HttpRequest [3] Content-type: application/x-www-form-urlencoded
[20:38:05.531] FINE com.caucho.server.http.HttpRequest [3] Content-Length: 268
[20:38:05.531] /wsprovider-javaee FINE com.caucho.server.connection.AbstractHttpResponse [3] HTTP/1.1 200 OK
[20:38:05.531] /wsprovider-javaee FINE com.caucho.server.connection.AbstractHttpResponse [3] Transfer-Encoding: chunked
[20:38:05.531] /wsprovider-javaee FINE com.caucho.server.connection.ResponseStream [3] chunk: 285
[20:38:05.531] /wsprovider-javaee FINE com.caucho.server.connection.ResponseStream [3] write-chunk(7)
[20:38:05.531] FINE com.caucho.server.http.HttpRequest [3] keepalive
[20:38:05.531] /wsconsumer-javaee FINE com.caucho.server.connection.AbstractHttpResponse [1] HTTP/1.1 200 OK
[20:38:05.531] FINE com.caucho.server.port.TcpConnection [3] keepalive (thread)
[20:38:05.625] /wsconsumer-javaee FINE com.caucho.server.connection.AbstractHttpResponse [1] Transfer-Encoding: chunked
[20:38:05.625] FINE com.caucho.server.port.TcpConnection closing connection TcpConnection[id=resin-tcp-connection-*:8080-3,socket=JniSocketImpl$14772101[93256288],port=Port[null:8080]], total=7
[20:38:05.625] /wsconsumer-javaee FINE com.caucho.server.connection.ResponseStream [1] write-chunk(7)
[20:38:05.625] FINE com.caucho.server.http.HttpRequest [1] keepalive



With a temporary Filter in web-app "wsprovider-javaee", I have logged the Request and Response:

***********************************************
Request URL:http://localhost:8080/wsprovider-javaee/addnum [^]
Request query string:null
Request headers:
 User-Agent = Java/1.5.0_02
 Host = localhost:8080
 Accept = text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
 Connection = keep-alive
 Content-type = application/x-www-form-urlencoded
 Content-Length = 268
Request body:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header></soapenv:Header><soapenv:Body><m:add [^] xmlns:m="http://consumer/"><arg0>600</arg0><arg1>66</arg1></m:add></soapenv:Body></soapenv:Envelope> [^]
----------------------------------------------
Response body:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" [^] xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soapenv:Body><m:addResponse [^] xmlns:m="http://provider/"><return>666</return></m:addResponse></soapenv:Body></soapenv:Envelope> [^]


The Web Service works - the expected results are displayed in the test page index.jsp.

But why is the
 javax.servlet.ServletException: javax.xml.stream.XMLStreamException: Unexpected end of stream
logged?


The access.log contains three entries:

127.0.0.1 - - [05/Sep/2007:20:38:04 +0200] "GET /wsprovider-javaee/addnum HTTP/1.1" 500 1174 "-" "Mozilla/4.0 (compatible; Resin 1.0; JDK)"
127.0.0.1 - - [05/Sep/2007:20:38:05 +0200] "POST /wsprovider-javaee/addnum HTTP/1.1" 200 285 "-" "Java/1.5.0_02"
127.0.0.1 - - [05/Sep/2007:20:38:05 +0200] "GET /wsconsumer-javaee/ HTTP/1.1" 200 49 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"


It seems that the Exception comes from the first GET request issued by Resin (1.0 ???) to get the wsdl?

By the way:

com/caucho/vfs/HttpStream.java
 _ws.print("User-Agent: Mozilla/4.0 (compatible; Resin 1.0; JDK)\r\n");
      
Why is "Resin 1.0" hardcoded instead of using com.caucho.Version.VERSION ?
The attached ZIP contains the two WAR's which can be used for reproducing the issue.
 C:\\Downloads\\resin-pro-3.1.2\\bug_report\\bug_report.zip [^] (2,711 bytes) 09-05-07 13:49

Notes
(0002278)
emil   
09-06-07 17:01   
Thanks for the detailed bug report! The exception was indeed coming from the client looking for the WSDL. In 3.1.3, the WSDL parsing and downloading code has moved around and improved, so this bug has already been fixed in that branch.