Unexpected EOF in prolog - CXF -https

classic Classic list List threaded Threaded
8 messages Options
Faz
Reply | Threaded
Open this post in threaded view
|

Unexpected EOF in prolog - CXF -https

Faz
This post was updated on .
Hi All, I recently stumbled upon this issue, which I dont seem to understand why its happenning. I have a cxf SOAP web-services running on a Tomcat server, everything works fine when I try to access the webservices via a stand-alone program either using the tomcat /apache url via http. But when I try to access it via https url, i get this - "Unexpected EOF in prolog" issue intermittentlyi.e, works a few times and fails a few times. i have set-up the usernametoken security set-up in the wsdl defin itself, it been working fine on the tomcat/apache server quite well all these days, but when we tried to access it via https. then its hit by the below error.. Please suggest!
Logs depicting the headers:
2014-06-22 22:47:56,647 DEBUG org.apache.cxf.transport.http.Headers - Accept: */*
2014-06-22 22:47:56,662 DEBUG org.apache.cxf.transport.http.TrustDecisionUtil - 
No Trust Decider for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit'. 
An afirmative Trust Decision is assumed.
2014-06-22 22:47:57,428 DEBUG org.apache.cxf.transport.http.HTTPConduit - Response Code: 302 Conduit: {http://cxf.apache.org}TransportURIResolver.http-conduit
2014-06-22 22:47:57,428 DEBUG org.apache.cxf.transport.http.HTTPConduit - Content length: 0
2014-06-22 22:47:57,428 DEBUG org.apache.cxf.transport.http.HTTPConduit - Header fields: 
    Content-Length: [0]
    Connection: [close]
    null: [HTTP/1.1 302 Found]
    Set-Cookie: [cross-prevent=/Common/xxx;path=/;, *************=3824045578.25889.0000; path=/]
    Date: [Sun, 22 Jun 2014 20:47:57 GMT]
    Content-Type: [text/plain; charset=ISO-8859-1]
    Age: [0]
    Location: [https://xx.com?wsdl]


DEBUG org.apache.cxf.configuration.spring.ConfigurerImpl - Could not find a definition for bean with id {http://cxf.apache.org}TransportURIResolver.http-conduit 
- no injection will be performed.
DEBUG org.apache.cxf.configuration.spring.ConfigurerImpl - Could not find a definition for bean with id https://xxx - no injection will be performed.
DEBUG org.apache.cxf.transport.http.HTTPConduit - Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' has been (re)configured for plain http.
DEBUG org.apache.cxf.transport.http.HTTPConduit - No Trust Decider configured for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit'
DEBUG org.apache.cxf.transport.http.HTTPConduit - No Auth Supplier configured for Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit'
DEBUG org.apache.cxf.transport.http.HTTPConduit - Conduit '{http://cxf.apache.org}TransportURIResolver.http-conduit' has been configured for plain http.


Error logs ---------------------------
Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
	at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:149)
	at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:98)
	at javax.xml.ws.Service.<init>(Service.java:35)
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
	at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:100)
	at org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)
	at org.apache.cxf.jaxws.ServiceImpl.<init>(ServiceImpl.java:147)
	... 4 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col,system-id]: [1,0,"https://xx.com?wsdl"]
	at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:241)
	at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:190)
	at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:98)
	... 6 more
Caused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
 at [row,col,system-id]: [1,0,"https://xx.com?wsdl"]
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected EOF in prolog - CXF -https

Aki Yoshida-3
it is failing when it tries to retrieve the specified wsdl, as logged here:
javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at
[row,col,system-id]: [1,0,"https://xx.com?wsdl"]        at

i suppose this xx.com isn't the one you were actually using, but could
you check the configured wsdl resource is correct and retrievable from
the node where your cxf app is running?


2014-06-22 22:08 GMT+02:00 Faz <[hidden email]>:

> Hi All,I recently stumbled upon this issue, which I dont seem to understand
> why its happenning.I have a cxf SOAP web-services running on a Tomcat
> server, everything works fine when I try to access the webservices via a
> stand-alone program either using the tomcat /apache url via http. But when I
> try to access it via https url, i get this - "Unexpected EOF in prolog"
> issue intermittentlyi.e, works a few times and fails a few times. i have
> set-up the usernametoken security set-up in the wsdl defin itself, it been
> working fine on the tomcat/apache server quite well all these days, but when
> we tried to access it via https. then its hit by the below error.. Please
> suggest!*Exception in thread "main" javax.xml.ws.WebServiceException:
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service. at org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:149)
> at
> org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:98)
> at javax.xml.ws.Service.(Service.java:35)Caused by:
> org.apache.cxf.service.factory.ServiceConstructionException: Failed to
> create service. at
> org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:100)  at
> org.apache.cxf.jaxws.ServiceImpl.initializePorts(ServiceImpl.java:203)  at
> org.apache.cxf.jaxws.ServiceImpl.(ServiceImpl.java:147) ... 4 moreCaused by:
> javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
> com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog at
> [row,col,system-id]: [1,0,"https://xx.com?wsdl"]        at
> org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:241)
> at
> org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:190)
> at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:98)        ...
> 6 moreCaused by: com.ctc.wstx.exc.WstxEOFException: Unexpected EOF in prolog
> at [row,col,system-id]: [1,0,"https://xx.com?wsdl"]*
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Unexpected-EOF-in-prolog-CXF-https-tp5745450.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Faz
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected EOF in prolog - CXF -https

Faz
Thanks for the response, Aki!

Indeed , the xx.com is a contrived URL. I am able to retrieve the correct wsdl resource when I try to hit the f5 url. I dont encounter this 302 error always, its once in a whil I get stumbled on this issue.

My setup is something like,
F5(Domain URL) > Apache > Tomcat.

When I get the 302 error, the request I believ doesn't even get pasts the initial one or the apache url. But when I try the url via a web browser I always gte the valid wsdl downloaded and show on my browser page.

When I access the apache/tomcat urls via http, I always get the response both in browser and the stand-alone program!
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected EOF in prolog - CXF -https

Aki Yoshida-3
i didn't see it was about 302. why is the server redirecting the
request and to where?
if that is expected occasionally, you can try setting the AutoRedirect
property of your http conduit/clint.
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html


2014-06-23 14:58 GMT+02:00 Faz <[hidden email]>:

> Thanks for the response, Aki!
>
> Indeed , the xx.com is a contrived URL. I am able to retrieve the correct
> wsdl resource when I try to hit the f5 url. I dont encounter this 302 error
> always, its once in a whil I get stumbled on this issue.
>
> My setup is something like,
> F5(Domain URL) > Apache > Tomcat.
>
> When I get the 302 error, the request I believ doesn't even get pasts the
> initial one or the apache url. But when I try the url via a web browser I
> always gte the valid wsdl downloaded and show on my browser page.
>
> When I access the apache/tomcat urls via http, I always get the response
> both in browser and the stand-alone program!
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Unexpected-EOF-in-prolog-CXF-https-tp5745450p5745491.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Faz
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected EOF in prolog - CXF -https

Faz
Aki,
When you say server, which one do you mean the F5, Apache or Tomcat? From what I know, there is no explicit auto-redirection set for this..

Do you suspect anything here?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected EOF in prolog - CXF -https

Aki Yoshida-3
I don't know how your F5/BigIP is configured and as it can have
routing rules, I don't know who (which server) is doing the redirect.

If you want to figure out why and where this redirect is happening,
you need to get the F5 details log or the cxf log (but i'm not sure if
you can get to show the whole 302 response in the cxf log). if the
redirect is happening at the apache/tomcat (i don't know what you mean
by "apache or tomcat", i thought you have a F5 and behind it, several
tomcat servers, no?)  , it should be shown in their logs.

if you don't care about this redirect thing, you can try the
autoredirect option, as i mentioned earlier.


2014-06-23 16:03 GMT+02:00 Faz <[hidden email]>:

> Aki,
> When you say server, which one do you mean the F5, Apache or Tomcat? From
> what I know, there is no explicit auto-redirection set for this..
>
> Do you suspect anything here?
>
> Thanks
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Unexpected-EOF-in-prolog-CXF-https-tp5745450p5745495.html
> Sent from the cxf-user mailing list archive at Nabble.com.
Faz
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected EOF in prolog - CXF -https

Faz
Aki,

When I say apache/tomcat, I mean its webserver and appserver respectively. SO to be more clear,
its from F5 > APACHE WEB SERVER >TOMCAT APP SERVER.
I believe i will have to check the F5, cos when I use the apache or tomcat URL, I never get the error (May be its cos it not secure - not via https).. Does this really correspond to a https issue?

By the way, I want to try your other option.. But unable to get that working. The only below is my cxf.xml for client and I generate client using the CXF eclipse defaults. How and where should I introduce the autoredirect property within this configurations?

<jaxws:client name="{http://com.xx/xxx}xx12" createdFromAPI="true">
        
      <jaxws:features>
	<bean class="org.apache.cxf.feature.LoggingFeature" />
      </jaxws:features>
		
       <jaxws:properties>
            <entry key="ws-security.username" value="zz"/>        
            <entry key="ws-security.password" value="zzz"/>
	 		<entry key="ws-security.timestamp.timeToLive" value="600"/>
	 		<entry key="ws-security.timestamp.futureTimeToLive" value="1500"/>
        </jaxws:properties>
</jaxws:client>
Reply | Threaded
Open this post in threaded view
|

Re: Unexpected EOF in prolog - CXF -https

Aki Yoshida-3
2014-06-23 18:12 GMT+02:00 Faz <[hidden email]>:
> Aki,
>
> When I say apache/tomcat, I mean its webserver and appserver respectively.
> SO to be more clear,
> its from F5 > APACHE WEB SERVER >TOMCAT APP SERVER.
> I believe i will have to check the F5, cos when I use the apache or tomcat
> URL, I never get the error (May be its cos it not secure - not via https)..
> Does this really correspond to a *https issue*?

I think it's a good idea to ask the F5 admin about the redirect.
You could also try to get the CXF logs to find out where the request
gets redirected. Because that might indicate who is triggering the
redirect.

>
> By the way, I want to try your other option.. But unable to get that
> working. The only below is my cxf.xml for client and I generate client using
> the CXF eclipse defaults. How and where should I introduce the autoredirect
> property within this configurations?

you need to configure an http conduit that matches the call. The
simplest matching rule is just use a transport regex like "https:.*".
here is the online info.
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Theclientelement

regards, aki
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Unexpected-EOF-in-prolog-CXF-https-tp5745450p5745499.html
> Sent from the cxf-user mailing list archive at Nabble.com.