I have been creating a simple application to help me get to used to JBoss. I
am using version 4,00 with Java1.5 and MySQL.
My application consists of two CMP EJB's, a Stateless Session EJB (which
accesses the two CMP EJB's) and then some JSP's which access the Session EJB.
When I attempt to use the JSP's I get a EJB not Bound NamingException.
I have tried several different approachs but still remian mystified.
The parts of the XML files of interest are:
in web.xml
| <ejb-ref>
| <description>no description</description>
| <ejb-ref-name>ejb/HashMapControllerEJB</ejb-ref-name>
| <ejb-ref-type>Session</ejb-ref-type>
| <home>james.examples.ejb.HashMapControllerHome</home>
| <remote>james.examples.ejb.HashMapController</remote>
| <ejb-link>HashMapControllerEJB</ejb-link>
| </ejb-ref>
|
in ejb-jar.xml
| <session>
| <description>Main Controller of HashMaps</description>
| <display-name>HashMapControllerEJB</display-name>
| <ejb-name>HashMapControllerEJB</ejb-name>
| <home>james.examples.ejb.HashControllerHome</home>
| <remote>james.examples.ejb.HashController</remote>
| <ejb-class>james.examples.ejb.HashControllerBean</ejb-class>
| <session-type>Stateless</session-type>
| <transaction-type>Container</transaction-type>
| <ejb-ref>...</ejb-ref>
| <ejb-ref>...</ejb-ref>
| </session>
|
The code doing the lookup
| public HashControllerHome getHashControllerHome() throws NamingException {
| InitialContext initial = new InitialContext(env);
| Object objref = initial.lookup(EJBGetter.HASHMAP_CONTROLLER);
| return (HashControllerHome)
| PortableRemoteObject.narrow(objref, HashControllerHome.class);
| }
|
where
| private static String HASHMAP_CONTROLLER = "ejb/HashMapControllerEJB";
|
My JNDI view contains the following:
| java:comp namespace of the HashMapControllerEJB bean:
|
| +- env (class: org.jnp.interfaces.NamingContext)
| | +- ejb (class: org.jnp.interfaces.NamingContext)
| | | +- HashEJB[link -> HashEJB] (class: javax.naming.LinkRef)
| | | +- HashMapEJB[link -> HashMapEJB] (class: javax.naming.LinkRef)
|
I have tried the following:
| private static String HASHMAP_CONTROLLER =
"java:comp/ejb/HashMapControllerEJB";
| private static String HASHMAP_CONTROLLER = "comp/ejb/HashMapControllerEJB";
| private static String HASHMAP_CONTROLLER = "java/ejb/HashMapControllerEJB";
|
I have also attempted to treat the Session EJB as external using:
jboss-web.xml
| <jboss-web>
| <ejb-ref>
| <ejb-ref-name>ejb/HashMapControllerEJB</ejb-ref-name>
| <jndi-name>HashMapControllerEJB</jndi-name>
| </ejb-ref>
| </jboss-web>
|
and jboss.xml
| <jboss>
| <enterprise-beans>
| <session>
| <ejb-name>HashMapControllerEJB</ejb-name>
| <jndi-name>HashMapControllerEJB</jndi-name>
| </session>
| </enterprise-beans>
| </jboss>
|
This also failed.
The exception I get at the moment is:
| javax.servlet.ServletException: HashMapControllerEJB not bound
|
with root cause
| javax.naming.NameNotFoundException: HashMapControllerEJB not bound
|
If I use java:comp/ejb/HashMapControllerEJB I get
| javax.naming.NameNotFoundException: ejb not bound
|
I get no exceptions at start up using the default server minus jms.
I guess I am missing something small and obvious, but at the moment I am blind
to it.
All help will be gratefully recieved.
Thank you very much!!
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3857803#3857803
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3857803
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user