Avatar billede jadirir Nybegynder
24. juli 2005 - 15:42 Der er 12 kommentarer

Axis on Apache tomcat

Hi all
Does any of you please help me to solv the following problem:
I have an apache tomcat with Axis enabled service. I would like to use a webservice with SAOP. I published a java file with a method. This java file uses some other java/class files.
If I call just the published method the application works perfect, but the problem is when I try to make an instant of the used class (java.lang.NullPointerException).
The question is where to place these files and how to tell the application (service) to call these files (in wsdd or wsdl or what)?.
Avatar billede arne_v Ekspert
24. juli 2005 - 15:49 #1
A web service deployed in Axis is just like all other Java web apps.

Code should be in:

webapps\nameofyourwebapp\WEB-INF\classes\nameofyourpackage\NameOfYourClass.class

or

webapps\nameofyourwebapp\WEB-INF\lib\nameofyourlibrary.jar
Avatar billede jadirir Nybegynder
24. juli 2005 - 17:39 #2
In Axis the method that will be deployed should be implemented in the MyapplicationSoapBindingImpl class, which has been generated from the WSDL file (at least as I understand).
All my classes files are placed in the mentioned path, but still they are not accesable.
I think I have to mention some where in the deploy.wsdd file or in the command that I generate the WSDL file:
java org.apache.axis.wsdl.Java2WSDL -o mywsdlfile.wsdl -l "http://localhost:8080/axis/services/Myapp" -P "Myapp" mypackage.DeployClassFile
Avatar billede arne_v Ekspert
24. juli 2005 - 17:55 #3
deployment should be OK since you say it works without using this utility class

difficult to say what the problem is without more info

a code fragment where the object gets created and where you get the NullPointerException
maybe
Avatar billede jadirir Nybegynder
24. juli 2005 - 19:16 #4
While generating the WSDL file needs to use -e flag to list all classes of the webservice.
But it doesnot work!!!.
Any other solution?????
Avatar billede arne_v Ekspert
24. juli 2005 - 19:51 #5
why are you generating the WSDL instead of letting Axis do it ?
Avatar billede jadirir Nybegynder
24. juli 2005 - 20:04 #6
Avatar billede arne_v Ekspert
24. juli 2005 - 20:19 #7
do you understand danish ?
Avatar billede arne_v Ekspert
24. juli 2005 - 20:19 #8
I think that Orion documentation is a rather compplicatde way of doing things.
Avatar billede jadirir Nybegynder
24. juli 2005 - 20:25 #9
I do so to understand danish (but little).
By deploying a webservice does not make any problem, but to tell the service some other classes files, that to be used in the service.
Thanks
Avatar billede arne_v Ekspert
24. juli 2005 - 20:33 #10
there should not be any problems accessing other classes from an Axis web service

I have never had such problems

that leaves two options:

1)  it is something else in your code related to the use of that external class
    but not to finding it

2)  there are special problems due to the way you deploy, which is different to
    how I deploy

(you can read about how I do it in http://www.eksperten.dk/artikler/159)
Avatar billede jadirir Nybegynder
24. juli 2005 - 20:52 #11
The article does not explain in sequence. On the other hand it starts JWS webservice.
I generate the service and deploy with a single class (with single method). The method recieves a String as request and trails another String as responce. But the problem arises when the published method tries to generate an Object of another class in the Service. Both classes reside same path to avoid any confussion.
Hopefully the -e flag is needed while generating the WSDL file.
Thanks
Avatar billede arne_v Ekspert
26. juli 2005 - 19:33 #12
Have fun and enjoy !
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Uanset kodesprog, så giver vi dig mulighederne for at udvikle det, du behøver.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester