Rick,
 
The short name will work ok.  (Because it is the JNDI name).  But having the short name working is definitely more convenient.
 
I might have found out what the problem is.  I think it's my misunderstanding of ejb-ref.  I read some more on it.  If I am not wrong, ejb-ref is used to refer to OTHER ejb's.
 
So I have it in my company bean:
 
* @ejb:ejb-ref ejb-name="CompanyUser" view-type="local"
 * @ejb:ejb-ref ejb-name="CompanyUser" view-type="remote"
 
 
After that, this line of code works:
 
CompanyUserLocalHome home = CompanyUserUtil.getLocalHome();
 
However, I am not 100% sure when CompanyUserUtil now can access the long name (java:comp/env/ejb/CompanyUserLocal), I mean, then ejb-ref entry is done in my Company bean (in the ejb-jar.xml), not the CompanyUserUtil (there is no entry for CompanyUserUtil in the ejb-jar.xml).  Any thoughts?
 
-- Derek
 
----- Original Message -----
Sent: Saturday, October 26, 2002 8:02 PM
Subject: Re: [JBoss-user] lookup java:comp/env/

I had this same issue. I Think it may be correct that the ejb doesn't have access to this absolute path you are trying, but not positive.
 
Anyway, the utility class generated by xdoclet makes two string constants, one of them is the short name you used succesfully.
 
My xdoclet was using the longer name too, but I changed something in my class or specs and it started making a util class that used the shorter name. I don't have the code in front of me (not at work now), and I really didn't know then what exactly fixed it. Hope that's a clue.
 
I find the namespace issues to be confusing to begin with (for most people, the roles of a separate person being an app assembler and deployer are mythical!)
 
rick
 
 
 
From: Derek Lin
Sent: Saturday, October 26, 2002 9:20 PM
Subject: [JBoss-user] lookup java:comp/env/

I have found that initialContext.lookup("java:comp/env/ejb/CompanyUserLocal") won't work with JBoss.  Instead, I have to use initialContext.lookup("CompanyUserLocal").
 
In my jboss.xml, there is this entry:
 
      <entity>
         <ejb-name>CompanyUser</ejb-name>
         <jndi-name>ejb/CompanyUser</jndi-name>
         <local-jndi-name>CompanyUserLocal</local-jndi-name>
      </entity>
 
I can see how initialContext.lookup("CompanyUserLocal") is working, but can't see why initialContext.lookup("java:comp/env/ejb/CompanyUserLocal") will not work other than the fact the JBoss is not supporting it.  It is supposed to be a standard.  More importantly, it is the way Xdoclet generates its util classes.
 
Any thoughts?
 
-- Derek

Reply via email to