[jboss-user] [Installation, Configuration & Deployment] - Re: javax.naming.NameNotFoundException

jaikiran do-not-reply at jboss.com
Mon Aug 7 00:59:13 EDT 2006


Apologies for the late reply. If you have got this working, its well and good. If not, then try out the following:

- First of all, the code which you are using:
cachedLocalHome = (rpc.services.promotion.interfaces.PromotionLocalHome) lookupHome(new java.util.Hashtable(), rpc.services.promotion.interfaces.PromotionLocalHome.COMP_NAME, rpc.services.promotion.interfaces.PromotionLocalHome.class);	

needs to be changed(just for the time being for debugging this issue) to:

String jndiName = "PromotionLocal";
  | Object objRef = initialContext.lookup(jndiName);
  | System.out.println("Lookup successful: " + objRef);
  | //now do the casting
  | rpc.services.promotion.interfaces.PromotionLocalHome home = (rpc.services.promotion.interfaces.PromotionLocalHome) objRef;
  | System.out.println("Casted successfully");	

If this does work, then the cause of your ClassCastException might have something to do with the implementation of you lookupHome() method.

If even this does not work, then try out the JMX Console method mentioned at:
http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassCastExceptions
to try and find if the same class is being loaded by multiple classloaders.


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

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



More information about the jboss-user mailing list