How can I access webMethods classes from my own jar?

We have an existing jar file, lets call it myclasses.jar. Although we’re writing some new code to interact with webMethods 6.0, we’d like to re-use a lot of our existing code in myclasses.jar.

So in myclasses.jar, I have some code that tries to return a SystemException (i.e. com.wm.app.b2b.server.ServiceException). I have myclasses.jar on CLASSPATH and the code compiles fine within Developer.

However, at run-time (on the Integration Server) I get a NoClassDefFound exception within myclasses.jar on the line where it tries to return the ServiceException.

It seems that myclasses.jar can’t ‘see’ client.jar or server.jar, which are not on the CLASSPATH but ARE on the Server Classpath. Moving these jars onto the CLASSPATH causes a number of webMethods exceptions that prevent the Integration Server from even starting (I think they have the same problem ‘seeing’ their own classes). Moving myclasses.jar onto the server classpath has no effect (I guess the server still finds the one on CLASSPATH first).

What should the correct approach be to accessing webMethods classes from myclasses.jar?

Put your jar into IntegrationServer/packages/myPackage/code/jars. At runtime it will then be able to see:
4. all classes in myPackage/code/classes and myPackage/code/jars.
3. everything in all packages that myPackage has package dependencies on.
2. everything on server classpath.

  1. everything on application classpath.

HTH,
Fred