Hello,
I'm running
Tomcat 5 and using OpenJDK Runtime Environment (IcedTea6 1.7.10) (rhel-1.21.b17.el5-x86_64) OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode) on CentOS and recently came across one weird problem that I suspect is a JDK bug.
When I read from a mysql database, a field called randomid that is made up of a series of random characters (lower case letters, uppercase letters and numbers) such as SRM1iq1 or FRG6rx2 or XGC6gs7
I get
SEVERE: Servlet.service() for
servlet jsp threw exception
java.io.CharConversionException
at gnu.gcj.convert.Input_iconv.read(libgcj.so.7rh)
at java.lang.String.init(libgcj.so.7rh)
at java.lang.String.<init>(libgcj.so.7rh)
at com.mysql.jdbc.SingleByteCharsetConverter.<init>(SingleByteCharsetConverter.java:153)
at com.mysql.jdbc.SingleByteCharsetConverter.initCharset(SingleByteCharsetConverter.java:108)
at com.mysql.jdbc.SingleByteCharsetConverter.getInstance(SingleByteCharsetConverter.java:86)
at com.mysql.jdbc.ConnectionImpl.getCharsetConverter(ConnectionImpl.java:2767)
at com.mysql.jdbc.ResultSetRow.getString(ResultSetRow.java:754)
at com.mysql.jdbc.ByteArrayRow.getString(ByteArrayRow.java:67)
at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5557)
at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5434)
at org.apache.jsp.main_jsp._jspService(main_jsp.java:1160)
at org.apache.jasper.runtime.HttpJspBase.service(jasper5-runtime-5.5.23.jar.so)
at javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.23.jar.so)
at org.apache.jasper.servlet.JspServletWrapper.service(jasper5-compiler-5.5.23.jar.so)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(jasper5-compiler-5.5.23.jar.so)
at org.apache.jasper.servlet.JspServlet.service(jasper5-compiler-5.5.23.jar.so)
at javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.23.jar.so)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(catalina-5.5.23.jar.so)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(catalina-5.5.23.jar.so)
at org.apache.catalina.core.StandardWrapperValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.core.StandardContextValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.core.StandardHostValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.valves.ErrorReportValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.core.StandardEngineValve.invoke(catalina-5.5.23.jar.so)
at org.apache.catalina.connector.CoyoteAdapter.service(catalina-5.5.23.jar.so)
at org.apache.coyote.http11.Http11Processor.process(tomcat-http-5.5.23.jar.so)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(tomcat-http-5.5.23.jar.so)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(tomcat-util-5.5.23.jar.so)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(tomcat-util-5.5.23.jar.so)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(tomcat-util-5.5.23.jar.so)
at java.lang.Thread.run(libgcj.so.7rh)
Works perfectly on the development machine that is running Tomcat5 and a different version of JDK 6. The easy way out would be changing the JDK, but being a live running server, I'd rather think of something else.
Any ideas of how to maybe go around this problem (besides changing the random id?)
Thanks a bunch
Will