Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP in Geronimo/EJB lookups(Looking up EJBs in RAP within Geronimo App Server)
RAP in Geronimo/EJB lookups [message #1257645] Wed, 26 February 2014 17:05 Go to next message
Roland Welker is currently offline Roland Welker
Messages: 10
Registered: October 2013
Junior Member

I have been trying for a while to get a RAP applications to work within Geronimo and consume EJBs.

So far I have used a Jetty frontend to the application server, however I would like to be able to deploy the RAP application with the rest of EAR without seperating it into 2 servers.

I have setup a simple test program to demostrate the issue. A simple ejb, returning a string.
And a simple RAP application with a view and a button. Once the button is clicked, the InitialContext is created, the EJB looked up and the business method invoked.
The EJB project and the RAP war are deployed as part of a EAR.

This is the relevant (and failing) code in the view:
					Properties prop = new Properties();
					prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
					prop.put("java.naming.provider.url", "ejbd://localhost:4201");
					prop.setProperty(Context.SECURITY_PRINCIPAL, "system");
					prop.setProperty(Context.SECURITY_CREDENTIALS, "manager");
					prop.setProperty("openejb.authentication.realmName", "geronimo-admin"); 
					InitialContext ServerConnection = new InitialContext(prop);
					ITestMe remote = (ITestMe)ServerConnection.lookup("TestMeRemote");
					System.out.println("Client: " + remote.sayHello("Hello"));

The web.xml contains an ejb reference as such:


The code execution fails with the lookup call on the InitialContext with the following exception:

java.lang.IllegalArgumentException: interface org.apache.openejb.client.EJBObjectProxy is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(
at java.lang.reflect.Proxy.newProxyInstance(
at org.apache.openejb.client.proxy.Jdk13ProxyFactory.newProxyInstance(
at org.apache.openejb.client.proxy.ProxyManager.newProxyInstance(
at org.apache.openejb.client.EJBObjectHandler.createEJBObjectProxy(
at org.apache.openejb.client.JNDIContext.createBusinessObject(
at org.apache.openejb.client.JNDIContext.lookup(
at org.apache.aries.jndi.DelegateContext.lookup(
at javax.naming.InitialContext.lookup(
at com.switchedonsystems.test.ui.View$1.widgetSelected(
at org.eclipse.swt.widgets.TypedListener.handleEvent(
at org.eclipse.swt.widgets.EventTable.sendEvent(
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Widget.notifyListeners(
at org.eclipse.swt.widgets.Display.executeNextEvent(
at org.eclipse.swt.widgets.Display.runPendingMessages(
at org.eclipse.swt.widgets.Display.safeReadAndDispatch(
at org.eclipse.swt.widgets.Display.readAndDispatch(
at org.eclipse.ui.internal.Workbench.runEventLoop(
at org.eclipse.ui.internal.Workbench.runUI(
at org.eclipse.ui.internal.Workbench.access$5(
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault(
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
at com.switchedonsystems.test.ui.SOSEntryPoint.createUI(
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$

If I wrap the whole remote section of the code into RWT.requestThreadExec, it fails with the same error.

Any help would be appreciated.

Thank you,
Re: RAP in Geronimo/EJB lookups [message #1257655 is a reply to message #1257645] Wed, 26 February 2014 17:17 Go to previous messageGo to next message
Roland Welker is currently offline Roland Welker
Messages: 10
Registered: October 2013
Junior Member
Small additon. the ejb spec, openejb client implementation and geronimo security are included in my plugin as jar files
Re: RAP in Geronimo/EJB lookups [message #1258315 is a reply to message #1257655] Thu, 27 February 2014 09:02 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEY
Messages: 131
Registered: March 2010
Location: France
Senior Member

are you using WAR product and Equinox Servlet Bridge ? if yes,
you can change your launch.ini like this


It should solve the issue

Also you should not need properties to instanciate your initialContext if your web app is in the EAR, this should work:

InitialContext ServerConnection = new InitialContext();

ITestMe remote = (ITestMe)ServerConnection.lookup("TestMeRemote");

System.out.println("Client: " + remote.sayHello("Hello"));

Re: RAP in Geronimo/EJB lookups [message #1258749 is a reply to message #1258315] Thu, 27 February 2014 18:19 Go to previous message
Roland Welker is currently offline Roland Welker
Messages: 10
Registered: October 2013
Junior Member
Thank you very much for your reply.

Yes, I am using the equinox bridge. And I have figured out my mistake.

I added my app server related jars to the library section of the war deployment tool and added the following to the launch.ini file:


with the exported packages of the jars in it.

And that did do the trick.

Previous Topic:Entry point / not working in WAR
Next Topic:[ANN] RAP 2.1.2 is available
Goto Forum:

Current Time: Tue Sep 16 15:33:36 GMT 2014

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

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