Hi

I have created an java application and run successfully on windows . but when I tried this on Linux machine (ubuntu 2.6.28-16-generic ), it is not connecting to database.

java version on the Linux was

$ java -version

java version "1.5.0"
gij (GNU libgcj) version 4.3.3

but I have run the command :

$ sudo apt-get install sun-java5-jdk

$ sudo update-java-alternatives -s java-1.5.0-sun

$ java -version

java version "1.5.0_19"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02)
Java HotSpot(TM) Client VM (build 1.5.0_19-b02, mixed mode, sharing)



Please help.



Server details on Linux machine is:

Tomcat Version JVM Version JVM Vendor OS Name OS Version OS Architecture
Apache Tomcat/6.0.18 1.5.0 Free Software Foundation, Inc. Linux 2.6.28-16-generic i38

And the error message is:

Internal error. The administrator was notified of the error, please try again later.com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection refused STACKTRACE: java.net.ConnectException: Connection refused at gnu.java.net.PlainSocketImpl.connect(libgcj.so.90) at java.net.Socket.connect(libgcj.so.90) at java.net.Socket.connect(libgcj.so.90) at java.net.Socket.(libgcj.so.90) at java.net.Socket.(libgcj.so.90) at com.mysql.jdbc.StandardSocketFactory.connect(Stand ardSocketFactory.java:256) at com.mysql.jdbc.MysqlIO.(MysqlIO.java:271) at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:2744) at com.mysql.jdbc.Connection.(Connection.java:1553) at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:285) at java.sql.DriverManager.getConnection(libgcj.so.90) at java.sql.DriverManager.getConnection(libgcj.so.90) at com.eplanet.sam.dao.BaseDAO.getConnection(BaseDAO. java:52) at com.eplanet.sam.dao.UserDAO.login(UserDAO.java:22) at com.eplanet.sam.servlets.LoginServlet.doPost(Login Servlet.java:46) at javax.servlet.http.HttpServlet.service(HttpServlet .java:637) at javax.servlet.http.HttpServlet.service(HttpServlet .java:717) at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:12 at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:845) at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447) at java.lang.Thread.run(libgcj.so.90) ** END NESTED EXCEPTION ** Last packet sent to the server was 12 ms ago.




Please suggest

Regards,
Ajit