Ezombort
Ezombort

Reputation: 1922

Java Axis web service project dependency not found

I have an Axis (1.4) web service (running on Tomcat 6.0.20) that is working fine until I try to use any class from another project.

I have my web service project and another project containing business logic. I have added the business logic project as a project dependency/reference in my web service project.

package MyProject.services;
import BusinessLogic.Core.TestClass;

    public class MyServiceImpl implements MyProject.services.MyServiceImpl_PortType {

    public java.lang.String getServerStatus() throws java.rmi.RemoteException {
             //BusinessLogic.Core.TestClass core = new BusinessLogic.Core.TestClass();
             return "This is working fine!";
    }
}

When I invoke the method above, everything works fine. However, if I uncomment the line in getServerStatus(), I get a NoClassDefFoundException.

The code is ofcourse compiling fine and as far as I can see i have added all dependencies. The TestClass has only a constructor that prints "Hello" and has no other dependencies.

I'm relatively new to java web services so it is probably just a stupid mistake I have made. Do you have any ideàs?

Upvotes: 2

Views: 836

Answers (3)

You say you have them in different projects. If this means WAR-files/folders inside Tomcat, then your problem could be that one web application cannot see any other web application directly (including classpath).

If not, then edit your question to be very specific about what you see and what you expect.

Upvotes: 2

Shawn Vader
Shawn Vader

Reputation: 12385

This is not an answer to your question but you can use this free soapui

to look at the wsdl that is produced and call methods on the service. This means that you can test your service without compiling and deploying the stubs to a second test client (which you will have to do at a later stage)

Hope this helps

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1502835

You haven't said how you're building and deploying this. Is TestClass in a jar file somewhere? If so, where is the jar file in the deployed system, and how are your web service classes deployed?

Upvotes: 1

Related Questions