Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » JNDI within Plugins?
JNDI within Plugins? [message #247263] Sat, 29 May 2004 16:56 Go to next message
Eclipse UserFriend
Originally posted by: hani.naguib.info

Hi I am creating a plugin to administer a J2EE server and am running
into some classpath issues which I am findind hard to resolve. I hope
someone here may be able to help me. Thanks in advance.

My J2EE application is running under Weblogic and has a session bean
called MyServerBean

I have a class in my plugin which is meant to act as a model to this
bean calles MyServerModel. To initialize itself it has to talk to my
bean and get some information, here is where I am having problems.

I get access to the bean through a JNDI lookup:
Hashtable props = new Hashtable();
props.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory ");
props.put("java.naming.provider.url","t3://localhost:7001/");
InitialContext ctx = new InitialContext(props);

But when I try to do this I get a:
----
javax.naming.NoInitialContextException:
Cannot instantiate class:
weblogic.jndi.WLInitialContextFactory
----

BUT
1- I have placed Weblogic's client library in the plugin
2- Tried putting it in my machines CLASSPATH
2- I can even do this:
Class.forName("weblogic.jndi.WLInitialContextFactory");
So the class is there, but I suspect that JNDI looks it up in a strange way.

Has anyone run into this problem? Am I missing something trivial?

Thanks everyone
Hani
Re: JNDI within Plugins? [message #247268 is a reply to message #247263] Sat, 29 May 2004 17:20 Go to previous message
Eclipse UserFriend
Originally posted by: hani.naguib.info

Ok I found the solution, actually presented on another thread
by Igor Fedorento (Re: Connect RCP application to JBoss JNDI server errors)

Basically when I do the look up I need to set the current thread's classloader to
that of my plugin

hani@naguib.info wrote:

> Hi I am creating a plugin to administer a J2EE server and am running
> into some classpath issues which I am findind hard to resolve. I hope
> someone here may be able to help me. Thanks in advance.
>
> My J2EE application is running under Weblogic and has a session bean
> called MyServerBean
>
> I have a class in my plugin which is meant to act as a model to this
> bean calles MyServerModel. To initialize itself it has to talk to my
> bean and get some information, here is where I am having problems.
>
> I get access to the bean through a JNDI lookup:
> Hashtable props = new Hashtable();
> props.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory ");
>
> props.put("java.naming.provider.url","t3://localhost:7001/");
> InitialContext ctx = new InitialContext(props);
>
> But when I try to do this I get a:
> ----
> javax.naming.NoInitialContextException:
> Cannot instantiate class:
> weblogic.jndi.WLInitialContextFactory
> ----
>
> BUT
> 1- I have placed Weblogic's client library in the plugin
> 2- Tried putting it in my machines CLASSPATH
> 2- I can even do this:
> Class.forName("weblogic.jndi.WLInitialContextFactory");
> So the class is there, but I suspect that JNDI looks it up in a strange
> way.
>
> Has anyone run into this problem? Am I missing something trivial?
>
> Thanks everyone
> Hani
Previous Topic:How do i integrate new downloaded plugins with eclipse
Next Topic:M9 L&F is really nice
Goto Forum:
  


Current Time: Sat Jun 07 22:41:57 EDT 2025

Powered by FUDForum. Page generated in 0.03205 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top