Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Fedora+Tomcat+MySQL java.io.CharConversionException

Posted on 2006-06-17
4
Medium Priority
?
1,053 Views
Last Modified: 2011-10-03
Hi, I create a database connection successfully in Window but it causes "java.io.CharConversionException" in Linux.
Do I need to correct my code or install something on my server?

Here is the detail error log:

EXCEPTION

org.apache.jasper.JasperException: Exception in JSP: /scripts/appMysqlConn.jsp:4

1: <%@ page import = "java.sql.*"%>
2: <%
3:       Class.forName("org.gjt.mm.mysql.Driver").newInstance();
4:       Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/hkc?useUnicode=true&characterEncoding=UTF-8", "user", "password");
5: %>


STACKTRACE:
      org.apache.jasper.servlet.JspServletWrapper.handleJspException(jasper5-compiler-5.5.15.jar.so)
      org.apache.jasper.servlet.JspServletWrapper.service(jasper5-compiler-5.5.15.jar.so)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(jasper5-compiler-5.5.15.jar.so)
      org.apache.jasper.servlet.JspServlet.service(jasper5-compiler-5.5.15.jar.so)
      javax.servlet.http.HttpServlet.service(tomcat5-servlet-2.4-api-5.5.15.jar.so)

ROOT CAUSE:

javax.servlet.ServletException: Error during query: Unexpected Exception: java.io.CharConversionException message given: null

Nested Stack Trace:


** BEGIN NESTED EXCEPTION **

java.io.CharConversionException

STACKTRACE:

java.io.CharConversionException
   at gnu.gcj.convert.Input_iconv.read(libgcj.so.7)
   at java.lang.String.init(libgcj.so.7)
   at java.lang.String.<init>(libgcj.so.7)
...
0
Comment
Question by:ddlam
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:pablomorales
ID: 16934455
It looks like the problem is related to the GNU gcj (Java compiler). It seems like it may not work for your application due to the use of unicode or JDK version:

http://gcc.gnu.org/onlinedocs/gcj/Limitations.html#Limitations

If you make sure that your Tomcat instance uses Sun's compiler you should not have this problem.

0
 
LVL 9

Author Comment

by:ddlam
ID: 16940073
Could you suggest any way to slove the problem?
0
 
LVL 4

Accepted Solution

by:
pablomorales earned 2000 total points
ID: 16942980
The version of Tomcat that comes with Fedora is compiled for GCJ and is compiled to native code:

http://www.webweavertech.com/costin/archives/000340.html

You will need to download Tomcat and the JDK. You can look here for the instructions:

http://tarundua.net/fc3java

Another option is to use Centos instead of Fedora.
0
 
LVL 9

Author Comment

by:ddlam
ID: 16971006
thanks a lot, It works nicely. It should be a solution for solving the fedora tomcat's limitation
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
In this article, the configuration steps in Zabbix to monitor devices via SNMP will be discussed with some real examples on Cisco Router/Switch, Catalyst Switch, NAS Synology device.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Loops Section Overview
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question