aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes my app client doesnt see my queuefactory via jndi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "my app client doesnt see my queuefactory via jndi" Watch "my app client doesnt see my queuefactory via jndi" New topic
Author

my app client doesnt see my queuefactory via jndi

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2061
hello,

my servlet on the same server, easily found the queuefactory, as they are on same server.

but using an application client, i am unable to. this is even after i created the resource reference in the application client descriptor.

any help?

(i am using wsad. i have an mdb and an app client project)
rajeev rana
Greenhorn

Joined: Dec 30, 2004
Posts: 5
Jesus,
as you mentioned the servlet in same server is fetching the queue factory correctly...2 things you should cross check are
(a) you are providing proper provider url, context factory etc.. details to get the InitialContext() from your application client
(b) The JNDI name you are looking up with...

Fundamentaly these can be the possible cause for the problem...
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2061
thanks, more like #a. Ill research further. i appreciate it.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2061
rajeev, can u direct me to a website with samples doing that lookup via url. or u can post a sample look up here
Eddy Lee Sin Ti
Ranch Hand

Joined: Oct 06, 2005
Posts: 135
Refer to this article. The concept is applicable to any application server.
Lookup Mechanism


SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
rajeev rana
Greenhorn

Joined: Dec 30, 2004
Posts: 5
jesus the above link by Eddy explains conceptually everything related to JNDI lookup, To get more precise solution you need to tell what application server you are using?
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2061
Quite simple.

I am doing everything inside wsad 5.1.

All in one enterprise project, I have an EJB module (MDB using a queue, and a session bean) and an application client module.

I run the client using the wsad Run/Launch.

The client easily finds the session bean.

Also, the session bean easily finds(the queue factory), and sends messages, to the MDB.

But the client fails to find the queue factory(via jndi).
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2061
On all of those lookups I mentioned, I use the java:comp/env.
rajeev rana
Greenhorn

Joined: Dec 30, 2004
Posts: 5
private InitialContext getInitContext() throws NamingException
{
InitialContext _initialContext = null;

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, com.ibm.websphere.naming.WsnInitialContextFactory");
env.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
String NAME_SYNTAX = "com.ibm.websphere.naming.name.syntax";
String NAME_SYNTAX_JNDI = "jndi";
env.put(NAME_SYNTAX, NAME_SYNTAX_JNDI);
_initialContext = new InitialContext(env);

return _initialContext;
}


Important: for JNDI runtime errors.
You must add the required JNDI run-time support JARs to your build and run-time classpath:
Right-click the JMSadderExecute project, then click Properties => Java build path.
Click the Libraries tab and click Add External JARs to add the WebSphere Application Server run-time library JARs namingclient.jar, messagingImpl.jar and the WAS_V5_IMPL_FACTORY_PROP CLASSPATH_VARIABLE.

Find the whole stuff at the followoing links, The pages are really lengthy ones

http://www-128.ibm.com/developerworks/websphere/library/techarticles/0201_cox/cox.html

just extract out the JMS and JNDI stuff from

http://www-128.ibm.com/developerworks/websphere/library/techarticles/0403_searle/0403_searle5.html#jndiCommands
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2061
thanks
 
jQuery in Action, 2nd edition
 
subject: my app client doesnt see my queuefactory via jndi