You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Wolf, Chris (IT)" <Ch...@morganstanley.com> on 2008/03/10 05:01:26 UTC

Need help for "XMLStreamException: ParseError at [row,col]:[1,1]

I know this issue has been discussed before, because I found a
description
and apparent fix here: 

http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04687.html 

However, putting the updated Xerces and Xalan in the
TOMCAT/common/endorsed
directory did not solve the issue for me.

If I deploy my service as a standalone service embedded in Jetty, 
(generated via "wsdl2java -server")it works,
but when I configure it for WAR deployment in Tomcat-5.5, the client 
(generated via "wsdl2java -client")  throws the exception shown below.

Also when deployed in standalone mode I can retrieve the WSDL via HTTP
GET,
but when depoyed as a WAR in Tomcat, I just get a 404 error.  

When I used the TCP/IP Monitor (Eclipse plugin similar to tcpmon) I see
the
that Client is sending the expected SOAP envelope, but is getting
nothing
back, however, with HTTP 301 or 302 response codes.  I double checked my
proxy settings
in Eclipse and browser and have verified that both "localhost" and the
canonical
hostname are excluded from proxying.  I tried both "localhost" and the
canonical
hostname in the request. (overriding via
BindingProvider.ENDPOINT_ADDRESS_PROPERTY)

Any help would be greatly appreciated.

   -Chris

Mar 9, 2008 6:00:44 PM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
sage(ReadHeadersInterceptor.java:191)
[...]
	at
com.ms.cis.secadmin.services.SecAdmin_Secadmin_Client.main(SecAdmin_Seca
dmin_Client.java:60)
Caused by: javax.xml.stream.XMLStreamException: ParseError at
[row,col]:[1,1]
Message: Premature end of file.
	at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
	at
com.sun.xml.stream.XMLReaderImpl.nextTag(XMLReaderImpl.java:1177)
	at
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
sage(ReadHeadersInterceptor.java:85)
	... 15 more
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

RE: Need help for "XMLStreamException: ParseError at [row,col]:[1,1]

Posted by "Wolf, Chris (IT)" <Ch...@morganstanley.com>.
I switched from using Eclispe's built-in TCP/IP monitor, to using the 
standalone tcpmon (which shows HTTP headers) and saw that the 302 was 
redirecting from the canonical host to "localhost" (as I suspected).   

However, this redirect issue was a "red herring", as the real issue
was that I was using the wrong URL the whole time!  Your blog page,
[2] that totally explained the URL construction process that cleared 
my murky understanding of this.  

It turns out that I started the project using the standalone server,
which makes the wsdl and services available at the URL in the wsdl,
but the WAR/Tomcat deployment adds the extra path component,
"/services/", which of course, I was oblivious to.

After fixing the URL, I was able to retrieve the WSDL, then I was able
to
get the client working.

I would say that your explaination of how each URL path component is
traced
to where it comes from was extremely helpful, as it was never explained 
that clearly anywhere I've seen so far.

   -Chris


-----Original Message-----
From: Glen Mazza [mailto:glen.mazza@verizon.net] 
Sent: Monday, March 10, 2008 12:15 AM
To: cxf-user@incubator.apache.org
Subject: Re: Need help for "XMLStreamException: ParseError at
[row,col]:[1,1]

What are you putting in the WAR file--the web service or the SOAP
client?

Also, I'm unsure if you should be relying on the autogenerated
client--that is primarily a helper file not really part of JAX-WS
(GlassFish Metro I don't think provides it.)  I've never bothered using
it.

The first thing to check is to make sure that you can access the Web
Service's wsdl from a browser after you have deployed it to Tomcat--if
you can't, then no client will ever work.  (Check [2] for how WSDL URLs
are created using Tomcat and CXF.) Once you know you can access the wsdl
from a browser, you should be able to manually create a client similar
in appearance to the example here[3] or here[4].

HTH,
Glen

