David,

We lookup EJBs using the local or global JNDI name specified in the DD
and consequently bypass the need for ejb-ref elements. What is the
downside of this strategy? We use the fully qualified class name on our
stateless session beans and entity beans so we have a self-documenting
naming convention. Is this simple and effective strategy masking some
underlying evil? I have been warned about doing this but nobody has come
up with a valid argument except to regurgitate a paragraph from here or
there saying that a given component should declare the other components
it uses using an ejb-ref. Perhaps in a distributed enterprise where the
same class gets used is deployed with various permissions and such. I
would appreciate some clarification on this. 

Thanks!

-----Original Message-----
From: David Jencks [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 17, 2003 10:19 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-user] Error: my patience Not Bound


One thing I find helpful is to study the results of the jndiview mbean
list operation.  It shows everything bound, including in each comp/env
private context.

http://localhost:8080/jmx-console

find and click on the jndi-view mbean

click list button

david jencks

On 2003.03.17 23:19 Nathaniel Rahav wrote:
> 
> Dear JBoss users,
> 
> I have been literally tearing my hair out (whatever there is left)
> for a few days trying to understand 
> why I'm getting this error. I have 3 Entity beans in my app, all
written 
> using XDoclet1.2b2 and deployed on JBoss3.0.4-tomcat . 
> I am using a Session bean to lookup these 3 beans. 2 of them are
> retrieved 
> fine, but the third bean, CreditCard, gives me a Not Bound exception
when
> 
> I try to look it up via the local VM:
> 
> CreditCardLocalHome cachedLocalHome =
> (rpmaster.server.data.beans.CreditCardLocalHome) 
> initialContext.lookup("java:comp/env/ejb/CreditCard");
> 
> I have checked word for word the code between this bean and my other 
> beans (Person and Address, not very complicated beans) . There is no 
> difference
> 
> AT ALL other than the names of the beans and different CMP fields. 
> There
> is no difference in the generated source or DD's. Therefore I believe
it 
> is not an XDoclet issue.
> 
> Could this be something with JBoss ? I know that the CreditCard bean 
> is
> the one that gets deployed first (I see the message in the log "INFO  
> [EjbModule] Deploying CreditCard" )
> 
> Here is my XDoclet source from CreditCardBean.java
> 
> /***
>  * @ejb:bean 
>  *           name="CreditCard"
>  *           type="CMP"
>  *           view-type="local"
>  *
local-jndi-name="local/rpmaster.server.data.beans.CreditCard"
>  *           primkey-field="creditCardUId"
>  *           schema="CreditCard"
>  *           cmp-version="${ejb.cmp.version}"
> ...
> 
> which generates the following declaration in
> CreditCardLocalHome.java: 
> 
> 
>  public static final String COMP_NAME="java:comp/env/ejb/CreditCard";
>    public static final String
> JNDI_NAME="local/rpmaster.server.data.beans.CreditCard";
> 
> 
> 
> ****
> and it also gives me the following ejb-jar.xml entry:
> 
> ...
>  <entity >
>          <description><![CDATA[The CreditCardBean represents a 
> creditCard]]></description>
> 
>          <ejb-name>CreditCard</ejb-name>
> 
>          
>
<local-home>rpmaster.server.data.beans.CreditCardLocalHome</local-home>
>          <local>rpmaster.server.data.beans.CreditCardLocal</local>
> ...
> ****
> 
> 
> and in my jboss.xml I have the following:
> 
>  <entity>
>          <ejb-name>CreditCard</ejb-name>
>          
> <local-jndi-name>local/rpmaster.server.data.beans.CreditCard</local-jn
> di-name>
> 
>       </entity>
> 
> *****
> and here is the stack trace from aforementioned lookup:
> 
> 21:40:04,234 INFO  [PersonManagementSessionSession] FAILURE :: 
> CreditCard not bound 21:40:04,238 ERROR [STDERR] 
> javax.naming.NameNotFoundException:CreditCard
> not bound
> 21:40:04,247 ERROR [STDERR]     at
org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
> 21:40:04,251 ERROR [STDERR]     at
org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
> 21:40:04,255 ERROR [STDERR]     at
org.jnp.server.NamingServer.getObject(NamingServer.java:509)
> 21:40:04,259 ERROR [STDERR]     at
org.jnp.server.NamingServer.lookup(NamingServer.java:282)
> 21:40:04,280 ERROR [STDERR]     at
org.jnp.server.NamingServer.lookup(NamingServer.java:256)
> 21:40:04,280 ERROR [STDERR]     at
org.jnp.server.NamingServer.lookup(NamingServer.java:256)
> 21:40:04,280 ERROR [STDERR]     at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:464)
> 21:40:04,281 ERROR [STDERR]     at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:592)
> 21:40:04,281 ERROR [STDERR]     at
org.jnp.interfaces.NamingContext.lookup(NamingContext.java:443)
> 21:40:04,281 ERROR [STDERR]     at
javax.naming.InitialContext.lookup(InitialContext.java:347)
> 21:40:04,281 ERROR [STDERR]     at
rpmaster.server.session.PersonManagementSessionEJB.updatePerson(Unknown
> 
> Source)
> 
> Anybody have any ideas why this is happening ?
> 
> How can I request from my Context a list of what it has registered so 
> that I can see if my CreditCard is in there, maybe under a different 
> name ? I know that InitialContext has a lookup method but I cant 
> figure out what
> 
> String to pass it to get me the list of my java objects.
> 
> Any help is truly appreciated.
> 
> TIA
> 
> Nathaniel
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by:Crypto Challenge is now open!
> Get cracking and register here for some mind boggling fun and 
> the chance of winning an Apple iPod:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user
> 
> 


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink?
You could win a Tablet PC. Get a free Tablet PC hat just for playing.
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to