Topic
  • 3 replies
  • Latest Post - ‏2010-03-22T16:59:14Z by anilkonduru
SystemAdmin
SystemAdmin
1525 Posts

Pinned topic Attempt to run Derby UI and get "could not find main class"

‏2008-02-18T19:07:26Z |
Hi,

I was following the tutorial to build a web application with eclipse, wtp, and derby (http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0509cline/?ca=dgr-lnxw09WebApps).. I get a strange error trying to connect to apache derby UI plugin. When I right click the WTP project and attempt to start derby network server, a JVM launcher error window appears that displays the error "could not find the main class" and after click ok the console has this message:

java.lang.NoClassDefFoundError: and
Caused by: java.lang.ClassNotFoundException: and
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
Exception in thread "main"

I use Eclipse 3.3.1.1 with org.apache.derby.core_10.3.2 and org.apache.derby.ui_1.1.1.
Any help will be appreciated. :)

Thank you,
Irene
Updated on 2010-03-22T16:59:14Z at 2010-03-22T16:59:14Z by anilkonduru
  • Stan
    Stan
    267 Posts

    Re: Attempt to run Derby UI and get "could not find main class"

    ‏2008-02-18T22:23:07Z  
    Hi Irene -

    This is really an odd exception. It almost looks like comment text or a type-O is attempting to be executed. The Exception indicates it is trying to execute the java class 'and'

    Caused by: java.lang.ClassNotFoundException: and

    The driver class needed to launch the network server is ' org.apache.derby.jdbc.ClientDriver '
    Check to see if somewhere in your configuration the word 'and' appears where the driver class name should be.

    Were you successful in adding the Derby nature to your project? I believe this is where Main() resides and this too seems to be a problem.
    Are you right clicking on your project and selecting Apache Derby > Start Derby Network Server when the exception is thrown?
  • SystemAdmin
    SystemAdmin
    1525 Posts

    Re: Attempt to run Derby UI and get "could not find main class"

    ‏2008-02-19T17:48:53Z  
    • Stan
    • ‏2008-02-18T22:23:07Z
    Hi Irene -

    This is really an odd exception. It almost looks like comment text or a type-O is attempting to be executed. The Exception indicates it is trying to execute the java class 'and'

    Caused by: java.lang.ClassNotFoundException: and

    The driver class needed to launch the network server is ' org.apache.derby.jdbc.ClientDriver '
    Check to see if somewhere in your configuration the word 'and' appears where the driver class name should be.

    Were you successful in adding the Derby nature to your project? I believe this is where Main() resides and this too seems to be a problem.
    Are you right clicking on your project and selecting Apache Derby > Start Derby Network Server when the exception is thrown?
    Hi Stan,

    Thank you for replying. I was successful adding the Derby nature and I could also run the sysinfo which gave me the following info. Everything looked ok. I tried to run the server on a different project much smaller and the Derby server will run successfully.<hr />
    Java Information<hr />
    Java Version: 1.6.0_04
    Java Vendor: Sun Microsystems Inc.
    Java home: C:\Program Files\Java\jdk1.6.0_04\jre
    Java classpath: C:\Documents and Settings\imp\workspace\LowFareAir\build\classes;C:\sfw\apache-tomcat\lib\annotations-api.jar;..etc
    OS name: Windows 2000
    OS architecture: x86
    OS version: 5.0
    Java user name: imp
    Java user home: C:\Documents and Settings\imp
    Java user dir: C:\Documents and Settings\imp\workspace\LowFareAir
    java.specification.name: Java Platform API Specification
    java.specification.version: 1.6
    <hr />
    Derby Information<hr />
    JRE - JDBC: Java SE 6 - JDBC 4.0
    C:\eclipse\plugins\org.apache.derby.core_10.3.2\derby.jar 10.3.2.1 - (599110)
    C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbytools.jar 10.3.2.1 - (599110)
    C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbynet.jar 10.3.2.1 - (599110)
    C:\Documents and Settings\imp\workspace\LowFareAir\WebContent\WEB-INF\lib\derbyclient.jar 10.3.2.1 - (599110)
    C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbyclient.jar 10.3.2.1 - (599110)
    <hr />
    <hr />
    Locale Information<hr />
    <hr />

    However, you said the magic word "and" which I didn't pay much attention at the beginning. So, I checked everything that the tutorial depicted and I had everything setup correctly. I realize the only "and" word that I could see it was on my "Documents and Settings" path under "derby.system.home" where 'airlinesDB' is. I was not sure why but I put quotes around the path just to check it out. Finally, it works!!! Of course I am surprised that it had problem with the path but now I know.

    Thank you so much. :)
    Irene
  • anilkonduru
    anilkonduru
    1 Post

    Re: Attempt to run Derby UI and get "could not find main class"

    ‏2010-03-22T16:59:14Z  
    Hi Stan,

    Thank you for replying. I was successful adding the Derby nature and I could also run the sysinfo which gave me the following info. Everything looked ok. I tried to run the server on a different project much smaller and the Derby server will run successfully.<hr />
    Java Information<hr />
    Java Version: 1.6.0_04
    Java Vendor: Sun Microsystems Inc.
    Java home: C:\Program Files\Java\jdk1.6.0_04\jre
    Java classpath: C:\Documents and Settings\imp\workspace\LowFareAir\build\classes;C:\sfw\apache-tomcat\lib\annotations-api.jar;..etc
    OS name: Windows 2000
    OS architecture: x86
    OS version: 5.0
    Java user name: imp
    Java user home: C:\Documents and Settings\imp
    Java user dir: C:\Documents and Settings\imp\workspace\LowFareAir
    java.specification.name: Java Platform API Specification
    java.specification.version: 1.6
    <hr />
    Derby Information<hr />
    JRE - JDBC: Java SE 6 - JDBC 4.0
    C:\eclipse\plugins\org.apache.derby.core_10.3.2\derby.jar 10.3.2.1 - (599110)
    C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbytools.jar 10.3.2.1 - (599110)
    C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbynet.jar 10.3.2.1 - (599110)
    C:\Documents and Settings\imp\workspace\LowFareAir\WebContent\WEB-INF\lib\derbyclient.jar 10.3.2.1 - (599110)
    C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbyclient.jar 10.3.2.1 - (599110)
    <hr />
    <hr />
    Locale Information<hr />
    <hr />

    However, you said the magic word "and" which I didn't pay much attention at the beginning. So, I checked everything that the tutorial depicted and I had everything setup correctly. I realize the only "and" word that I could see it was on my "Documents and Settings" path under "derby.system.home" where 'airlinesDB' is. I was not sure why but I put quotes around the path just to check it out. Finally, it works!!! Of course I am surprised that it had problem with the path but now I know.

    Thank you so much. :)
    Irene
    you are brilliant...it helped me..thank alot.