aspose file tools*
The moose likes Web Services and the fly likes deploying web service(windows) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "deploying web service(windows)" Watch "deploying web service(windows)" New topic
Author

deploying web service(windows)

sam barker
Ranch Hand

Joined: Apr 26, 2008
Posts: 37
Hi,
I am trying to deploy a webservice.
I have setup the tomcat and axis.
I have a web service called test.jws
When I put the URL
http://localhost:8080/axis/test.jws
I get the message
There is a Web Service here Click to see the WSDL.

Then I created enviroment variables for the axis class path, etc.

When I tried to run the client,
I get the error
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis>java TestCient -p8080 GetResult 2 3
Exception in thread "main" java.lang.NoClassDefFoundError: TestClient

I think it might be a problem with the environment variable but everything seems to be fine.

AXIS_HOME=C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis
AXIS_LIB=%AXIS_HOME%\WEB-INF\lib
AXISCLASSPATH=%AXIS_LIB%\axis.jar;%AXIS_LIB%\commons-discovery.jar;%AXIS_LIB%\commons-logging.jar;%AXIS_LIB%\jaxrpc.jar;%AXIS_LIB%\saaj.jar;%AXIS_LIB%\log4j-1.2.8.jar;%AXIS_LIB%\xml-apis.jar;%AXIS_LIB%\xercesImpl.jar

Please tell me what I am doing wrong.
Cheers,
Sam
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
You don't really have the TestClient class in the webapps\axis directory, do you?

If you do, put the current directory into the classpath, like so:

java -classpath .;%AXISCLASSPATH% TestCient -p8080 GetResult 2 3


Ping & DNS - my free Android networking tools app
sam barker
Ranch Hand

Joined: Apr 26, 2008
Posts: 37
Hi,
I have placed the ClientTest in the axis folder.
When I included it in the class path
I gt the error
C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis>java -classpath .;%AXISCLASSPATH% HotelClient -p8080 getQuote 1 2
Exception in thread "main" java.lang.NoClassDefFoundError: Files/Apache


Thats weird..
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
Classpaths that contain spaces are a bit of a problem. Either rename the directories not to contain spaces, or enclose the problematic path entries with double quotes, like

AXISCLASSPATH="%AXIS_LIB%\axis.jar";"%AXIS_LIB%\commons-discovery.jar";...
sam barker
Ranch Hand

Joined: Apr 26, 2008
Posts: 37
I have changed the AXISCLASSPATH to
"%AXIS_LIB%\axis.jar";"%AXIS_LIB%\commons-discovery.jar";"%AXIS_LIB%\commons-logging.jar";"%AXIS_LIB%\jaxrpc.jar";"%AXIS_LIB%\saaj.jar";"%AXIS_LIB%\log4j-1.2.8.jar";"%AXIS_LIB%\xml-apis.jar";"%AXIS_LIB%\xercesImpl.jar"

but when i run the command..I still get the error
Exception in thread "main" java.lang.NoClassDefFoundError: HotelClient
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
So it's called "HotelClient" now? What's the full command you're entering on the command line?
sam barker
Ranch Hand

Joined: Apr 26, 2008
Posts: 37
sorry about that.I had found another program and I was testing that.
the command is

C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis>java -classpath .;"%AXISCLASSPATH%" TestClient -p8080 getQuote 1 2
sam barker
Ranch Hand

Joined: Apr 26, 2008
Posts: 37
Finally got something working.
But still I am getting an exception when I run the client.Now I am using exmaple from the javaranch tutorial

http://www.javaranch.com/journal/2002/05/axis.html

When I run the client I get the error

c:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\axis>java -classpath %AXISCLASSPATH%;. HelloClient -p8080 barker
log4j:WARN No appenders could be found for logger (org.apache.axis.i18n.ProjectR
esourceBundle).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/wsdl/OperationT
ype
at org.apache.axis.description.OperationDesc.<clinit>(OperationDesc.java
:59)
at org.apache.axis.client.Call.addParameter(Call.java:968)
at org.apache.axis.client.Call.addParameter(Call.java:1003)
at HelloClient.main(HelloClient.java:30)

Where am I going wrong?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42592
    
  65
It seems that you're missing one of the jar files that comes with Axis 1, namely wsdl4j-1.5.1.jar (it may have a different version number if you're not using Axis 1.4).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deploying web service(windows)