Hi there, I'm facing a problem while accessing an associated Entity beans (relationship) from current bean. I have an entity bean named StationLog which is associated (in many-to-many mapping) to another entity named Mailing_list. I have a join table named Station_log_mailing_list, that has to_One relationships to Station_log and Mailing_list entity, respectively. What I want is to remove all the entries from a join table for stal_id = ? and also delete the StationLog record for the same. The following is my method in Session bean:
I gave the debug statements and found that invoking remove() method is throwing this exception. All the EJB are generated using bottom-up approach. It looks like entity beans are generated correctly. What could be the problem? Has any body encountered this before? Please help. The below is the error message: [02.12.06 19:24:22:903 GMT+05:30] 5b8e4d1d UrlContextHel W NMSV0605E: A Reference object looked up from the context "java:" with the name "comp/env/ejb/Mailing_list" was sent to the JNDI Naming Manager and an exception resulted. Reference data follows: Reference Factory Class Name: com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory Reference Factory Class Location URLs: <null> Reference Class Name: java.lang.Object Type: JndiLookupInfo Content: com.ibm.ws.naming.util.JndiLookupInfo@55f14d2c Exception data follows: javax.naming.NameNotFoundException: Mailing_listHome at com.ibm.ejs.ns.jndi.CNContextImpl.doLookup(CNContextImpl.java:1435) at com.ibm.ejs.ns.jndi.CNContextImpl.lookup(CNContextImpl.java:1115) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.ibm.ws.naming.util.IndirectJndiLookupObjectFactory.getObjectInstance(IndirectJndiLookupObjectFactory.java:193) at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:308) at com.ibm.ws.naming.urlbase.UrlContextHelper.isReference(UrlContextHelper.java:115) at com.ibm.ws.naming.urlbase.UrlContextHelper.processBoundObjectForLookup(UrlContextHelper.java:229) at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1181) at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1158) at com.ibm.ws.naming.urlbase.UrlContext.lookup(UrlContext.java:1210) at javax.naming.InitialContext.lookup(InitialContext.java:351) at com.ibm.ivj.ejb.associations.links.Link.lookupTargetHome(Link.java:98) at com.effigent.disney.ejb.entity.Station_log_mailing_listToSlm_mail_listLink.getTargetHome(Station_log_mailing_listToSlm_mail_listLink.java:34) at com.effigent.disney.ejb.entity.Station_log_mailing_listToSlm_mail_listLink.fetchTarget(Station_log_mailing_listToSlm_mail_listLink.java:45) at com.ibm.ivj.ejb.associations.links.SingleLinkImpl.value(SingleLinkImpl.java:129) at com.ibm.ivj.ejb.associations.links.SingleLinkImpl.remove(SingleLinkImpl.java:33) at com.effigent.disney.ejb.entity.Station_log_mailing_listBean._removeLinks(Station_log_mailing_listBean.java:112) at com.effigent.disney.ejb.entity.Station_log_mailing_listBean.ejbRemove(Station_log_mailing_listBean.java:79)
Thanks in advance. regards abhilesh [ December 08, 2002: Message edited by: Abhilesh Khatri ]
Whic version of WAS are you using? I have same problem with WSAD 5.0 Test Environment. In my case, assoicated bean has local interface only, and I am getting NameNotFoundException allways. I tried with different JNDI names, without success.
posted 17 years ago
SOLVED: The problem was, I have specified the wrong lookup names. i.e. when opened the EJB project using EJB EXtension Editor, for an entity named 'User' jndi name was 'com/effigent/abc/UserHome' and for User to Role relationhip and User to Module relationhip, I took the default lookup names specified by the studio i.e. 'Role' 'Module'. Where Role and Module are 2 different entities which have following lookup names: 'com/effigent/abc/RoleHome' 'com/effigent/abc/ModuleHome'. To resolve this, we need to modify relationship lookup names to. 'com/effigent/abc/RoleHome' 'com/effigent/abc/ModuleHome' .
One thing that should be noticed is whatever lookup name is associated with an Entity. Wherever that entity it is lookedup we should use exactly the same jndi lookup name. My working envt is : WAS Adv Single Server Edition 4.0, WSAD 4.0, DB2 UDB 7.2 Enterprise Edition. regards abhilesh
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Devious Experiments for a Truly Passive Greenhouse!