EJB not bound?
mr_density Apr 14, 2006 7:32 AMThe error I get is that my ejb is not bound when I try to access it through a webservice. My application has a front-end that connects to my webservice and my webservice must connect to my sessionBean.
Here is my ejb-jar.xml
<session> <ejb-name>Foo</ejb-name> <home>project.ejb.session.FooHome</home> <remote>project.ejb.session.Foo</remote> <ejb-class>project.ejb.session.FooBean</ejb-class> <session-type>Stateful</session-type> <transaction-type>Container</transaction-type> <ejb-ref> <ejb-ref-name>ejb/Foo</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>project.ejb.session.FooHome</home> <remote>project.ejb.session.Foo</remote> </ejb-ref> <security-identity> <use-caller-identity/> </security-identity> <security-role-ref> <role-name>beheerder</role-name> <role-link>beheerders</role-link> </security-role-ref> </session>
Here is my jboss.xml
<session> <ejb-name>Foo</ejb-name> <jndi-name>Foo</jndi-name> <ejb-ref> <ejb-ref-name>ejb/Foo</ejb-ref-name> <jndi-name>java:comp/env/ejb/Foo</jndi-name> </ejb-ref> <port-component> <port-component-name>Foo</port-component-name> <port-component-uri>/authentication/*</port-component-uri> <auth-method>BASIC</auth-method> </port-component> </session>
The code in my webservice implements class
InitialContext inictx = new InitialContext(); Object ref = inictx.lookup("java:comp/env/ejb/Foo"); FooHome fooHome = (FooHome)PortableRemoteObject.narrow(ref, FooHome.class); Foo FooBean = fooHome.create();
The exacte error is:
javax.naming.NameNotFoundException: Foo not bound
When i look in my jboss jmx console i can see that my Foo has been deployed. I double checked this also with a piece of code that shows all my deployed beans show that is not the problem!
But what is?? Can anyone help me please!