I have a very simple and light weight web application which lookup resources using InitialContext etc etc on runtime (User input the CxFactory, Queue names etc and my application lookup these resources and uses them), but this is only possible on jBoss because WebLogic and WebSphere won't allow lookups until unless I map them using my deployment descriptor and this way I have to hard code the resources names. How can I achieve dynamic lookup without using deployment descriptors? Using any framework like Spring?
I am looking for some example or tutorial which can explain this?
Can you please explain little more what exactly your application does or your requirement is? Because when you say your application need to lookup resources at runtime, and when use intialcontext.lookup() it is at runtime only. So if you have bound any resources to initial context before perform lookup you should be able to lookup at runtime with specified properties. If resources are not bound then no server will return lookup results. Let me know if anything is misunderstood by me.
Actually I have developed a small web based utility which takes Cx Factories, JMS Queues etc etc JNDI names as input from user and lookup on runtime to verify that it exist or not. Now jBoss allow you to dynamically lookup resources by passing 'java:comp/env/....' as JNDI to initialContext.lookup() but now I want to make my application compatible with WebSphere and WebLogic application servers which does not allow lookup (access to the resources which are not mapped at the time of deployment) without mapping resources via deployment descriptors. As you know user can input any name as JNDI, so I can not have deployment descriptor but some other mechanism to enable my application to access the resources. I heard If I use Spring framework than it might help.
I hope it make any sense. Let me know if you need more information.