Sorry, why did I write "client"? It was late, I should have slept
before posting. This happens in the service class. I have my own
utility class, which refers to ServicesUtil, and the service class
loads that utility class. The utility class can be loaded but not
ServicesUtil, which is odd since it *is* loaded in AbstractRPCService.
I have attached a minimal yet full example that can be deployed to
reproduce the problem (I have not attached the modified services.xml 
because the mods there are obvious); the service and client classes
are in the appropriate jars (I just rebuild using ant), TestUtil in 
its own jar under WEB-INF/lib. The bottom of the stack trace is

Caused by: java.lang.NoClassDefFoundError: net/sf/basedb/ws/server/ServicesUtil
    at com.acme.TestUtil.<clinit>(
    ... 25 more
Caused by: java.lang.ClassNotFoundException:
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 27 more

There is nothing special about ServicesUtil, btw: attempting to
instantiate, say, TempFileDataSource, causes the same error. The 
chain of references is -> com.acme -> Does the detour through another package 
trigger some classloader complication?

> A good starting point is the web services example that you can 
> download from [...]

Of course I studied the built-in examples first; I don't think I
could have so much as started otherwise. Still, I want to be able
to use custom classes on the server side. Why does (apparently)
everything have to be in the package?


-- O.L.

package com.acme;


public class TestUtil {

    // just to test whether ServicesUtil can be loaded
    private static ServicesUtil util = new ServicesUtil();

    public static String process(String x) {
        return x.toUpperCase();


import net.sf.basedb.core.SessionControl;

import com.acme.TestUtil;

public class TestService extends AbstractRPCService {

    public TestService() { }

    public String getResult(String sid, String q) {
        SessionControl sc = getSessionControl(sid);
        return TestUtil.process(q);


import org.apache.axis2.AxisFault;

import com.acme.TestUtil;

public class TestClient extends AbstractRPCClient {

    private final SessionClient session;

    public TestClient(SessionClient session) {
        super(session.getUrl(), "Test", session.getServiceFactory());
        this.session = session;

    public String getResult(String q) throws AxisFault {
        String sid = session.getId();
        return invokeBlocking("getResult", String.class, sid, q);

Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
basedb-devel mailing list

Reply via email to