Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Axis error: java.io.FileNotFoundException

 
mani jonsson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch Mani,

Please check your private messages.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic