RAP in Geronimo/EJB lookups [message #1257645] |
Wed, 26 February 2014 17:05 |
Roland Welker Messages: 13 Registered: October 2013 |
Junior Member |
|
|
Hi,
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:
Quote:
<ejb-ref>
<ejb-ref-name>TestMeRemote</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<remote>com.switchedonsystems.test.interfaces.ITestMe</remote>
</ejb-ref>
The code execution fails with the lookup call on the InitialContext with the following exception:
Quote:
java.lang.IllegalArgumentException: interface org.apache.openejb.client.EJBObjectProxy is not visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:370)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:598)
at org.apache.openejb.client.proxy.Jdk13ProxyFactory.newProxyInstance(Jdk13ProxyFactory.java:118)
at org.apache.openejb.client.proxy.ProxyManager.newProxyInstance(ProxyManager.java:107)
at org.apache.openejb.client.EJBObjectHandler.createEJBObjectProxy(EJBObjectHandler.java:134)
at org.apache.openejb.client.JNDIContext.createBusinessObject(JNDIContext.java:193)
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:234)
at org.apache.aries.jndi.DelegateContext.lookup(DelegateContext.java:161)
at javax.naming.InitialContext.lookup(InitialContext.java:409)
at com.switchedonsystems.test.ui.View$1.widgetSelected(View.java:147)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:262)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:85)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:700)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:602)
at org.eclipse.swt.widgets.Display.executeNextEvent(Display.java:1205)
at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1186)
at org.eclipse.swt.widgets.Display.safeReadAndDispatch(Display.java:1169)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1161)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:701)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:684)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
at com.switchedonsystems.test.ui.SOSEntryPoint.createUI(SOSEntryPoint.java:15)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:186)
at org.eclipse.rap.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:298)
at java.lang.Thread.run(Thread.java:636)
at org.eclipse.rap.rwt.internal.lifecycle.UIThread.run(UIThread.java:104)
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,
Roland
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03526 seconds