Hello, has anyone tried the tutorial from this site that shows you how to 
create and deply a simple EAR (ejb + servlet) to JBoss via the Eclipse IDE ?

It all seems to work fine for me apart from where the servlet looks up the home 
object for the EJB in the init() method.

I get a ClassCast Exception on the 3rd line below

Context context = new InitialContext();
Object ref = context.lookup("java:comp/env/ejb/Fibo");
home = (FiboHome)PortableRemoteObject.narrow(ref, FiboHome.class);

on the last line above - the entries in the xml deployment desciptors look fine

web.xml...

<ejb-ref >
      <![CDATA[Reference to the Fibo EJB]]>
      <ejb-ref-name>ejb/Fibo</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      tutorial.interfaces.FiboHome
      tutorial.interfaces.Fibo
</ejb-ref>

jboss-web.xml...

<ejb-ref>
      <ejb-ref-name>ejb/Fibo</ejb-ref-name>
      <jndi-name>ejb/Fibo</jndi-name>
 </ejb-ref>

the JNDI name is ejb/Fibo (from the jboss,xml) so I can't see the problem.

Can anyone help ?








View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3894307#3894307

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3894307


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to