|
Yes,
it helps a lot. You are missing the correct spelling, your line should
read:
"java:comp/env" + what ever name you have given your reference
For
example if the name in deployment descriptor is "ejb/Type", then your line
should be:
"java:comp/env/ejb/Type"
-AP_
ok let me put it you this way, can I issue
this within an Breed Local Entity Bean :
void somemethod()
{
InitialContext i = new
InitialContext();
TypeHome th =
i.lookup("java:/comp/ejb/Type"); // get
NameNotFoundException here
}
Does that help?
----- Original Message -----
Sent: Monday, January 07, 2002 1:48
PM
Subject: Re: Can Entity Bean Reference
Another Entity Bean using Lookup
definately sounds like the reference hasn't been set up by
the container, for whatever reason.
something else that might help you is a jndi browser - I
know JBoss provides one, and would guess that most of the containers provide
something in this area...
cheers
dim
----- Original Message -----
Sent: Monday, January 07, 2002 4:07
PM
Subject: Re: Can Entity Bean
Reference Another Entity Bean using Lookup
ok sure I shall post more later but I don't
have it with me.
If it helps my error is
java.naming.NameNotFound error
----- Original Message -----
Sent: Monday, January 07, 2002
12:20 PM
Subject: Re: Can Entity Bean
Reference Another Entity Bean using Lookup
sorry - didn't mean it to come across like that... do
send it over and I'll have a look at it (o:
the reason I posted it back onto the list, is that its
a good idea to keep things on the list so that others can learn as
well.
cheers
dim
----- Original Message -----
Sent: Monday, January 07, 2002
3:09 PM
Subject: Re: Can Entity Bean
Reference Another Entity Bean using Lookup
sorry if I did provide you with that
information but I didn't know you wanted it.
seems that you are not very happy so
maybe we'll give it miss
----- Original Message -----
Sent: Monday, January 07, 2002
12:04 PM
Subject: Re: Can Entity Bean
Reference Another Entity Bean using Lookup
sorry - somehow lost the list in all
this...
----- Original Message -----
Sent: Monday, January 07,
2002 3:04 PM
Subject: Re: Can Entity Bean
Reference Another Entity Bean using Lookup
maybe if you posted a little more info -
specifically the stack trace you get, ejb container you're using,
and relevant bits of source code, people could provide a little
more feedback.
cheers
dim
----- Original Message -----
Sent: Monday, January 07,
2002 2:41 PM
Subject: Re: Can Entity
Bean Reference Another Entity Bean using Lookup
The entity bean breed does have a
reference to OtherBean for sure.
There are 2 senerios :
1. Letting Breed Entity bean set it
own Type CMR
2. Getting a controller the Session
bean to set the Type CMR on the Breed Entity. For example
session bean contains (breed.setType(type)
----- Original Message -----
Sent: Monday, January 07,
2002 11:00 AM
Subject: Re: Can Entity
Bean Reference Another Entity Bean using Lookup
what is the jndi you are looking up?
is it by any chance "java:comp/env/ejb/OtherEJB" or something
similar (the comp/env/ejb bit)? If so, then what is
happening is the session bean has a reference to the other
entity bean, but the entity bean does not. The answer is
then in your deployment descriptors.
there no doubt could be 10 other answers,
but this springs to mind.
hth
dim
----- Original Message -----
Sent: Monday, January
07, 2002 1:28 PM
Subject: Can Entity
Bean Reference Another Entity Bean using Lookup
Hi all
Just wondering :
Is it possible for a local
entity bean to contain code that lookups another local entity.
Setting
Description:
An entity bean called Breed is
must contain entity Type.
I pass a Value Object to the
Breed bean.
The bean :
obtains the
TypeId PK from the VO.
looks up the
JNDI name (errors here, see description below) for the
TypeHome
finds the
Type record using the TypeId (PK) via the FindbyPrimaryKey
function for the TypeHome.
sets it
type CMR to the found type record
Error Description: but an error
occurs here while doing the lookup. It says, that the JNDI
name cannot be found.
However, if I move this to a
session bean which does exactly the same. It works. For
clarity the session bean:
accepts the
Value Object
obtains the
TypeId PK from the VO.
looks up the
JNDI name for the TypeHome (works!!!!)
finds the
Type record using the TypeId (PK) via the FindbyPrimaryKey
function for the TypeHome.
sets it type
CMR to the found Type record
Why???????? Does it work in the
session and not entity.
TIA
Glenn
|