wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes j2ee -ejb error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "j2ee -ejb error" Watch "j2ee -ejb error" New topic
Author

j2ee -ejb error

s prasanna
Greenhorn

Joined: Oct 04, 2001
Posts: 2
hai everybody
when i am try to run the following servlet-ejb in j2ee server i got some errors. Anybody give me a solution for this?

thanks in advance
prasanna
import javax.servlet.*;
import java.io.*;
import javax.rmi.*;
import javax.naming.*;
public class HelloServlet extends GenericServlet
{
public void service(ServletRequest req,ServletResponse res) throws
ServletException,IOException
{
PrintWriter out = res.getWriter();
try
{
Context c = new InitialContext();
Object ob = c.lookup("Hello");
HelloHome home = (HelloHome)PortableRemoteObject.narrow(ob,HelloHome.class);
HelloInter s = home.create();
out.println("Message : " + s.hello());
}
catch(Exception e1)
{
out.println(e1.getMessage());
}
}
}

error Message :
Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: j2ee -ejb error