Results 1 to 5 of 5

Thread: interface is not visible from class loader

Hybrid View

  1. #1
    Join Date
    Apr 2011
    Posts
    3

    Default 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. #2
    Join Date
    Apr 2011
    Posts
    3

    Default

    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.

  3. #3
    Join Date
    Apr 2011
    Posts
    3

    Default

    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?

  4. #4
    Join Date
    Jul 2011
    Posts
    1

    Default

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

  5. #5

    Default

    Quote Originally Posted by arham View Post
    I had the same problem.
    Use httpInvokerProxyFactoryBean.setBeanClassLoader(get Class().getClassLoader()); before httpInvokerProxyFactoryBean.afterPropertiesSet();
    OK,I will try~!
    What we think, we become.Just like Free Video Converter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •