• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

deploying web service(windows)

 
sam barker
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
sam barker
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So it's called "HotelClient" now? What's the full command you're entering on the command line?
 
sam barker
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic