Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [riena-dev] Interface not visible from class loader!

Hi Yau,

Try adding:
Eclipse-RegisterBuddy: org.eclipse.riena.communication.core
to the manifest.mf of your common bundle.

See also in the ping pong example bundle: org.eclipse.riena.communication.sample.pingpong.common

Tschüß,
Stefan

yau wrote:
Hi, Stefan Liebig
Thanks for your reply!


  
In your common bundle:
- is the interface ITestService
- in it´s activator it references ITestService the first time  with
    
Class<?> servIntf = ITestService.class; (does not fail here!)

Yes, I run in debug mode and set a bookmark on the statement:
Class<?> servIntf = ITestService.class;
and step over, it is not failed.



  
- and than fails with an exception when creating the proxy
    
Yes, an exception raised at
rsf.createAndRegisterProxy(servIntf, url, protocol, context);




  
Can you please provide a stacktrace, the activator and the ITestService?
    

The common plugin activator:
=========================
package cn.com.dwservice.dw2appservcommon;
import ....;

public class Activator implements BundleActivator {

 private RemoteServReg remoteServReg;

 public void start(BundleContext context) throws Exception {
  remoteServReg = new RemoteServReg();
  remoteServReg.start(context);
 }

 public void stop(BundleContext context) throws Exception {
  if (remoteServReg != null) {
   remoteServReg.stop(context);
   remoteServReg = null;
  }
 }


The RemoteServReg.java
=============================
package cn.com.dwservice.dw2appservcommon;
import ....;

public class RemoteServReg {

 private IRemoteServiceRegistration remoteServReg;

 public void start(BundleContext context) throws Exception {
  RemoteServiceFactory rsf = new RemoteServiceFactory();
  Class<?> servIntf = ITestService.class;
  String url = "" class="moz-txt-link-rfc2396E" href="http://127.0.0.1:8080/dwserver/test/testService">"http://127.0.0.1:8080/dwserver/test/testService";
  String protocol = DWServConsts.REMOTE_PROTOCOL_HESSIAN;

  remoteServReg = rsf.createAndRegisterProxy(servIntf, url, protocol, context);
 }

 public void stop(BundleContext context) throws Exception {
  if (remoteServReg != null) {
   remoteServReg.unregister();
   remoteServReg = null;
  }
 }
}


The ITestService.java
============================
package cn.com.dwservice.dw2appservcommon.model;

public interface ITestService {
 String testPermission();
}



The following is the stacktrace:
=====================

java.lang.NoClassDefFoundError: cn/com/dwservice/dw2appservcommon/model/ITestService
 at cn.com.dwservice.dwserver2.tests.TestRienaWebService.internalRun(TestRienaWebService.java:54)
 at net.yau.eclipse.common.dialogs.TestRunnableObjBase.run(TestRunnableObjBase.java:29)
 at net.yau.eclipse.common.dialogs.SelectiveRunDialog$1.widgetSelected(SelectiveRunDialog.java:91)
 at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
 at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
 at org.eclipse.jface.window.Window.open(Window.java:801)
 at cn.com.dwservice.dwserver2.tests.TestAction.run(TestAction.java:46)
 at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
 at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
 at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
 at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
 at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
 at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
 at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
 at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2384)
 at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2348)
 at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2200)
 at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:495)
 at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
 at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:490)
 at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
 at cn.com.dwservice.dwserver2.Application.start(Application.java:20)
 at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
 at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386)
 at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
 at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
 at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
 at org.eclipse.equinox.launcher.Main.main(Main.java:1212)


Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle cn.com.dwservice.dw2AppServCommon (194).
 at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:125)
 at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:427)
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:370)
 at org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:443)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399)
 at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387)
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
 ... 40 more


Caused by: org.osgi.framework.BundleException: Exception in cn.com.dwservice.dw2appservcommon.Activator.start() of bundle cn.com.dwservice.dw2AppServCommon.
 at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1028)
 at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
 at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
 at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
 at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
 at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
 ... 50 more


Caused by: java.lang.IllegalArgumentException: interface cn.com.dwservice.dw2appservcommon.model.ITestService is not visible from class loader
 at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
 at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
 at com.caucho.hessian.client.HessianProxyFactory.create(HessianProxyFactory.java:394)
 at com.caucho.hessian.client.HessianProxyFactory.create(HessianProxyFactory.java:354)
 at org.eclipse.riena.internal.communication.factory.hessian.RemoteServiceFactoryHessian.createProxy(RemoteServiceFactoryHessian.java:73)
 at org.eclipse.riena.internal.communication.factory.hessian.RemoteServiceFactoryHessian.createProxy(RemoteServiceFactoryHessian.java:1)
 at org.eclipse.riena.communication.core.factory.RemoteServiceFactory.createProxy(RemoteServiceFactory.java:233)
 at org.eclipse.riena.communication.core.factory.RemoteServiceFactory.createAndRegisterProxy(RemoteServiceFactory.java:148)
 at org.eclipse.riena.communication.core.factory.RemoteServiceFactory.createAndRegisterProxy(RemoteServiceFactory.java:125)
 at cn.com.dwservice.dw2appservcommon.RemoteServReg.start(RemoteServReg.java:25)
 at cn.com.dwservice.dw2appservcommon.Activator.start(Activator.java:16)
 at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
 at java.security.AccessController.doPrivileged(Native Method)
 at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
 ... 55 more


Regards,
Yau
  


Back to the top