views:

340

answers:

2

Most of the time , the developers will be having hard time to debug the issues related to class loading issues for the reasons like

1 . the class path might have two different jars with the same class having different version. 2. class loading issues.

Although we could use jar utility to delve into each and every jar , it is going to be extremely tedious and error prone.

Is there a tool or some mechanism to resolve this kind of issues . Though the class loading is not simple in realistic , say how the weblogic will do class loading of a particular ear file.

+2  A: 

give a try to tattletale, it works both in ant and maven:

The tool will provide you with reports that can help you

  • Identify dependencies between JAR files
  • Find missing classes from the classpath
  • Spot if a class/package is located in multiple JAR files
  • Spot if the same JAR file is located in multiple locations
  • With a list of what each JAR file requires and provides
  • Verify the SerialVersionUID of a class
  • Find similar JAR files that have different version numbers
  • Find JAR files without a version number
  • Find unused JAR archives
  • Identify sealed / signed JAR archives
  • Locate a class in a JAR file
  • Get the OSGi status of your project
  • Remove black listed API usage
dfa
surely I will try :) ... and upon first look at "tattletale" , it looks like it can show the depedence only for certain jars,if not all.
Sukhhhh
A: 

I find running Java in verbose mode quite handy for resolving class path errors.

It will show you what classes and jars are being loaded by the program.

It can be a quick first step to try fix the problem without using a debugging program.

Gordon