You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sushil Sureka <su...@hotmail.com> on 2004/09/06 15:55:03 UTC
JNDI Lookup does not work with Tomcat/Axis
Hi,
I was wondering if any of you had any success with JNDI lookup of the
Web Service deployed using Axis on Tomcat. The java spec (JSR 109) says
that the web services should be looked up using JNDI in a J2EE
environment rather than directly calling the stub classes. But I have
not had any luck in using HelloClient to connect to HelloServer deployed
on Tomcat using JNDI lookup. I can connect to it by using the generated
Locator class to locate the client stub.
Any ideas would be appreciated.
Thanks
Sushil
RE: JNDI Lookup does not work with Tomcat/Axis
Posted by to...@gsk.com.
Sushil,
I've only used JNDI once, with Tomcat, so am not too sure about the
details. I also don't have Tomcat on my machine at the moment. However,
you can define resources in the Tomcat configuration files, in terms of a
JNDI name and a class name. Tomcat will instantiate the class and bind it
to the name in its JNDI implementation. You can then get to the JNDI
initial context just by creating an initial context instance, and then you
can lookup the resource you want. You need to check out the Tomcat
documentation for more information. I think resources can be defined
globally or for a particular Web application.
Sorry, I can't say anything about your second question, unless it's
already covered in what I've said above, if the "deployment descriptor"
refers to the Web application's configuration. The Web application, in
this case, would be Axis.
Tony
"Sushil Sureka" <su...@hotmail.com>
07-Sep-2004 00:53
Please respond to axis-user@ws.apache.org
To
axis-user@ws.apache.org
cc
Subject
RE: JNDI Lookup does not work with Tomcat/Axis
Thanks Tony. I am concerned with client running in J2EE environment only.
When you say that I should be able to specify a JNDI resource that defines
a stub class, can you please explain this in more detail on how to go
about it.
Also the book says that JNDI name of the web service should be defined
(somewhere in deployment descriptor) and after that a client code that is
running in a J2EE application without any extra work. Any ideas on how to
do that?
Sushil
-----Original Message-----
From: tony.q.weddle@gsk.com [mailto:tony.q.weddle@gsk.com]
Sent: Monday, September 06, 2004 9:26 AM
To: axis-user@ws.apache.org
Subject: Re: JNDI Lookup does not work with Tomcat/Axis
I'm not too sure about using JNDI on the client side. If you are using
client code in a J2EE application, running on Tomcat, then you should be
able to specify a JNDI resource, in the Tomcat configuration, that defines
a stub class (or factory class) for your web service stub. But if your
client is not a J2EE application, I don't know how you'd locate a JNDI
service that has a binding for a stub or factory class. In this case,
stick with creating a locator instance yourself.
Tony
RE: JNDI Lookup does not work with Tomcat/Axis
Posted by Sushil Sureka <su...@hotmail.com>.
Thanks Tony. I am concerned with client running in J2EE environment
only. When you say that I should be able to specify a JNDI resource that
defines a stub class, can you please explain this in more detail on how
to go about it.
Also the book says that JNDI name of the web service should be defined
(somewhere in deployment descriptor) and after that a client code that
is running in a J2EE application without any extra work. Any ideas on
how to do that?
Sushil
-----Original Message-----
From: tony.q.weddle@gsk.com [mailto:tony.q.weddle@gsk.com]
Sent: Monday, September 06, 2004 9:26 AM
To: axis-user@ws.apache.org
Subject: Re: JNDI Lookup does not work with Tomcat/Axis
I'm not too sure about using JNDI on the client side. If you are using
client code in a J2EE application, running on Tomcat, then you should be
able to specify a JNDI resource, in the Tomcat configuration, that
defines a stub class (or factory class) for your web service stub. But
if your client is not a J2EE application, I don't know how you'd locate
a JNDI service that has a binding for a stub or factory class. In this
case, stick with creating a locator instance yourself.
Tony
Re: JNDI Lookup does not work with Tomcat/Axis
Posted by to...@gsk.com.
I'm not too sure about using JNDI on the client side. If you are using
client code in a J2EE application, running on Tomcat, then you should be
able to specify a JNDI resource, in the Tomcat configuration, that defines
a stub class (or factory class) for your web service stub. But if your
client is not a J2EE application, I don't know how you'd locate a JNDI
service that has a binding for a stub or factory class. In this case,
stick with creating a locator instance yourself.
Tony