[Geoserver-users] Unable to set request character encoding to UTF-8 from context /geoserver, because request parameters have already been read, or ServletRequest.getReader() has already been called

Hi All -

My web server (Sun Java System Web Server 7.0U1) is logging a warning
message every time my Geoserver (1.7.4) WFS is called.

The message looks like this...

[08/Jul/2009:14:17:41] warning ( 4504): for host 10.159.44.83 trying
to POST /geoserver/wfs, service-j2ee reports: PWC4011: Unable to set
request character encoding to UTF-8 from context /geoserver, because
request parameters have already been read, or
ServletRequest.getReader() has already been called

Everything seems to be working fine. The tricky thing is that I can't
suppress these messages by changing the Geoserver log levels because
they are from the web server. And I don't want to upgrade the logging
to error on the web server because its the web server. But the error
seems to originate because of some action taken by Geoserver code or
3rd party api.

Does anyone have any idea what is going wrong and how I might avoid
the error. (I'd prefer to make the error go away by not causing it
rather than log level trickery.)

Thanks,
Sarah

Hi Sarah,

I believe I have seen this pop up before... the problem is it is hard to nail down where this is happening, there are a couple of places where this gets set. But it might be something we can be smarter about in GeoServer, basically trying to check before setting the character encoding, and if already set don't try to set it again.

Other devs: It seems this could be happening either in the request encoding servlet filter, or in the dispatcher? Perhaps we should be smarter with a check?

-Justin

Sarah Haskins wrote:

Hi All -

My web server (Sun Java System Web Server 7.0U1) is logging a warning
message every time my Geoserver (1.7.4) WFS is called.

The message looks like this...

[08/Jul/2009:14:17:41] warning ( 4504): for host 10.159.44.83 trying
to POST /geoserver/wfs, service-j2ee reports: PWC4011: Unable to set
request character encoding to UTF-8 from context /geoserver, because
request parameters have already been read, or
ServletRequest.getReader() has already been called

Everything seems to be working fine. The tricky thing is that I can't
suppress these messages by changing the Geoserver log levels because
they are from the web server. And I don't want to upgrade the logging
to error on the web server because its the web server. But the error
seems to originate because of some action taken by Geoserver code or
3rd party api.

Does anyone have any idea what is going wrong and how I might avoid
the error. (I'd prefer to make the error go away by not causing it
rather than log level trickery.)

Thanks,
Sarah

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Thanks for the reply. If you give me a hint for where to start
debugging I could try to get some more specifics for you. I have all
the source code and wanted to dig in, but I just didn't know where to
start.

On Wed, Jul 8, 2009 at 9:10 PM, Justin Deoliveira<jdeolive@anonymised.com> wrote:

Hi Sarah,

I believe I have seen this pop up before... the problem is it is hard to
nail down where this is happening, there are a couple of places where this
gets set. But it might be something we can be smarter about in GeoServer,
basically trying to check before setting the character encoding, and if
already set don't try to set it again.

Other devs: It seems this could be happening either in the request encoding
servlet filter, or in the dispatcher? Perhaps we should be smarter with a
check?

-Justin

Sarah Haskins wrote:

Hi All -

My web server (Sun Java System Web Server 7.0U1) is logging a warning
message every time my Geoserver (1.7.4) WFS is called.

The message looks like this...

[08/Jul/2009:14:17:41] warning ( 4504): for host 10.159.44.83 trying
to POST /geoserver/wfs, service-j2ee reports: PWC4011: Unable to set
request character encoding to UTF-8 from context /geoserver, because
request parameters have already been read, or
ServletRequest.getReader() has already been called

Everything seems to be working fine. The tricky thing is that I can't
suppress these messages by changing the Geoserver log levels because
they are from the web server. And I don't want to upgrade the logging
to error on the web server because its the web server. But the error
seems to originate because of some action taken by Geoserver code or
3rd party api.

Does anyone have any idea what is going wrong and how I might avoid
the error. (I'd prefer to make the error go away by not causing it
rather than log level trickery.)

Thanks,
Sarah

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge This is your chance to win up to
$100,000 in prizes! For a limited time, vendors submitting new applications
to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

Cool, yeah that would be great if you could help us nail it down. Most developers use eclipse for debugging:

http://docs.geoserver.org/1.7.x/developer/eclipse-guide/index.html

However this problem is probably container specific so it might be hard to debug in the classic way. However I know there is some support in eclipse for running and debugging webapps in a generic container, so that might work too.

In terms of where to look in source code, the first class to look at would be SetCharacterEncodingFilter, which lives in the main module, and the Dispatcher class which lives in the ows module (look for the preprocessRequest method).

Hope that helps.

-Justin

Sarah Haskins wrote:

Thanks for the reply. If you give me a hint for where to start
debugging I could try to get some more specifics for you. I have all
the source code and wanted to dig in, but I just didn't know where to
start.

On Wed, Jul 8, 2009 at 9:10 PM, Justin Deoliveira<jdeolive@anonymised.com> wrote:

Hi Sarah,

I believe I have seen this pop up before... the problem is it is hard to
nail down where this is happening, there are a couple of places where this
gets set. But it might be something we can be smarter about in GeoServer,
basically trying to check before setting the character encoding, and if
already set don't try to set it again.

Other devs: It seems this could be happening either in the request encoding
servlet filter, or in the dispatcher? Perhaps we should be smarter with a
check?

-Justin

Sarah Haskins wrote:

Hi All -

My web server (Sun Java System Web Server 7.0U1) is logging a warning
message every time my Geoserver (1.7.4) WFS is called.

The message looks like this...

[08/Jul/2009:14:17:41] warning ( 4504): for host 10.159.44.83 trying
to POST /geoserver/wfs, service-j2ee reports: PWC4011: Unable to set
request character encoding to UTF-8 from context /geoserver, because
request parameters have already been read, or
ServletRequest.getReader() has already been called

Everything seems to be working fine. The tricky thing is that I can't
suppress these messages by changing the Geoserver log levels because
they are from the web server. And I don't want to upgrade the logging
to error on the web server because its the web server. But the error
seems to originate because of some action taken by Geoserver code or
3rd party api.

Does anyone have any idea what is going wrong and how I might avoid
the error. (I'd prefer to make the error go away by not causing it
rather than log level trickery.)

Thanks,
Sarah

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge This is your chance to win up to
$100,000 in prizes! For a limited time, vendors submitting new applications
to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full
prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.