Wednesday, April 16, 2008

ClassNotFoundException: some utility class

Colleague of mine came up to me with a problem.  He was getting a ClassNotFoundException being thrown for some class in WebSphere.  However, the class curam.foo.util.MyUtil is there, and it works on development.  So what's wrong?

Well the default .classpath that comes with Curam just includes everything in custom/source.  However, when the build scripts build implementation.jar, it only includes files that are in the impl package. So to fix this you need to move it to curam.foo.util.impl.MyUtil.

To prevent it in the future, you should modify the classpath so the inclusion pattern for custom/source only includes files in these folders.  This will cause the developer's local builds to fail early in the game rather than later in deployment.

 image

0 comments: