Hi,
Which app server are you using. It looks that bean is not deployed properly
and check the home name from the xml file.
Warm Regards
Ashwani Kalra
Sr. Member Development Staff
Aithent Technologies(P) Ltd.
----- Original Message -----
From: Amit V Joshi <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 06, 2001 8:56 PM
Subject: Accessing beans from servlets !?
> Hi all,
>
> I am trying to access a bean thru' a servlet. I am getting error as
> "Conversation.UserHome not found"
> Here Conversation.UserHome is the lookup name for the bean. Here is my
code.
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
> import java.rmi.*;
> import java.rmi.server.*;
> import java.util.*;
> import javax.ejb.*;
> import javax.naming.*;
> import ejbeans.*;
>
> public class viewServlet extends HttpServlet
> {
>
> private Context context;
>
> static
> {
> System.setSecurityManager(new RMISecurityManager());
> }
>
> public void doGet(HttpServletRequest req,
> HttpServletResponse res)
> throws ServletException, IOException
> {
> final Properties properties = new Properties();
> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "allaire.ejipt.ContextFactory");
> properties.setProperty(Context.PROVIDER_URL,
> "ejipt://itl-pc-1703:2323");
>
> try
> {
> context = new InitialContext(properties);
> final UserHome home = (UserHome)
> context.lookup("Conversation.UserHome");
> final User user = home.create();
> }
> catch (Exception exception)
> {
> throw new RuntimeException(exception.getMessage());
> }
> req.getRequestDispatcher("form.jsp").forward(req,res);
> }
> }
>
> Any help in these regards is welcome
>
> Thanx.
>
> Amit.
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".