facebook

Can’t deploy to TomCat: java.lang.NoClassDefF:java.sql.NClob

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #313219 Reply

    AlMartindale
    Member

    Hi

    I hope someone can help. I am pretty rusty with my Java, and have been asked to get a JSP web site runing on Windows XP with MySql, which was written for Java 1.2 with Oracle running on a Unix server.

    It is going to be used as a standalone kiosk machine which will not be on the network.

    I have managed to get it running as a web project in MyEclipse 8.6 using the J2EE 1.4 Specification Level and mysql-connector-java-5.1.13-bin.jar.

    I have also got it working using J2EE 1.3 specification Level and mysql-connector-java-3.1.14bin.jar. It won’t work without J2EE 1.3 or J2EE 1.4 selected.

    But I am completely unable to get it running on TomCat outside of MyEclipse.

    The error I keep running into is:
    java.lang.NoClassDefFoundError: java/sql/NClob
    at java.lang.Class.getDeclaredMethods0(Native Method)

    I have found this post which says this only came in with Java 1.6:
    http://groups.google.com/group/xerial/browse_thread/thread/d67b83ced1120f05

    I have tried several versions of TomCat (standalone versions 5.5, version 4.1 and the latest version that comes as an XAMPP extension 6.02), and I have tried these installations with Java 1.4.2 installed and with Java 1.6 installed.

    My latest tests were on
    Apache Tomcat/4.1.40
    Java 1.4.2_09-b05 Sun Microsystems Inc.
    Windows XP 5.1 x86
    mysql-connector-java-3.1.14bin.jar

    Is there a way I can use the combination of Java, Tomcat and classes that MyEclipse is using without running MyEclipse?

    Could I compile the JDBC connector myself to avoid the issue?

    Please, any ideas on how to solve this would be really, realy welcome.

    Thanks
    Al

    #313238 Reply

    support-swapna
    Moderator

    AlMartindale,

    I suspect this error is purely related to environmental variables/Java version Incompatibility. Please check the JRE version on the Tomcat.

    Is there a way I can use the combination of Java, Tomcat and classes that MyEclipse is using without running MyEclipse?

    You can create a .war file from MyEclipse and copy it to Tomcat webapps directory. Start the server and you should be able to run the application.

    #313241 Reply

    AlMartindale
    Member

    Thanks for your help.

    I don’t think it was because it wasn’t packaged up as a WAR, but I found a work around in the end.

    The TomCat extension that comes with Xampp has its own Java runtime.
    So I copied the JRE folder from the Eclipse installation to the Xampp installation:
    C:\xampp\tomcat\jre\

    I had already put the mysql-connector-java-5.1.13-bin.jar JDBC driver and the J2EE 1.4 jar files in the lib directory of the web application:
    C:\xampp\tomcat\webapps\ict\WEB-INF\lib (where ict is the application name)

    I guesss these could also go in the C:\xampp\tomcat\lib folder, but it is working now so I’m not going to tinker any more

    All the best
    Al

    #313257 Reply

    support-swapna
    Moderator

    AlMartindale,

    Glad to know that it is working.
    Do let us know if you have any issues.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Can’t deploy to TomCat: java.lang.NoClassDefF:java.sql.NClob

You must be logged in to post in the forum log in