The
ctx variable in the documentation example is of javax.naming.Context type, while
your ctx is of javax.ejb.SessionContext....
in the
book you should have something like:
javax.naming.Context ctx = new
javax.naming.InitialContext(...);
-----Original Message-----Hi,
From: Thomas Gr�nert [mailto:[EMAIL PROTECTED]]
Sent: Donnerstag, 17. Mai 2001 16:30
To: [EMAIL PROTECTED]
Subject: [JBoss-user] Intrabean Call ?
documentation says:
public class ABean implements EntityBean {
...
public void BusinessMethod(...) {
...
BHome home = (BHome)ctx.lookup("java:comp/env/ejb/myBean");
B bean = home.create(pk);
...
}
}
My inside a SessionBean code looks like:
private SessionContext ctx;
public void setSessionContext(SessionContext sc)
{
this.ctx = sc;
}
public DocumentFragment getMassnahmeByID(long ID) throws RemoteException
{
MassnahmeHome m_home = (MassnahmeHome)ctx.lookup("java:comp/env/entity/katalog/Massnahme");
SessionContext.getEJBObject().
....
Compiler says:
cannot resolv symbol: mothod lookup
I am sure that I do something really wrong. Please help me !
Thomas