[1] http://www.jroller.com/gmazza/date/20080308#MTstep9
[2] http://www.jroller.com/gmazza/date/20071019#notes (note #4) [3]
http://www.jroller.com/gmazza/entry/using_the_ebay_shopping_api1
(step #7)
[4] http://www.jroller.com/gmazza/date/20070929

Am Montag, den 10.03.2008, 00:01 -0400 schrieb Wolf, Chris (IT):
> I know this issue has been discussed before, because I found a 
> description and apparent fix here:
> 
> http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04687.htm
> l
> 
> However, putting the updated Xerces and Xalan in the 
> TOMCAT/common/endorsed directory did not solve the issue for me.
> 
> If I deploy my service as a standalone service embedded in Jetty, 
> (generated via "wsdl2java -server")it works, but when I configure it 
> for WAR deployment in Tomcat-5.5, the client (generated via "wsdl2java

> -client")  throws the exception shown below.
> 
> Also when deployed in standalone mode I can retrieve the WSDL via HTTP

> GET, but when depoyed as a WAR in Tomcat, I just get a 404 error.
> 
> When I used the TCP/IP Monitor (Eclipse plugin similar to tcpmon) I 
> see the that Client is sending the expected SOAP envelope, but is 
> getting nothing back, however, with HTTP 301 or 302 response codes.  I

> double checked my proxy settings in Eclipse and browser and have 
> verified that both "localhost" and the canonical hostname are excluded

> from proxying.  I tried both "localhost" and the canonical hostname in

> the request. (overriding via
> BindingProvider.ENDPOINT_ADDRESS_PROPERTY)
> 
> Any help would be greatly appreciated.
> 
>    -Chris
> 
> Mar 9, 2008 6:00:44 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
> es
> sage(ReadHeadersInterceptor.java:191)
> [...]
> 	at
> com.ms.cis.secadmin.services.SecAdmin_Secadmin_Client.main(SecAdmin_Se
> ca
> dmin_Client.java:60)
> Caused by: javax.xml.stream.XMLStreamException: ParseError at 
> [row,col]:[1,1]
> Message: Premature end of file.
> 	at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
> 	at
> com.sun.xml.stream.XMLReaderImpl.nextTag(XMLReaderImpl.java:1177)
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
> es
> sage(ReadHeadersInterceptor.java:85)
> 	... 15 more
> --------------------------------------------------------
> 
> NOTICE: If received in error, please destroy and notify sender. Sender
does not intend to waive confidentiality or privilege. Use of this email
is prohibited when received in error.
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

Re: Need help for "XMLStreamException: ParseError at [row,col]:[1,1]

Posted by Glen Mazza <gl...@verizon.net>.
What are you putting in the WAR file--the web service or the SOAP
client?

Also, I'm unsure if you should be relying on the autogenerated
client--that is primarily a helper file not really part of JAX-WS
(GlassFish Metro I don't think provides it.)  I've never bothered using
it.

The first thing to check is to make sure that you can access the Web
Service's wsdl from a browser after you have deployed it to Tomcat--if
you can't, then no client will ever work.  (Check [2] for how WSDL URLs
are created using Tomcat and CXF.) Once you know you can access the wsdl
from a browser, you should be able to manually create a client similar
in appearance to the example here[3] or here[4].

HTH,
Glen

[1] http://www.jroller.com/gmazza/date/20080308#MTstep9
[2] http://www.jroller.com/gmazza/date/20071019#notes (note #4)
[3] http://www.jroller.com/gmazza/entry/using_the_ebay_shopping_api1
(step #7)
[4] http://www.jroller.com/gmazza/date/20070929

Am Montag, den 10.03.2008, 00:01 -0400 schrieb Wolf, Chris (IT):
> I know this issue has been discussed before, because I found a
> description
> and apparent fix here: 
> 
> http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04687.html 
> 
> However, putting the updated Xerces and Xalan in the
> TOMCAT/common/endorsed
> directory did not solve the issue for me.
> 
> If I deploy my service as a standalone service embedded in Jetty, 
> (generated via "wsdl2java -server")it works,
> but when I configure it for WAR deployment in Tomcat-5.5, the client 
> (generated via "wsdl2java -client")  throws the exception shown below.
> 
> Also when deployed in standalone mode I can retrieve the WSDL via HTTP
> GET,
> but when depoyed as a WAR in Tomcat, I just get a 404 error.  
> 
> When I used the TCP/IP Monitor (Eclipse plugin similar to tcpmon) I see
> the
> that Client is sending the expected SOAP envelope, but is getting
> nothing
> back, however, with HTTP 301 or 302 response codes.  I double checked my
> proxy settings
> in Eclipse and browser and have verified that both "localhost" and the
> canonical
> hostname are excluded from proxying.  I tried both "localhost" and the
> canonical
> hostname in the request. (overriding via
> BindingProvider.ENDPOINT_ADDRESS_PROPERTY)
> 
> Any help would be greatly appreciated.
> 
>    -Chris
> 
> Mar 9, 2008 6:00:44 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
> sage(ReadHeadersInterceptor.java:191)
> [...]
> 	at
> com.ms.cis.secadmin.services.SecAdmin_Secadmin_Client.main(SecAdmin_Seca
> dmin_Client.java:60)
> Caused by: javax.xml.stream.XMLStreamException: ParseError at
> [row,col]:[1,1]
> Message: Premature end of file.
> 	at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
> 	at
> com.sun.xml.stream.XMLReaderImpl.nextTag(XMLReaderImpl.java:1177)
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMes
> sage(ReadHeadersInterceptor.java:85)
> 	... 15 more
> --------------------------------------------------------
> 
> NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.


RE: Need help for "XMLStreamException: ParseError at [row,col]:[1,1]

Posted by "Wolf, Chris (IT)" <Ch...@morganstanley.com>.
Dan,

Thanks for taking the time to help me out.  I implemented the code you
suggested
and the error changed.  I'm still getting a 302 on the response.  I
think I'll
need to use the standalone tcpmon, which, if I remember correctly, shows
all the 
HTTP headers.

   -Chris


INFO: AutoRedirect is turned on.
Mar 10, 2008 5:02:58 PM org.apache.cxf.phase.PhaseInterceptorChain
doIntercept
INFO: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI
nterceptor.handleMessage(MessageSenderInterceptor.java:64)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
hain.java:220)
	at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
	at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
	at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:142)
	at $Proxy30.fetchSecIdParamsHist(Unknown Source)
	at
com.ms.cis.secadmin.test.cxf.SecAdminClient.main(SecAdminClient.java:76)
Caused by: java.io.IOException: /secadmin/
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResp
onse(HTTPConduit.java:1888)
	at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTP
Conduit.java:1791)
	at
