Solved

Fedora+Tomcat+MySQL java.io.CharConversionException

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
java cyclic graphs 15 194
issue with pdf generation 2 78
getting Http 404 error in jsp forms 8 72
main method of string class 3 82
Is your company's data protection keeping pace with virtualization? Here are 7 dynamic ways to adapt to rapid breakthroughs in technology.
We have come a long way with backup and data protection — from backing up to floppies, external drives, CDs, Blu-ray, flash drives, SSD drives, and now to the cloud.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

18 Experts available now in Live!

Get 1:1 Help Now