on 06-17-2004 6:58 PM
Hi,
I have deloyed 20 beans. One of them is Statefull and others are stateless. I am able to see in Administrative console that all the beans are deployed.
I am able to get lookup for the statefull bean from a JSP but unable to get the lookup for stateless beans. My code is a follows.
Context ctx = new InitialContext();
Object obj = ctx.lookUp("<- Bean Name ->");
This gives me a name not found exception when I try to lookup for a stateless bean. Any help will be appreciated.
Regards
Sudhir.
Thanx Srinivas. Everything is working fine now.
Regards,
Sudhir Kumar Atluru
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sudhir,
If the deployement was successful there should be no problem in lookup.
This is a simple jsp code i have to perform lookup on stateless session bean hope it helps you.
<%@ page language="java" import="java.util.,java.io.,com.tetrapak.ejb.,javax.naming.,java.rmi.,javax.ejb.,javax.rmi.*;"%>
<%
Properties env = new Properties();
env.setProperty("java.naming.factory.initial","com.inqmy.services.jndi.InitialContextFactoryImpl");
env.setProperty("java.naming.provider.url","<host>:50004");
InitialContext context = new InitialContext(env);
Object obj=context.lookup("UserBean");
System.out.println("After lookup: " + obj);
UserHome home =(UserHome)PortableRemoteObject.narrow(obj,UserHome.class);
UserRemote hello = home.create();
out.println("Bean message: " + hello.hello());
%>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.