-
1. Re: why is my LocalBean not bound?
darranl Jul 18, 2005 11:37 AM (in response to cinimod)You are trying to lookup the bean in the local namespace of the web application, you need to add an ejb-local-ref in the web.xml of your web application.
-
2. Re: why is my LocalBean not bound?
cinimod Jul 18, 2005 6:12 PM (in response to cinimod)ok, i did add the following in the web.xml:
<ejb-local-ref> <ejb-ref-name>WiseSessionHomeLocal</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local-home>beans.session.WiseSessionHomeLocal</local-home> <local>beans.session.WiseSessionLocal</local> <ejb-link>WiseSessionBean</ejb-link> </ejb-local-ref>
But when i deploy the log tells me a NamingException:
ejb-local-ref: "WiseSessionBean", with web.xml ejb-link: "WiseSessionBean" failed to resolve to an ejb with a LocalHome.
As you can see above the <ejb-link> value is the same as the <ejb-name> value in ejb-jar.xml, shown in my first post.
what´s the problem and how to solve it?
Thanks for any suggestions. -
3. Re: why is my LocalBean not bound?
darranl Jul 18, 2005 6:53 PM (in response to cinimod)Are your two archives packaged in an ear or are both archives deployed intependently?
-
4. Re: why is my LocalBean not bound?
cinimod Jul 19, 2005 5:41 PM (in response to cinimod)the .jar and .war are both contained in the same ear file.
Any ideas how to solve this? -
5. Re: why is my LocalBean not bound?
cinimod Jul 19, 2005 7:27 PM (in response to cinimod)ok, i change the following:
now:<ejb-ref-name>WiseSessionBean</ejb-ref-name> <ejb-link>WiseSessionHomeLocal</ejb-link>
i had it just the other way round...
also i added this to the jboss-web.xml<ejb-local-ref> <ejb-ref-name>WiseSessionBean</ejb-ref-name> <local-jndi-name>WiseSessionHomeLocal</local-jndi-name> <ejb-link>WiseSessionBean</ejb-link> </ejb-local-ref>
deployment works, but when i run the application the log says:
javax.naming.NameNotFoundException: WiseSessionHomeLocal not bound.
What´s wrong? -
6. Re: why is my LocalBean not bound?
darranl Jul 20, 2005 6:21 AM (in response to cinimod)If you are using <ejb-link> and the jar and war are in the same ear you do not need to add the <ejb-local-ref> to the jboss-web.xml - Just leave this out and the name of the bean will be used to locate it.
Are you getting any other errors on deployment, I have just noticed that you have a number of CMP specific elements within your session bean declaration that should not be there. -
7. Re: why is my LocalBean not bound?
cinimod Jul 20, 2005 8:48 AM (in response to cinimod)is the name of my jar where i put the bean classes in, of importance?
-
8. Re: why is my LocalBean not bound?
cinimod Jul 20, 2005 9:19 AM (in response to cinimod)ok, here are all the relevant deployment descriptors - updated:
part of ejb-jar.xml<session> <ejb-name>WiseSessionBean</ejb-name> <local-home>beans.session.WiseSessionHomeLocal</local-home> <local>beans.session.WiseSessionLocal</local> <ejb-class>beans.session.WiseSessionBean</ejb-class> <session-type>Stateful</session-type> <transaction-type>Container</transaction-type> <security-identity><use-caller-identity/></security-identity> </session>
jboss.xml:<jboss> <enterprise-beans> <session> <ejb-name>WiseSessionBean</ejb-name> <local-jndi-name>WiseSessionHomeLocal</local-jndi-name> </session> </enterprise-beans> </jboss>
part of web.xml:<ejb-local-ref> <ejb-ref-name>WiseSessionHomeLocal</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local-home>beans.session.WiseSessionHomeLocal</local-home> <local>beans.session.WiseSessionLocal</local> <ejb-link>WiseSessionBean</ejb-link> </ejb-local-ref>
Deployment works fine, but as soon as my servlet runs, trying to call up the bean it tells me again:
javax.naming.NameNotFoundException: WiseSessionHomeLocal not bound. -
9. Re: why is my LocalBean not bound?
cinimod Jul 20, 2005 9:24 AM (in response to cinimod)it works...i typed WiseSessionLocalHome instead of WiseSessionHomeLocal.
Thanks for your good advices!