java tutorial

Frustrating NoClassDefFoundError and ClassNotFoundException in Java

NoClassDefFoundError and ClassNotFoundException are two most irritating errors in Java world.If you are getting java.lang.NoClassDefFoundError then must be there is a class which was present when you build the jar and successfully linked  but not present while you trying to run the program, to fix this problem just check whether you are overriding classpath if not then just include that class into classpath By including that class into Classpath as suggested on 3 Solution of NoClassDefFoundError in Java

On other hand ClassNotFoundException in Java is real pain when you encounter, this could be even more difficult to find out the real cause in integrated environment like J2EE where different web server use different classloaders and it can come if class is not visible to classloader.

You can also check out Difference between NoClassDefFoundError vs ClassNotFoundException to get more clarity on What these two are and how to deal with them.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s