• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Cannot Access EJB on Weblogic ???

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! Friends,
Am trying to access a Stateless EJB(deployed on Weblogic 8.1) through a servlet running on 9i AS, but is giving an exception as below :
NamingException Thrown : Cannot instantiate class: weblogic.jndi.WLInitialContextFactory

The code snippet in my Servlet is as follows:
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL, "t3://10.127.0.1:7001");
Context context = new InitialContext(prop);

I have put weblogic.jar in lib directory under WEB-INF.
It's working fine if the Servlet is called from Weblogic itself.
Any help is highly appreciated. Thanks in advance.

-Navin.
 
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've never tried doing what you're doing, but you'll find that weblogic.jndi.WLInitialContextFactory class isn't in weblogic.jar, it's in wlclient.jar.
 
Ranch Hand
Posts: 1143
1
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kumar,
Pardon me if this is a silly question, but why are you mixing two application servers? For your information, Oracle 9iAS is also an EJB server. Perhaps you could just deploy your EJB to Oracle 9iAS -- and remove WebLogic from the equation?
(Or am I missing something?)

Good Luck,
Avi.
 
Kumar Navin
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi! Avi,
quote:"pardon me if this is a silly question......" unquote.
But the task here is seperated. Certain issues in AS unknown at my level has forced to opt for another server. Now, even the thing might be moved to Tomcat, if the issues are not resolved.

Hi! Carol,
Tried the wlclient.jar, but didn't work. Nevertheless weblogic.jar also contains weblogin.jndi.WLInitialContextFactory class

Regards,
-Navin.
 
Carol Enderlin
drifter
Posts: 1364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmm, guess my brain was taking a coffee break when I checked that jar for that class.

Have you tried putting the jar on the system classpath?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to have the following files in your classpath
ecutils.jar, ffdc.jar, files.txt, idl.jar, iwsorb.jar, j2ee.jar, naming.jar, namingclient.jar, ras.jar, tx.jar, txPrivate.jar, utils.jar, wsexception.jar, xerces.jar

And also the properties file: implfactory.properties in your classpath.

Mahesh S
 
reply
    Bookmark Topic Watch Topic
  • New Topic