all friends i have an ejb deployed on weblogic 8.1 now how do i call this ejbs from my tomcat i am trying to follow the below code but its not working Properties prop=new Properties(); prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); prop.put(Context.PROVIDER_URL,"t3://localhost:7001"); Context ctx=new InitialContext(prop); Object ref=ctx.lookup("OrderManagement1"); System.out.println(" look up done"); orderManagementHome home=(orderManagementHome)javax.rmi.PortableRemoteObject.narrow(ref,orderManagementHome.class); orderManagement1 orderManagement=home.create(); orderManagement.placeOrder("Cedric","J2EE server programming",1000); orderManagement.add("recepient","message");
Where is the code breaking? Try to test each step you made about discovering the bean (test against null). My first guess is that the lookup fails, so the JNDI name of the bean is not the one you use for retrieval.
i am able to access ejb from tomcat when they are on the same machine. the moment i try to access the same ejb from tomcat but from a different machine its states a problem in the inital context thing which is as follows