Skip to main content

XMLStreamException with JAX-WS 2.1 RI

12 replies [Last post]
moussalf
Offline
Joined: 2006-03-27
Points: 0

Hi,

Just upgraded to JAX-WS RI 2.1 Final Release.

Started getting XMLStreamException when retrieving WSDL:

javax.servlet.ServletException: Underlying stream encoding UTF-8 and input paramter for writeStartDocument() method utf-8 do not match.
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:133)
com.sun.xml.ws.transport.http.servlet.WSServlet.doGet(WSServlet.java:56)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

I am using Tomcat 5.5.17 and 5.5.20.

If I revert back to EA3, evrything works fine.

Any ideas?

Thanks

Fady

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jitu
Offline
Joined: 2003-06-14
Points: 0

This exception is fixed on 02/16. Are you sure that you are using 02/19 nightly ?

artsu
Offline
Joined: 2007-05-02
Points: 0

Hello,

I get the same exception. I am using jaxws-spring extension version 1.4 plus had to define following dependencies:

javax.xml.bind
jaxb-api
2.1


javax.xml.ws
jaxws-api
2.1

The web service itself is working but the exception is thrown when trying to open the wsdl in browser.
Only way to get the both the service and teh wsdl working is to define

com.sun.xml.ws
jaxws-rt
EA3

which comes from following repository:

java.net
http://download.java.net/maven/1
legacy

Both with 2.1.2-SNAPSHOT and 2.1.1-RC1 the wsdl is working, but I get an exceptiong while calling the service:
java.lang.NoClassDefFoundError: com/sun/istack/XMLStreamReaderToContentHandler

What's the situation with the dependencies? I thing this should be fixed asap to work with jaxws-rt version 2.1.

kha10
Offline
Joined: 2009-08-06
Points: 0

Following is my pom.xml dependency

2.5.5
1.8


org.springframework
spring
${spring.framework}


javax.xml
jaxb-api
2.1


com.sun.xml.bind
jaxb-impl
2.1.3


com.sun.xml.stream.buffer
streambuffer
0.8


org.jvnet.staxex
stax-ex
1.2


org.jvnet.jax-ws-commons.spring
jaxws-spring
${jaxws.commons}


org.jvnet.staxex
stax-ex


com.sun.xml.stream.buffer
streambuffer


org.springframework
spring


org.springframework
spring-core


org.springframework
spring-context



org.apache.xbean
xbean-spring
2.7


org.springframework
spring


The jaxb api and impl attached in your jaxws ri is newer version than the one downloaded using test-app-1.8 or one refered to by jaxws commons.
Including Jaxb impl 2.1.3 from com.sun.xml helped me.

jitu
Offline
Joined: 2003-06-14
Points: 0

While writing the WSDL to XMLStreamWriter, it is being encoded with utf-8 encoding. Looks StAX is throwing some exception. Can you post the entire exception. Also, if possible post/send the WSDL.

astiller
Offline
Joined: 2007-02-12
Points: 0

Hi,

i get the same error (with 2.1 final and jetty 6). I tried to get the WSDL of the service and receive this message:

HTTP ERROR: 500
Underlying stream encoding UTF-8 and input paramter for writeStartDocument() method utf-8 do not match.

The trace is:

javax.servlet.ServletException: Underlying stream encoding UTF-8 and input paramter for writeStartDocument() method utf-8 do not match.
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:133)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doGet(WSServlet.java:56)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:491)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:367)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:690)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:401)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:281)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

The WSDL is:


targetNamespace="http://xxx.de/bes"
xmlns:tns="http://xxx.de/bes"
xmlns:xsd1="http://xxx.de/cvgapi"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Activity">


schemaLocation="Messages.xsd">




name="in" />











transport="http://schemas.xmlsoap.org/soap/http" />

soapAction="" />













jitu
Offline
Joined: 2003-06-14
Points: 0

Thanks for posting the exception, but the exception still doesn't contain XMLStreamException cause. Also can you try with the nightly and see if the problem still exists. I have a put a fix couple of days back.

astiller
Offline
Joined: 2007-02-12
Points: 0

I found a work-around for this problem. Initially i build the war file with maven using the artifact jaxws-rt (version 2.1). It seems that this is different from what can be loaded directly from the RI site. I took all jars from the RI distribution (directory lib) and built the war file with it. Then the error did not appear. Means, the maven repo (https://maven-repository.dev.java.net/nonav/repository) contains some older jars - even with the same artifact version 2.1

jitu
Offline
Joined: 2003-06-14
Points: 0

Can you also try with the nightly. It is kind of difficult to reproduce the problem because default encoding is different on different platforms.

astiller
Offline
Joined: 2007-02-12
Points: 0

There is a misunderstanding here, i think. Using the RI libraries (2.1 download button) directly from the RI website works. Only if i use maven to find dependant libraries using the artifact jax-ws / 2.1 the error occurs. Means the maven repo has incorrect dependencies in the pom, imho

bambo1543
Offline
Joined: 2005-10-11
Points: 0

I've the same problem with 2.1final. So I tried 2.1-nightly from 2007-02-19 and it works. But with this version I get the following exception when using Enpoint.publish():

java.io.IOException: stream is closed
at sun.net.httpserver.Request$WriteStream.write(Request.java:378)
at sun.net.httpserver.ChunkedOutputStream.writeChunk(ChunkedOutputStream.java:104)
at sun.net.httpserver.ChunkedOutputStream.close(ChunkedOutputStream.java:115)
at sun.net.httpserver.PlaceholderOutputStream.close(ExchangeImpl.java:385)
at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:252)
at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:74)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:384)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:175)
at com.sun.xml.ws.transport.http.server.WSHttpHandler.handleExchange(WSHttpHandler.java:100)
at com.sun.xml.ws.transport.http.server.WSHttpHandler.handle(WSHttpHandler.java:77)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:556)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:528)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)

bambo1543
Offline
Joined: 2005-10-11
Points: 0

I use the following jars:

jaxws-2.1 final version from: https://jax-ws.dev.java.net/2.1/JAXWS2.1FCS_20070202.jar

but instead of sjsxp-1.0 use
sjsxp-1.0.1 from: https://sjsxp.dev.java.net/files/documents/3071/50840/sjsxp_101.class
released on 2007-02-15

I don't get any exceptions with this combination.

thtesche
Offline
Joined: 2008-03-30
Points: 0

For the record the maven dependencies:

        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-rt</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.1</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.stream</groupId>
            <artifactId>sjsxp</artifactId>
            <version>1.0.1</version>
        </dependency>