Announcement Announcement Module
Collapse
No announcement yet.
interface is not visible from class loader Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • interface is not visible from class loader

    Hi,

    I want to access my remoting service from my eclipse rcp client (osgi). Unfortunately my service interface could not be loaded from the class loader:

    java.lang.IllegalArgumentException: interface MyService is not visible from class loader
    at java.lang.reflect.Proxy.getProxyClass(Proxy.java:3 53)
    at java.lang.reflect.Proxy.newProxyInstance(Proxy.jav a:581)
    at org.springframework.aop.framework.JdkDynamicAopPro xy.getProxy(JdkDynamicAopProxy.java:117)
    at org.springframework.aop.framework.ProxyFactory.get Proxy(ProxyFactory.java:112)
    at org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean.afterPropertiesSet(HttpInvokerP roxyFactoryBean.java:62)

    It works from a test client without osgi.

    I have dynamic number of connections to different server and determine the services like this:

    final HttpInvokerProxyFactoryBean httpInvokerProxyFactoryBean = new HttpInvokerProxyFactoryBean(); httpInvokerProxyFactoryBean.setServiceInterface(Ic rMonitorService.class);
    httpInvokerProxyFactoryBean.setServiceUrl(theUrl);
    httpInvokerProxyFactoryBean.afterPropertiesSet();

    MyService service = (MyService ) httpInvokerProxyFactoryBean.getObject();

    Any idea ? Tried Eclipse-BuddyPolicy and RegisterBuddy without success.

    Regards,
    Oliver

  • #2
    After synchronization of the product file now this occurs:

    java.lang.IllegalArgumentException: interface org.springframework.aop.SpringProxy is not visible from class loader

    but I added spring aop as dependent bundle.

    Comment


    • #3
      It works, if the instantiation of the org.springframework.remoting.httpinvoker.HttpInvok erProxyFactoryBean is done in the applicationcontext.xml file. The error occurs if I instantiate it by myself how described. But I have to manage serveral servers dynamic. Any idea how to solve this?

      Comment


      • #4
        I had the same problem.
        Use httpInvokerProxyFactoryBean.setBeanClassLoader(get Class().getClassLoader()); before httpInvokerProxyFactoryBean.afterPropertiesSet();

        Comment


        • #5
          Originally posted by arham View Post
          I had the same problem.
          Use httpInvokerProxyFactoryBean.setBeanClassLoader(get Class().getClassLoader()); before httpInvokerProxyFactoryBean.afterPropertiesSet();
          OK,I will try~!

          Comment

          Working...
          X