Junk characters in SOAP request after upgrade to tomcat 9.0.31

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

Junk characters in SOAP request after upgrade to tomcat 9.0.31

Naveen Kumar
Hi All,

I have a webapp A which has few SOAP services and I consume those services
from webapp B.
I started getting below error since I upgraded the tomcat to 9.0.31 (from
9.0.24):
com.sun.xml.ws.transport.http.HttpAdapter.invokeAsync Couldn't create SOAP
message due to exception: XML reader error:
javax.xml.stream.XMLStreamException: java.io.EOFException: Unexpected EOF

Then I wrote a filter at webapp A to intercept the request and I could see
that some junk characters are added in the SOAP request.

If I upgrade tomcat to 9.0.35, the error disappears.

Problematic request:
LoggingFilter.doFilter - The servlet  request soap mapping  body is:à   8Ï
S(http://schemas.xmlsoap.org/soap/envelope/ð??? Envelope??? Body8Ï ns13

Correct request:
The servlet  request soap mapping  body is:<?xml version='1.0'
encoding='UTF-8'?><S:Envelope xmlns:S

Does anyone know what could be the possible reason for this?

Thanks in advance.
- Naveen
Reply | Threaded
Open this post in threaded view
|

Re: Junk characters in SOAP request after upgrade to tomcat 9.0.31

Luis Rodríguez Fernández
Hello Naveen,

Recently we have had a similar issue migrating a webapp from another
application server to tomcat. We solved it specifying
<request-character-encoding>UTF-8</request-character-encoding> in the
web.xml descriptor.

You can read here [1] the long story :)

Hope it helps,

Luis

[1] https://cwiki.apache.org/confluence/display/TOMCAT/Character+Encoding


El mié., 10 jun. 2020 a las 11:08, Naveen Kumar (<[hidden email]>)
escribió:

