views:

19

answers:

0

I am using the Axis plug-in for Eclipse to generate the client classes for calling a web service written in C#. The following class files are being generated:

org.tempuri.Data
org.tempuri.Service1
org.tempuri.Service1Locator
org.tempuri.Service1Soap
org.tempuri.Service1Soap12Stub
org.tempuri.Service1SoapProxy
org.tempuri.Service1SoapStub

The classes are being packaged in a JAR which is itself in a WAR and deployed on a Tomcat server. I have a Java servlet which is going to perform the web service call. The servlet exists in the same WAR. I do the import in my servlet so I can create the proxy class:

import org.tempuri.Service1SoapProxy

The servlet compiles as long as the import is there. The problem comes when I call the servlet and it tries to instantiate the class; Service1SoapProxy begins instantiating just fine but it in turn instantiates Service1Locator and that's when I get this error in the Tomcat logs:

java.lang.NoClassDefFoundError: org/tempuri/Service1Locator

They're in the exact same package (org.tempuri) and are all being deployed. I'm stuck because as far as I can tell if I can instantiate one class in that package, I should be able to instantiate any class in that package. I haven't tampered with any of the auto-generated code.

Update:

On a whim I tried copying the class files into the WAR in addition to placing them in a JAR in the WAR and it began working. I then removed them and it kept on working. I know I'm actually replacing the WAR and JAR with new versions as I deploy because I've been changing other code all along and those changes have been showing up. I'm still nervous this will happen again when I go to deploy on a different environment so I'm still looking for any insight anyone might have.