Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

my app client doesnt see my queuefactory via jndi

 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, more like #a. Ill research further. i appreciate it.
 
Jesus Angeles
Ranch Hand
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to this article. The concept is applicable to any application server.
Lookup Mechanism
 
rajeev rana
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On all of those lookups I mentioned, I use the java:comp/env.
 
rajeev rana
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2068
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic