You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thangavel Sankaranarayanan <ts...@in.ibm.com> on 2008/10/14 14:02:12 UTC

NoclassDefFoundError!!

Hi All,

I have compiled a class which resides in a package inside tomcat's
application ase (i.e classes directory) in a package called admintool
It is a standalone(static void main() )  and i have compiled and  placed
over here.The reason for placing here is i am interested in using some of
the classfiles of one application which is already deploted in the
application.
So i have placed here.I am getting NOCLASSDEFFOUND ERROR,inspite of setting
the classpath to it!!

Please any one can help me on this?


D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes\admintool>java
-classpath
D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes\admintool;.;
CSVParser
Exception in thread "main" java.lang.NoClassDefFoundError: CSVParser (wrong
name: admintool/CSVParser)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes\admintool>java
CSVParser
Exception in thread "main" java.lang.NoClassDefFoundError: CSVParser

D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes\admintool>cd ..

D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes>java CSVParser
Exception in thread "main" java.lang.NoClassDefFoundError: CSVParser

D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes>java ERS
Exception in thread "main" java.lang.NoClassDefFoundError: ERS

D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes>java ERS
Exception in thread "main" java.lang.NoClassDefFoundError: ERS

D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes>java CSVParser
Exception in thread "main" java.lang.NoClassDefFoundError: CSVParser

Regards,
Thangavel Sankaranarayanan
_____________________________________
Web and Cust Care – Vodafone ANZ
IBM India Pvt Ltd,
Block D3, Manyata Embassy Business Park,
Outer Ring Road, Rachenahalli, Nagawara,
Bengalooru 560045.
Mobile : 91 - 99161-43566
Desk : 91 - 80 - 280 62049
Email : tsankara@in.ibm.com
_____________________________________

Re: NoclassDefFoundError!!

Posted by Konstantin Kolinko <kn...@gmail.com>.
2008/10/14 Thangavel Sankaranarayanan <ts...@in.ibm.com>:
>
> I have compiled a class which resides in a package inside tomcat's
> application ase (i.e classes directory) in a package called admintool
> It is a standalone(static void main() )  and i have compiled and  placed
> over here.The reason for placing here is i am interested in using some of
> the classfiles of one application which is already deploted in the
> application.
> So i have placed here.I am getting NOCLASSDEFFOUND ERROR,inspite of setting
> the classpath to it!!
>
> Please any one can help me on this?
>

As far as I understand your description, both classpath and classname
that you are trying are wrong.

When running java, the classname argument should be the full name
of the class, i.e. including its package, and classpath should point to
the root of the package hierarchy.

Try the following:

D:\Products\Tomcat_4.1_004\webapps\SAM_MPP\WEB-INF\classes>java
 -classpath . admintool.CSVParser

Also, if you are not the only java developer there, try asking your
colleagues for help.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org