• Welcome to KonaKart Community Forum. Please login or sign up.
 

Unable to set character encoding UTF-8

Started by clinton, October 24, 2007, 08:17:08 am

Previous topic - Next topic

clinton

Hello,
  using the new 2.2.07 release, I have cobbled together my own konakart.war file using a custom ant build and deployed under Glassfish 9.0_01.

The app seems to work ok, but on each page transition (ie: navigation to a different page), Glassfish's server.log is reporting:

[#|2007-10-24T16:47:50.613+1000|WARNING|sun-appserver-pe9.0|org.apache.coyote.to
mcat5.CoyoteRequest|_ThreadID=16;_ThreadName=httpWorkerThread-8080-0;_RequestID=
ef381231-441e-4eeb-bc8a-8e8d5e490353;|Unable to set character encoding UTF-8 because request parameters have already been read, or ServletRequest.getReader() has been called|#]

Short of using a debugger or enabling struts debug, I'm not sure how to debug this further.  In this app I haven't deployed a log4j.properties yet.

Can anyone cast some light on why this warning might be occurring?

Thanks,
  Clinton.

julie

Hi Clinton,

Is this something you are seeing in the 2.2.0.7 release that you didn't see in the previous one ?

Thanks,

Julie

clinton

Thanks Julie for your prompt reply,  I've checked a previous log from v2.2.0.6 and I've found one and only one previous occurence of this error:

[#|2007-10-09T12:24:07.866+1000|WARNING|sun-appserver-pe9.0|org.apache.coyote.tomcat5.CoyoteRequest|_ThreadID=12;_ThreadName=httpWorkerThread-4848-0;_RequestID=947bda24-c765-45fa-bada-0fdf3efec3f7;|Unable to set character encoding UTF-8 because request parameters have already been read, or ServletRequest.getReader() has been called|#]

What's different now is this error is occuring on what seems like every page transition.  I'm wondering if it's something we've done at this end, given we have our own custom build.  We have modified the web.xml as per my other post, the konakart.properties to refer to our own database, added some product images. 

- Clinton

julie

Hi Clinton,

You could try commenting the line in com/konakart/forms/BaseForm.java that sets the character encoding to UTF-8 on the HttpServletRequest object and see whether the warning goes away. I imagine that it won't change the functionality until you attempt to enter non western characters in a form.

Regards,

Julie

clinton

Thankyou Julie,
commenting out this block in Baseform.java got rid of the warning message:

/* try {
            request.setCharacterEncoding("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
*/
Cheers,
  Clinton