Solved

Fedora+Tomcat+MySQL java.io.CharConversionException

Posted on 2006-06-17
4
1,034 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet cookie finding by name 1 90
how to add new optional parameter to JSP 1 55
going to wrong jsp page 2 50
spring maven example issues 3 44
Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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