-
1. Re: problem looking up an entity bean from a session bean
jsk Sep 6, 2001 2:57 AM (in response to watt)Hi Watt
Look at my last reply in my problem. I have tried to descripe how to make it work.
What is assign to the myEntityName string ?
Jesper -
2. Re: problem looking up an entity bean from a session bean
watt Sep 6, 2001 4:23 AM (in response to watt)hello jsk,
I have looked at your solution but my problem is a bit different from yours because my beans are deployed in the same ejb-jar file. So, I don't think I need to use a .ear file.
Here is the entity's descriptor with the entity's name declaration:
<ejb-name>MyEntity</ejb-name>
com.myPackage.MyEntityHome
com.myPackage.MyEntity
<ejb-class>com.myPackage.MyEntityBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
False -
3. Re: problem looking up an entity bean from a session bean
hrangamana Sep 6, 2001 5:55 AM (in response to watt)Hi Sylvain,
Have you insert an ejb-ref entry within your ejb session in DD ? I think this may be the problem ...
Cheers ..
/Hermann -
4. Re: problem looking up an entity bean from a session bean
watt Sep 6, 2001 6:06 AM (in response to watt)Hi Rangamana,
As you can see above, I have inserted an ejb-ref in my descriptor.
Thanks for your encouragement. -
5. Re: problem looking up an entity bean from a session bean
watt Sep 6, 2001 6:29 AM (in response to watt)Sorry, I have not specified the value of the string myEntityName in my previous answer:
myEntityName="java:comp/env/entity/RessourceEntity" -
6. Re: problem looking up an entity bean from a session bean
watt Sep 6, 2001 8:08 AM (in response to watt)I hava made a mistake:
myEntityName="java:comp/env/entity/myEntity" -
7. Re: problem looking up an entity bean from a session bean
lothar Sep 6, 2001 9:06 AM (in response to watt)You have specified the ejb-ref-name entity/MyEntity the deployment descriptor and are using entity/myEntity in the code when the lowercase 'm' is not a typo in the post then that could be your problem.
-
8. Re: problem looking up an entity bean from a session bean
jsk Sep 6, 2001 9:22 AM (in response to watt)Hi watt
Try using
myEntityName="java:comp/env/ejb/RessourceEntity
not
myEntityName="java:comp/env/entity/RessourceEntity
It worked for me.
I also think you need to specified
<ejb-ref>
<ejb-ref-name>ejb/MyEntity</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
com.myPackage.MyEntityHome
com.myPackage.MyEntity
<ejb-link>MyEntity</ejb-link>
</ejb-ref>
Note: In <ejb-ref-name> it has to be ejb/MyEntity not entity/MyEntity
I think it has something to do with the java:comp/env/ejb where alle EJB's are placed and has to be looked up from no matter its JNDI name.
You also have to create a jboss.xml as well also including <ejb-ref> tags to deploy correctly.
Jesper -
9. Re: problem looking up an entity bean from a session bean
watt Sep 14, 2001 12:53 PM (in response to watt)Hi,
Thinks for all your advices, but nothing solves my problem. The exception "no protocole" is always raised when my session bean try to look up for the entity bean.
I avoid the trouble by setting the classpath to my classes's directory so that JBoss doesn't need to find the file generated in the temp directory. But it is just a temporary solution.
So I ask myself whether my local variables like JBOSS_CLASSPATH or CLASSPATH was rightly setting up or not.
My question is: must the CLASSPATH or the JBOSS_CLASSPATH point a specific sub-directory (like 'deploy') of the jboss's main directory ?
I am very grateful for your help. -
10. Re: problem looking up an entity bean from a session bean
p_d_austin Sep 14, 2001 3:23 PM (in response to watt)Try moving your jboss installation to a directory that does not have a space in it and see if that works.
Paul