Jboss version is 4.0.3.

I see the bean being bound: 
14:34:43,265 INFO  [BaseLocalProxyFactory] Bound EJB LocalHome 'Stegiuser' to 
jndi 'stegi/StegiuserLocalHome'

The following code always fails with a classcast exception in getLocalHome:
 

 public static com.cei.stegi.server.beans.interfaces.StegiuserLocalHome 
getLocalHome() throws javax.naming.NamingException
       {         
          return (com.cei.stegi.server.beans.interfaces.StegiuserLocalHome) 
lookupHome(null, 
com.cei.stegi.server.beans.interfaces.StegiuserLocalHome.JNDI_NAME, 
com.cei.stegi.server.beans.interfaces.StegiuserLocalHome.class);
       }


    private static Object lookupHome(java.util.Hashtable environment, String 
jndiName, Class narrowTo) throws javax.naming.NamingException {
      // Obtain initial context
      javax.naming.InitialContext initialContext = new 
javax.naming.InitialContext(environment);
      try {
         Object objRef = initialContext.lookup(jndiName);
         // only narrow if necessary
          System.out.println("The object ref is: " + objRef);
         if (narrowTo.isInstance(java.rmi.Remote.class))
         {
            return javax.rmi.PortableRemoteObject.narrow(objRef, narrowTo);
         }
         else
            return objRef;
      } finally {
         initialContext.close();
      }
   }

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

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


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to