B2B 402 Problem running Java CLIENT code as a Java Bean under Tomcat

I have converted a Java Client Service to Java Bean so I can run it from a JSP. The service works as a standard java class but when running as a bean i get this error:

java.lang.NoClassDefFoundError: com/wm/app/b2b/client/ServiceException

Any ideas? Or has anyone written a simple java bean to call webmethods B2B 4.0.2

Have you considered using DSP? It may not be an option here, I realize, but invoking a service from a “HTML” page using DSP is painfree. If you are agnostic regarding where your Web Server is located, you could use the B2B 4.0.2 instance for that function instead of JRun, for example.

If need some assistance with DSP, just ask.

Also, as a sidenote, the unified webMethods 6.0 Platform is being touted to provide full support for JSP on its hosted Web pages.

Here is my guess.
Did you import the com.wm.app.b2b.client.* package in your bean? Also make sure this package is available for your app server/JVM running your bean/standard java class during run time by adding it to the classpath.

java.lang.NoClassDefFoundError kind of errors appear when JVM loader is not able to find the associated class. You have to make sure that your JSP engine has access to com.wm.app.b2b.client.ServiceException class which I believe is a part of client.jar.

In simple Java terms it means you haven’t configured the classpath correctly.

When working with Tomcat the easiest solution to your problem is to just drop the necessary jar into …/webapps/nameofyourapp/WEB-INF/lib and it will automatically be picked up in the classpath. The previous post indicated that the necessary jar is client.jar.

Good luck and please tell us how you solved it. For the good of the rest of us.

Rgs,
Andreas
www.amundin.com

Guys - problem solved!!!

Thanks Andreas! Used your solution below…


In simple Java terms it means you haven’t configured the classpath correctly.

When working with Tomcat the easiest solution to your problem is to just drop the necessary jar into …/webapps/nameofyourapp/WEB-INF/lib and it will automatically be picked up in the classpath. The previous post indicated that the necessary jar is client.jar.