• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JNDI problem

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Tomcat with Weblogic.I deploy web module in Tomcat5.0 and EJB module in Weblogic 8.1.When i call the lookup to JNDI EXCEPTION CLASSCASTEXCEPTION for the Home interface.I compile Web module using JDK1.5 and EJB using JDK1.4.1. Pliz help me.
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check if you are using the correct lookup string.
ClassCastException means that jndi is finding an object, but that it's type is not what you expect.
However, the info you provide is not sufficient to analyze further.

Regards, Jan
 
Ingoba Ningthoujam
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. Well please tell me how to put the STUB of the EJB HomeInterace in web application which is running in Tomcat.whether I have to put it as JAR file or as JAVA file. My present directory structure is

EJB in WEBLOGIC
com.ingo.ejb
UserHome.class
UserRemote.class
UserBean.class
META-INF
ejb-jar.xml
weblogic-ejb-jar.xml
manifest

In Tomcat
webapp/web
src
com.ingo.struts.bd
UserDelegate.java
UserHome.java
UserRemote.java
com.ingo.struts.action
UserAction.java
class
com.ingo.struts.bd
UserDelegate.class
UserHome.class
UserRemote.class

My JNDI name is userHomeJNDI.

My lookup statement in UserDelegate.java is :
Properties p=new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
p.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context ctx=new InitialContext(p);
UserHome uh=(UserHome)ctx.lookup("userHomeJNDI");

which is giving ClassCastException.Please help me.
reply
    Bookmark Topic Watch Topic
  • New Topic