Bugs item #756466, was opened at 2003-06-18 12:08
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=756466&group_id=22866

Category: JBossServer
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Alexei Yudichev (sflexus)
Assigned to: Nobody/Anonymous (nobody)
Summary: JNDI context is wrong inside setEntityContext()

Initial Comment:
W2k or Linux, JDK 1.4.1_02, JBoss 3.2.1.
Assuming the following method is a business method of a 
CMP Bean called Product:

abstract public class ProductBean extends MMSBean 
implements EntityBean {
[...]
  public MMSObject getMMSObject() {
    return getMmsimage();
  }
[...]
}

getMmsimage() is a CMR 1-to-1 field of ProductBean.

MMSImage Bean implementation:

class abstract public class MMSImageBean extends 
MMSObjectBean implements EntityBean {
[...]
}

public abstract class MMSObjectBean extends MMSBean 
{
[...]
  public void setEntityContext(EntityContext 
entityContext) {

    super.setEntityContext(entityContext);
    try {
      contentOwnerHome = (ContentOwnerHome) new 
InitialContext().lookup("java:
comp/env/ejb/mms/ContentOwnerLocal");
    } catch (NamingException ex) {
      throw new EJBException(ex);
    }
  }
[...]
}

A NameNotFoundException is thrown inside 
MMSObjectBean.setEntityContext() (see stack trace is 
attached). After carefull investigation it appeared that 
inside MMSImageBean.setEntityContext() (which is 
actually MMSObjectBean.setEntityContext()) the JNDI 
ENC context of Product bean is active despite of the 
current bean is MMSImageBean! After adding to Product 
bean an ejb reference to ContentOwner bean exception 
disappeared. Of course, ejb reference to ContentOwner 
bean does exist for MMSImage bean. 
If MMSObjectBean.setEntityContext() is invoked as a 
result of a different invocation chain, for example as a 
result of finding MMSImage by primary key, the JNDI 
context is set up properly.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=756466&group_id=22866


-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to