aspose file tools*
The moose likes Other Open Source Projects and the fly likes Help with Castor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Help with Castor" Watch "Help with Castor" New topic
Author

Help with Castor

Sree Potluri
Ranch Hand

Joined: Aug 12, 2009
Posts: 62
Hi,

I am new to Castor. I have the example from http://onjava.com/pub/a/onjava/2001/10/24/xmldatabind.htm. When I am running the program, I get the error

java.lang.NoClassDefFoundError: javaapplication1/ReadPerson
Caused by: java.lang.ClassNotFoundException: javaapplication1.ReadPerson
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: javaapplication1.ReadPerson. Program will exit.
Exception in thread "main" Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)





Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9



It looks like you are attempting to run a class called javaapplication1.ReadPerson, but your class ReadPerson is in the default package (that is to say, named ReadPerson).


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Sree Potluri
Ranch Hand

Joined: Aug 12, 2009
Posts: 62
Thanks but the problem is I did not set the path
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

You mean classpath
Sree Potluri
Ranch Hand

Joined: Aug 12, 2009
Posts: 62
You are right JOE
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help with Castor