org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at
org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:575)
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI
nterceptor.handleMessage(MessageSenderInterceptor.java:62)
	... 7 more
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could
not send Message.
	at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:182)
	at $Proxy30.fetchSecIdParamsHist(Unknown Source)
	at
com.ms.cis.secadmin.test.cxf.SecAdminClient.main(SecAdminClient.java:76)
Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
	at
org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingI
nterceptor.handleMessage(MessageSenderInterceptor.java:64)
	at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
hain.java:220)
	at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:276)
	at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:222)
	at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:142)
	... 2 more
Caused by: java.io.IOException: /secadmin/  

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Monday, March 10, 2008 11:04 AM
To: cxf-user@incubator.apache.org
Cc: Wolf, Chris (IT)
Subject: Re: Need help for "XMLStreamException: ParseError at
[row,col]:[1,1]


An HTTP 30x response code is usually a redirect response.   By default, 
due to our streaming nature, we cannot honor redirects.  You can 
configure the HTTPConduit to allow the redirects.   When you do that, it

no longer can stream (it must buffer the request), but it may work for
you.

  Client client = ClientProxy.getClient(proxy);
  HTTPConduit http = (HTTPConduit) client.getConduit();
  http.getClient().setAutoRedirect(true);

Dan



On Monday 10 March 2008, Wolf, Chris (IT) wrote:
> I know this issue has been discussed before, because I found a 
> description and apparent fix here:
>
> http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04687.htm
>l
>
> However, putting the updated Xerces and Xalan in the 
> TOMCAT/common/endorsed directory did not solve the issue for me.
>
> If I deploy my service as a standalone service embedded in Jetty, 
> (generated via "wsdl2java -server")it works, but when I configure it 
> for WAR deployment in Tomcat-5.5, the client (generated via "wsdl2java

> -client")  throws the exception shown below.
>
> Also when deployed in standalone mode I can retrieve the WSDL via HTTP

> GET, but when depoyed as a WAR in Tomcat, I just get a 404 error.
>
> When I used the TCP/IP Monitor (Eclipse plugin similar to tcpmon) I 
> see the that Client is sending the expected SOAP envelope, but is 
> getting nothing back, however, with HTTP 301 or 302 response codes.  I

> double checked my proxy settings in Eclipse and browser and have 
> verified that both "localhost" and the canonical hostname are excluded

> from proxying.  I tried both "localhost" and the canonical hostname in

> the request. (overriding via
> BindingProvider.ENDPOINT_ADDRESS_PROPERTY)
>
> Any help would be greatly appreciated.
>
>    -Chris
>
> Mar 9, 2008 6:00:44 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
>es sage(ReadHeadersInterceptor.java:191)
> [...]
> 	at
> com.ms.cis.secadmin.services.SecAdmin_Secadmin_Client.main(SecAdmin_Se
>ca dmin_Client.java:60)
> Caused by: javax.xml.stream.XMLStreamException: ParseError at  
>[row,col]:[1,1]
> Message: Premature end of file.
> 	at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
> 	at
> com.sun.xml.stream.XMLReaderImpl.nextTag(XMLReaderImpl.java:1177)
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
>es sage(ReadHeadersInterceptor.java:85)
> 	... 15 more
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender

> does not intend to waive confidentiality or privilege. Use of this 
> email is prohibited when received in error.



--
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to waive confidentiality or privilege. Use of this email is prohibited when received in error.

Re: Need help for "XMLStreamException: ParseError at [row,col]:[1,1]

Posted by Daniel Kulp <dk...@apache.org>.
An HTTP 30x response code is usually a redirect response.   By default, 
due to our streaming nature, we cannot honor redirects.  You can 
configure the HTTPConduit to allow the redirects.   When you do that, it 
no longer can stream (it must buffer the request), but it may work for 
you.

  Client client = ClientProxy.getClient(proxy);
  HTTPConduit http = (HTTPConduit) client.getConduit();
  http.getClient().setAutoRedirect(true);

Dan



On Monday 10 March 2008, Wolf, Chris (IT) wrote:
> I know this issue has been discussed before, because I found a
> description
> and apparent fix here:
>
> http://www.mail-archive.com/cxf-user@incubator.apache.org/msg04687.htm
>l
>
> However, putting the updated Xerces and Xalan in the
> TOMCAT/common/endorsed
> directory did not solve the issue for me.
>
> If I deploy my service as a standalone service embedded in Jetty,
> (generated via "wsdl2java -server")it works,
> but when I configure it for WAR deployment in Tomcat-5.5, the client
> (generated via "wsdl2java -client")  throws the exception shown below.
>
> Also when deployed in standalone mode I can retrieve the WSDL via HTTP
> GET,
> but when depoyed as a WAR in Tomcat, I just get a 404 error.
>
> When I used the TCP/IP Monitor (Eclipse plugin similar to tcpmon) I
> see the
> that Client is sending the expected SOAP envelope, but is getting
> nothing
> back, however, with HTTP 301 or 302 response codes.  I double checked
> my proxy settings
> in Eclipse and browser and have verified that both "localhost" and the
> canonical
> hostname are excluded from proxying.  I tried both "localhost" and the
> canonical
> hostname in the request. (overriding via
> BindingProvider.ENDPOINT_ADDRESS_PROPERTY)
>
> Any help would be greatly appreciated.
>
>    -Chris
>
> Mar 9, 2008 6:00:44 PM org.apache.cxf.phase.PhaseInterceptorChain
> doIntercept
> INFO: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
>es sage(ReadHeadersInterceptor.java:191)
> [...]
> 	at
> com.ms.cis.secadmin.services.SecAdmin_Secadmin_Client.main(SecAdmin_Se
>ca dmin_Client.java:60)
> Caused by: javax.xml.stream.XMLStreamException: ParseError at
> [row,col]:[1,1]
> Message: Premature end of file.
> 	at com.sun.xml.stream.XMLReaderImpl.next(XMLReaderImpl.java:563)
> 	at
> com.sun.xml.stream.XMLReaderImpl.nextTag(XMLReaderImpl.java:1177)
> 	at
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleM
>es sage(ReadHeadersInterceptor.java:85)
> 	... 15 more
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender. Sender
> does not intend to waive confidentiality or privilege. Use of this
> email is prohibited when received in error.



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog