Hello Ralph,

Yes, ServiceLifecycle, not ServletLifecycle, sorry.
Follow the example in the URL:
1. your impl class implements javax.xml.rpc.server.ServiceLifecycle
2. implement init(Object ctx) and destroy()
3. cast ctx to ServletEndpointContext

It works for me in Axis 1.2.1 and Axis 1.3.
Search for basic mistakes: are you overwriting your impl and deploying that instead? Is the impl class in Tomcat's webapps/classes really the one you made? Do you have two versions, one in web-inf/classes and one in web-inf/lib?

IIRC, the init method will be called when the Axis servlet is activated. I believe Tomcat activates servlets at start-up time, but Servlet container implementations are allowed to do this at first access (just before the first incoming request).

There is no need to set anything in the web.xml or wsdd to make it work.

Good luck,
Dies

PS: If you really can't get it to work, send us your appl (or smaller version of it).


[EMAIL PROTECTED] wrote:
Hi,

first thanks for your help but I have still problems with this.

First I think you meant the javax.xml.rpc.server.ServiceLifecycle
and not the ServletLifecycle interface?

I tried now code like this
http://forum.java.sun.com/thread.jspa?forumID=331&threadID=621841.

The big problem is, that the init Method is never called. I am using Tomcat
5.0.28. I tried several version of Apache Axis 1.x including 1.4 Final.

This problem keeps me busy now more than 3 hours and I'm too stupid to find
a solution. That's why, please help me.

I also tried to add this class as listener in web.xml?!

In an handler class this is no problem but in a service class....

Additional hints for me?

Regards,
Ralph

-----Ursprüngliche Nachricht-----
Von: Dies Koper [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 18. Mai 2006 12:01
An: [email protected]
Betreff: Re: Path from the webapp

Hello Ralph,

Check out the JAX-RPC spec.
You can get to the servlet context by implementing the ServletLifecycle
interface in your implementation class.

Regards,
Dies

[EMAIL PROTECTED] wrote:
Hi,

I use Axis 1.4.

In the axis web app I have a directory 'update'.
In my service implementation I want to read the files in the directory.
String directory = ...;
File file = new File(directory);

The first problem is how I can get the string directory dynamically from
the
xxxServiceBindingImplementation. I have no servlet context there.
I need the directory in the form like d://tomcat/webapps/update.

Another problem:
Can I get the url from the xxxServiceBindingImplementation for instance:
http://localhost:8080/myapp?

Can anybody help me?

Thanks!

Regards,
Ralph



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to