Solved

Fedora+Tomcat+MySQL java.io.CharConversionException

Posted on 2006-06-17
4
1,026 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Facing problems with you memory card? Cannot access your memory card? All stored data, images, videos are lost? If these are your questions...than this small article might help you out in retrieving your lost or inaccessible data.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

912 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now