This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Services and the fly likes Axis error: java.io.FileNotFoundException    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis error: java.io.FileNotFoundException    " Watch "Axis error: java.io.FileNotFoundException    " New topic
Author

Axis error: java.io.FileNotFoundException

mani jonsson
Greenhorn

Joined: Nov 28, 2008
Posts: 2
Hi all

I am trying to compile a helloworld file (name of the file: "Service"). When I write "http://localhost:8080/axis/Service.jws" in address bar I get this error:

Fault - ; nested exception is:
java.io.FileNotFoundException: C:\Program\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\jwsClasses\Service.class

When I looked at this address, there was no Service.class there and it was on another direcory:

C:\Program\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\jwsClasses\helloWorld\Service.class

Then I tried to copy the "Service.class" to the C:\Program\Apache Software Foundation\Tomcat 5.5\webapps\axis\WEB-INF\jwsClasses\

but when i did that, I got "Page cannot be displayed" on my explorer page.

Do you have any idea that which is wrong?

Thank you in advanced
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Welcome to JavaRanch Mani,

Please check your private messages.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
The best tutorial for Axis 1.x is still Creating Web Services with Apache Axis.

However I would suggest that you familiarize yourself with a more up to date web services stack (Axis2 is already at version 1.4).

A barebones example using only Java SE 6 (Which can work with Java SE 5 with JAX-WS installed).
mani jonsson
Greenhorn

Joined: Nov 28, 2008
Posts: 2
I read that toturial, I know how to creat a web service, but i think i should set some thing, because it seems like axis is searching a wrong folder for finding the .jws file.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
The tutorial uses "http://localhost:8080/axis/Calculator.jws" from samples/userguide/sample2. If you look at Calculator.java you should notice one thing - there is no package declaration.

Axis seems to be looking for Service while the compiler creates helloworld.Service.

JWS files ...{are} ... not always the best choice
You cannot use packages in the pages

JWS (Java Web Service) Files - Instant Deployment

Important: JWS web services are intended for simple web services. You cannot use packages in the pages, and as the code is compiled at run time you can not find out about errors until after deployment. Production quality web services should use Java classes with custom deployment.
....
JWS files are great quick ways to get your classes out there as Web Services, but they're not always the best choice. For one thing, you need the source code - there might be times when you want to expose a pre-existing class on your system without source. Also, the amount of configuration you can do as to how the service gets accessed is pretty limited - you can't specify custom type mappings, or control which Handlers get invoked when people are using your service.
 
Consider Paul's rocket mass heater.
 
subject: Axis error: java.io.FileNotFoundException