PDA

View Full Version : java.lang.noClassDefFoundError using <javarpc>


superkarlito
05-14-2007, 06:08 PM
I'm using javarpc to call a webservice that is using soap. I did this because there was a 64k limit to the rpc object using the <soap> tag and will instead use a workaround on chopping the returned object into multiple pcs.

My problem is I get a java.lang.noClassDefFoundError when instantiating the java class object using <javarpc>. The noclassdeffounderror happens in the constructor below (in bold)...
package tirs.test;

import java.rmi.RemoteException;

import javax.xml.rpc.ServiceException;

import com.azeus.objects.User;
import com.azeus.services.UserManager;
import com.azeus.services.UserManagerServiceLocator;

public class test {

private static User[] uUsers;

public test() throws ServiceException, RemoteException {
UserManagerServiceLocator umsl = new UserManagerServiceLocator();
UserManager um = umsl.getUserManager();
try {
System.out.println("TEST");
uUsers = um.getUsers();
System.out.println("was able to get uUsers");
} catch(Exception e) {
System.out.println(e);
}
}

public static void main(String[] args) throws ServiceException, RemoteException {
UserManagerServiceLocator umsl = new UserManagerServiceLocator();
UserManager um = umsl.getUserManager();
uUsers = um.getUsers();
}

The problem is that when I run the same thing manually (using test.main as a java application), I get no problem, the noclassdeffounderror doesn't happen. Please advise on what I can try to solve the problem.

superkarlito
05-14-2007, 10:42 PM
Btw, the error is...
java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity

superkarlito
05-15-2007, 11:16 PM
I've solved the problem. The root cause was that the version of the jar files I was using (axis.jar, commons-httpclient) were too old for the WebserviceClient I was using.

I was using lsp3.3 release, what I did was to updgrade to lps4.0. This didn't solve th e problem yet. The WebServiceClient that I was using was created using axis.jar version 1.3, lps4.0 was using axis.jar(1.2RC1 - wow, laszlo is using a release candidate). What I did was to create the webclientservices using axis.jar that was provided in LASZLO.

Just an "FYI" for those interested.