Beatriz Campo González
2005-02-16 15:45:07 UTC
Hello,
I've deployed a simple SessionBean with jndi name="Libro"
I've written a servlet, the client of the EJB, which tries to access to "saluda()", the method of the EJB. I get the following error when I compile the client:
cannot find symbol
symbol: variable sal
location: myServlet
sal.saluda();
Here is the code for the servlet:
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("");
out.println("");
out.println("");
try
{
Context contexto = new InitialContext();
Object ref = contexto.lookup("Libro");
LibroHome home =
(LibroHome) PortableRemoteObject.narrow(ref,Beans.LibroHome.class);
Libro sal = home.create();
}
catch (Exception e)
{
e.printStackTrace();
}
sal.saluda();//<---------HERE IS THE ERROR
out.println("");
out.close();
The "saluda()" method only prints a greeting, it's quite simple.
I don't know what is wrong? maybe the package?? I'm really confused
Any help will be welcome?:|
I've deployed a simple SessionBean with jndi name="Libro"
I've written a servlet, the client of the EJB, which tries to access to "saluda()", the method of the EJB. I get the following error when I compile the client:
cannot find symbol
symbol: variable sal
location: myServlet
sal.saluda();
Here is the code for the servlet:
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("");
out.println("");
out.println("");
try
{
Context contexto = new InitialContext();
Object ref = contexto.lookup("Libro");
LibroHome home =
(LibroHome) PortableRemoteObject.narrow(ref,Beans.LibroHome.class);
Libro sal = home.create();
}
catch (Exception e)
{
e.printStackTrace();
}
sal.saluda();//<---------HERE IS THE ERROR
out.println("");
out.close();
The "saluda()" method only prints a greeting, it's quite simple.
I don't know what is wrong? maybe the package?? I'm really confused
Any help will be welcome?:|