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

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

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

I was following the tutorial to build a web application with eclipse, wtp, and derby ( 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 Method)
at java.lang.ClassLoader.loadClass(
at sun.misc.Launcher$AppClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
Exception in thread "main"

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

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

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

    ‏2008-02-18T22:23:07Z  in response to SystemAdmin
    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
      1525 Posts

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

      ‏2008-02-19T17:48:53Z  in response to Stan
      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 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 - (599110)
      C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbytools.jar - (599110)
      C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbynet.jar - (599110)
      C:\Documents and Settings\imp\workspace\LowFareAir\WebContent\WEB-INF\lib\derbyclient.jar - (599110)
      C:\eclipse\plugins\org.apache.derby.core_10.3.2\derbyclient.jar - (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. :)
      • anilkonduru
        1 Post

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

        ‏2010-03-22T16:59:14Z  in response to SystemAdmin
        you are helped me..thank alot.