Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NameNotFoundException - Entity Bean

0 views
Skip to first unread message

Deepak Vohra

unread,
Jun 18, 2002, 3:17:28 PM6/18/02
to
In ejb-jar.xml for session bean include <ejb-ref> for entity bean.

<ejb-ref>
<ejb-ref-name>ejb/EntityEjb</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<home>com.ejb.EntityEjbHome</home>
<remote>com.ejb.EntityEjb</remote>
</ejb-ref>

In weblogic-ejb-jar.xml include <jndi-name> for entity bean.

<ejb-reference-description>
<ejb-ref-name>ejb/EntityEjb</ejb-ref-name>
<jndi-name>ejb.EntityEjb</jndi-name>
</ejb-reference-description>


Tuan wrote:

> As I move to WLS7.0 from 5.1, I set up a WLS7.0 instance and everything is fine. Just
> for experiment I deployed minimal web components to see how WLS7.0 works. Here is
> my problem when Session Bean (stateless) lookup an CMP entity bean (why is it looking
> in "app/ejb" when I don't even have anything resemble it at all). Plz help:
>
> javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundException:
> Unable to resolve 'app/ejb/SystemUs
> er.jar#SystemUser/local-home' Resolved: 'app/ejb' Unresolved:'SystemUser.jar#SystemUser'
> ; remaining name 'SystemUser.ja
> r#SystemUser/local-home'
> at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:858)
> at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:223)
> at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:187)

Tuan

unread,
Jun 18, 2002, 11:41:44 AM6/18/02
to

Tuan

unread,
Jul 2, 2002, 12:59:59 PM7/2/02
to

Deepak,

Do you have to define the entity reference in ejb-jar.xml for the session and ejb-description-ref
in entity weblogic-ejb-jar.xml?
Extra info: My stateless session is remote and my CMP entity bean is local. Thanks
in advance.

Emmanuel Proulx

unread,
Jul 3, 2002, 1:00:30 PM7/3/02
to
You can lookup the bean directly (looking up its <jndi-name> or
<local-jndi-name>).

Using ejb-link is faster.

Emmanuel


"Tuan" <tuan_...@hotmail.com> wrote in message
news:3d21dc0f$1...@newsgroups2.bea.com...

Tuan

unread,
Jul 3, 2002, 1:11:55 PM7/3/02
to

Here is a brief description of what leads to the problem I'm having and hope you can
help:

I'm moving our system from WLS5.1 to WLS7.0. My session EJB is stateless and entity
is CMP. My session is remote but my entity is local. All the EJBs are moved from
1.1 spec to EJB 2.0 spec.

To learn and find what ahead before moving to WLS7.0, I have a simple servlet and
it has a remote stateless session bean. This beans then look for a CMP local entity.
In WLS6 has no problem but javax.naming.LinkException occurs in WLS7.0.

Emmanuel Proulx

unread,
Jul 4, 2002, 1:15:50 AM7/4/02
to
You didn't provide the code, so it's hard to guess.

Make sure you look up "ejb.EntityEjb" (directly) or
"java:comp/env/ejb/EntityEJB" (using your reference). Use <ejb-link> an thus
avoid mapping the bean to an external JNDI name (don't need to specify
<ejb-reference-description>). This is faster.

Also, your entity EJB seems to have a remote interface. I suggest using a
local interface for all entity EJBs.

For example:
<ejb-local-ref>


<ejb-ref-name>ejb/EntityEjb</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>

<local-home>com.ejb.EntityEjbLocalHome</local-home>
<local>com.ejb.EntityEjbLocal</local>
<ejb-link>EntityEJB</ejb-link>
</ejb-local-ref>

and then look up "java:comp/env/ejb/EntityEJB".

Emmanuel

"Tuan" <tuan_...@hotmail.com> wrote in message

news:3d23305b$1...@newsgroups2.bea.com...

0 new messages