Skip to main content

Remote Client connects ok to Glassfish. But NOT from Eclipse RCP.

2 replies [Last post]
Joined: 2007-08-01

I have no problem calling remote session beans in a Glassfish 2 server from my "fat" client.
But the exact same code from an eclipse 3.3/3.4 plugin gives me errors. This might be due to Eclipse's class loader tricks, and hopefully there is a way to make it work.

EITHER of the following lookups works ok in a standalone jface/swt client, but not when inside an Eclipse plugin.

(The try-catch is removed in this post.)
InitialContext ctx;
ctx = new InitialContext();
//EITHER of the following 2 lines work. But not when part of a plugin.
TestingSLRemote testingSLRemote = (TestingSLRemote) ctx.lookup("ejb/TestingBean");
TestingSLRemote testingSLRemote = ic.lookup("test.session.interfaces.TestingSLRemote");
And here is the bean/annotation:
public class TestingSLBean implements TestingSLRemote {
I have the following 4 jars defined as a plugin
1. javaee
2. appserv-rt
3. appserv-ext
4. appserv-deployment-client
and my plugin project depending on it.

The error I get is:
"naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial"

I have been googling a few days now trying all kinds of things to no avail.
Please advise.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2009-04-14


I have the very same problem. I could not make it work by specifying the jndi properties directly either.

Did you find any solution for it?

Joined: 2009-04-14

OK, stupid me ... while I had added the various appserv-*.jar files, I did not add them (manually!) to the runtime classpath in the configuration. That fixed it!