On Thu, 17 May 2001, Thomas Grnert wrote:
> Hi,
>
> 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");
^^^
There's very little context here, but it seems as though you try to use
the SessionContext for a JNDI lookup. The SessionContext is not a JNDI
context. You should probably do the following instead:
InitialContext ic = new InitialContext();
MassnahmeHome m_home = (MassnahmeHome)
ic.lookup("java:comp/env/entity/katalog/Massnahme");
Cheers
-----------------------------------------------------------------------
Per Lewau ([EMAIL PROTECTED])
"Why waste time learning, when ignorance is instantaneous?"
- Hobbes
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user