wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes j2ee newbie  question about context and lookup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "j2ee newbie  question about context and lookup" Watch "j2ee newbie  question about context and lookup" New topic
Author

j2ee newbie question about context and lookup

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Ok
My problem goes deepr than what i suggest at first.
I post another mesage in sun apps section but now my problem goes general :
I have some question about context , jndi ...

1- what does "java:comp/env/" means ?
should i put the last forward slash ?
2- how i should use context and initial context etc.. ?
here is my situation :
I defined two jms resource from the admin console of Sun Apps 8.1: one factory with exact jndi name of : jms/QueueFactory
and one queue with exact name of : jms/dest/queueDestination
Now i tried to access them but i simply can not
it trows exception : javax.naming.NameNotFoundException: No object bound for java:comp/env/jms/QueueFactory
i tried and removed java:comp/env/ from my lookup string with no luck
can some one help me and tell me that :
1-when does that java:comp/env/ is required ?
2-is my following code true ? i write them in netbeans.




I think that my poblem is about the class name for initial_Context_name and provider_url
also with the lookup String.
sorry if it goes too long
raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Aha i made some changes and it works but now it gives another very long exception
the change which i made is i made a typo in QueuesFactory and put an space in its end


and the long long exception is :

I add all jars from lib folder of Application server to my project but still no luck
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: j2ee newbie question about context and lookup