> Hi All,
>
> I have a webapp A which has few SOAP services and I consume those services
> from webapp B.
> I started getting below error since I upgraded the tomcat to 9.0.31 (from
> 9.0.24):
> com.sun.xml.ws.transport.http.HttpAdapter.invokeAsync Couldn't create SOAP
> message due to exception: XML reader error:
> javax.xml.stream.XMLStreamException: java.io.EOFException: Unexpected EOF
>
> Then I wrote a filter at webapp A to intercept the request and I could see
> that some junk characters are added in the SOAP request.
>
> If I upgrade tomcat to 9.0.35, the error disappears.
>
> Problematic request:
> LoggingFilter.doFilter - The servlet  request soap mapping  body is:à   8Ï
> S(http://schemas.xmlsoap.org/soap/envelope/ð??? Envelope??? Body8Ï ns13
>
> Correct request:
> The servlet  request soap mapping  body is:<?xml version='1.0'
> encoding='UTF-8'?><S:Envelope xmlns:S
>
> Does anyone know what could be the possible reason for this?
>
> Thanks in advance.
> - Naveen
>


--

"Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."

- Samuel Beckett
Reply | Threaded
Open this post in threaded view
|

Re: Junk characters in SOAP request after upgrade to tomcat 9.0.31

Naveen Kumar
Hi Luis,

Thanks for your suggestion.
But I am wondering what has changed in 9.0.31. Because my webapp works
perfectly fine in 9.0.24 and 9.0.35.

Thanks
Naveen

On Wed, Jun 10, 2020 at 2:52 PM Luis Rodríguez Fernández <[hidden email]>
wrote:

> Hello Naveen,
>
> Recently we have had a similar issue migrating a webapp from another
> application server to tomcat. We solved it specifying
> <request-character-encoding>UTF-8</request-character-encoding> in the
> web.xml descriptor.
>
> You can read here [1] the long story :)
>
> Hope it helps,
>
> Luis
>
> [1] https://cwiki.apache.org/confluence/display/TOMCAT/Character+Encoding
>
>
> El mié., 10 jun. 2020 a las 11:08, Naveen Kumar (<[hidden email]>)
> escribió:
>
> > Hi All,
> >
> > I have a webapp A which has few SOAP services and I consume those
> services
> > from webapp B.
> > I started getting below error since I upgraded the tomcat to 9.0.31 (from
> > 9.0.24):
> > com.sun.xml.ws.transport.http.HttpAdapter.invokeAsync Couldn't create
> SOAP
> > message due to exception: XML reader error:
> > javax.xml.stream.XMLStreamException: java.io.EOFException: Unexpected EOF
> >
> > Then I wrote a filter at webapp A to intercept the request and I could
> see
> > that some junk characters are added in the SOAP request.
> >
> > If I upgrade tomcat to 9.0.35, the error disappears.
> >
> > Problematic request:
> > LoggingFilter.doFilter - The servlet  request soap mapping  body is:à
>  8Ï
> > S(http://schemas.xmlsoap.org/soap/envelope/ð??? Envelope??? Body8Ï ns13
> >
> > Correct request:
> > The servlet  request soap mapping  body is:<?xml version='1.0'
> > encoding='UTF-8'?><S:Envelope xmlns:S
> >
> > Does anyone know what could be the possible reason for this?
> >
> > Thanks in advance.
> > - Naveen
> >
>
>
> --
>
> "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."
>
> - Samuel Beckett
>
Reply | Threaded
Open this post in threaded view
|

Re: Junk characters in SOAP request after upgrade to tomcat 9.0.31

Naveen Kumar
Hi All,

Can someone please help on this ? It is in production and affecting many
customers. Upgrading tomcat is a big task.
Any pointers will be really appreciated.

Thanks
Naveen

On Wed, Jun 10, 2020 at 4:24 PM Naveen Kumar <[hidden email]> wrote:

> Hi Luis,
>
> Thanks for your suggestion.
> But I am wondering what has changed in 9.0.31. Because my webapp works
> perfectly fine in 9.0.24 and 9.0.35.
>
> Thanks
> Naveen
>
> On Wed, Jun 10, 2020 at 2:52 PM Luis Rodríguez Fernández <
> [hidden email]> wrote:
>
>> Hello Naveen,
>>
>> Recently we have had a similar issue migrating a webapp from another
>> application server to tomcat. We solved it specifying
>> <request-character-encoding>UTF-8</request-character-encoding> in the
>> web.xml descriptor.
>>
>> You can read here [1] the long story :)
>>
>> Hope it helps,
>>
>> Luis
>>
>> [1] https://cwiki.apache.org/confluence/display/TOMCAT/Character+Encoding
>>
>>
>> El mié., 10 jun. 2020 a las 11:08, Naveen Kumar (<[hidden email]>)
>> escribió:
>>
>> > Hi All,
>> >
>> > I have a webapp A which has few SOAP services and I consume those
>> services
>> > from webapp B.
>> > I started getting below error since I upgraded the tomcat to 9.0.31
>> (from
>> > 9.0.24):
>> > com.sun.xml.ws.transport.http.HttpAdapter.invokeAsync Couldn't create
>> SOAP
>> > message due to exception: XML reader error:
>> > javax.xml.stream.XMLStreamException: java.io.EOFException: Unexpected
>> EOF
>> >
>> > Then I wrote a filter at webapp A to intercept the request and I could
>> see
>> > that some junk characters are added in the SOAP request.
>> >
>> > If I upgrade tomcat to 9.0.35, the error disappears.
>> >
>> > Problematic request:
>> > LoggingFilter.doFilter - The servlet  request soap mapping  body is:à
>>  8Ï
>> > S(http://schemas.xmlsoap.org/soap/envelope/ð??? Envelope??? Body8Ï ns13
>> >
>> > Correct request:
>> > The servlet  request soap mapping  body is:<?xml version='1.0'
>> > encoding='UTF-8'?><S:Envelope xmlns:S
>> >
>> > Does anyone know what could be the possible reason for this?
>> >
>> > Thanks in advance.
>> > - Naveen
>> >
>>
>>
>> --
>>
>> "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."
>>
>> - Samuel Beckett
>>
>
Reply | Threaded
Open this post in threaded view
|

Re: Junk characters in SOAP request after upgrade to tomcat 9.0.31

Martin Grigorov
Hi,

On Fri, Jun 12, 2020 at 8:17 AM Naveen Kumar <[hidden email]> wrote:

> Hi All,
>
> Can someone please help on this ? It is in production and affecting many
> customers. Upgrading tomcat is a big task.
> Any pointers will be really appreciated.
>

You say "If I upgrade tomcat to 9.0.35, the error disappears." - this is
the right solution - upgrade to the latest release. We make releases
because there are bug fixes and improvements.

If you just want to know which particular commit caused the regression you
experience in 9.0.31 then you have two options:
1) read the changelogs and try to figure out
2)  'git bisect' Tomcat sources:
git clone https://github.com/apache/tomcat
git bisect start
git bisect good tag/9.0.24
git bisect bad tag/9.0.31
ant clean
ant
deploy your app and test


>
> Thanks
> Naveen
>
> On Wed, Jun 10, 2020 at 4:24 PM Naveen Kumar <[hidden email]> wrote:
>
> > Hi Luis,
> >
> > Thanks for your suggestion.
> > But I am wondering what has changed in 9.0.31. Because my webapp works
> > perfectly fine in 9.0.24 and 9.0.35.
> >
> > Thanks
> > Naveen
> >
> > On Wed, Jun 10, 2020 at 2:52 PM Luis Rodríguez Fernández <
> > [hidden email]> wrote:
> >
> >> Hello Naveen,
> >>
> >> Recently we have had a similar issue migrating a webapp from another
> >> application server to tomcat. We solved it specifying
> >> <request-character-encoding>UTF-8</request-character-encoding> in the
> >> web.xml descriptor.
> >>
> >> You can read here [1] the long story :)
> >>
> >> Hope it helps,
> >>
> >> Luis
> >>
> >> [1]
> https://cwiki.apache.org/confluence/display/TOMCAT/Character+Encoding
> >>
> >>
> >> El mié., 10 jun. 2020 a las 11:08, Naveen Kumar (<[hidden email]>)
> >> escribió:
> >>
> >> > Hi All,
> >> >
> >> > I have a webapp A which has few SOAP services and I consume those
> >> services
> >> > from webapp B.
> >> > I started getting below error since I upgraded the tomcat to 9.0.31
> >> (from
> >> > 9.0.24):
> >> > com.sun.xml.ws.transport.http.HttpAdapter.invokeAsync Couldn't create
> >> SOAP
> >> > message due to exception: XML reader error:
> >> > javax.xml.stream.XMLStreamException: java.io.EOFException: Unexpected
> >> EOF
> >> >
> >> > Then I wrote a filter at webapp A to intercept the request and I could
> >> see
> >> > that some junk characters are added in the SOAP request.
> >> >
> >> > If I upgrade tomcat to 9.0.35, the error disappears.
> >> >
> >> > Problematic request:
> >> > LoggingFilter.doFilter - The servlet  request soap mapping  body is:à
> >>  8Ï
> >> > S(http://schemas.xmlsoap.org/soap/envelope/ð??? Envelope??? Body8Ï
> ns13
> >> >
> >> > Correct request:
> >> > The servlet  request soap mapping  body is:<?xml version='1.0'
> >> > encoding='UTF-8'?><S:Envelope xmlns:S
> >> >
> >> > Does anyone know what could be the possible reason for this?
> >> >
> >> > Thanks in advance.
> >> > - Naveen
> >> >
> >>
> >>
> >> --
> >>
> >> "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail
> better."
> >>
> >> - Samuel Beckett
> >>
> >
>