Announcement Announcement Module
Collapse
No announcement yet.
RMI: java.lang.NoSuchMethodError Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RMI: java.lang.NoSuchMethodError

    Hi,
    when I try to call a service via RMI from a webapp, I get the following error:

    Code:
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'documentService' defined in class path resource [remoting.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.aop.framework.ProxyFactory.<init>(Ljava/lang/Class;Lorg/aopalliance/intercept/Interceptor;)V
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1175)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:91)
    	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:75)
    	... 22 more
    Caused by: java.lang.NoSuchMethodError: org.springframework.aop.framework.ProxyFactory.<init>(Ljava/lang/Class;Lorg/aopalliance/intercept/Interceptor;)V
    	at org.springframework.remoting.rmi.RmiProxyFactoryBean.afterPropertiesSet(RmiProxyFactoryBean.java:78)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
    	... 32 more
    When I call it from a stand alone app, it works fine.

    So I think there are incompatibilities in the classes in the tons of jars (spring, spring-web, hibernate, jpa, ...) in the webapps lib directory.

    But I have no clue where to start

  • #2
    I have turned DEBUG on:

    Code:
    $  DEBUG; 2007-09-19 14:41:23,843;       main; ; ; ; RmiClientInterceptor.lookupStub(201); Located RMI stub with URL [rmi://localhost:1111/bpcsds]
    $  DEBUG; 2007-09-19 14:41:23,843;       main; ; ; ; RmiClientInterceptor.prepare(148); RMI stub [rmi://localhost:1111/bpcsds] is an RMI invoker
    $   INFO; 2007-09-19 14:41:23,843;       main; ; ; ; DefaultSingletonBeanRegistry.destroySingletons(285); Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1c935cc: defining beans [documentService,remoteInvocationFactory]; root of factory hierarchy
    So the rmi lookup is already done (does not work if the rmi sever is down).

    But I still have no idea how I can fix the error

    Comment


    • #3
      Well, fixed it.
      The mismatch was between spring.jar and spring-aop.jar.
      I have delete spring-aop.jar and everything went fine.

      What I do not really understand is:

      Which spring-jars do I need additionally to spring.jar?
      spring-webmvc.jar is required, but spring-web.jar not...
      Is this anywhere documented, what do I need and what not for what kind of application?

      Comment


      • #4
        Quote from readme.txt file of spring distribution zip file:
        FULL JAR (dist):

        * "spring" (~2920 KB)
        - Convenient jar file combining all standard modules (except for the test module and the Portlet/Struts support)
        - Also includes the AOP Alliance interfaces (as a convenience)!
        - Does not include contents of spring-aspects.jar, spring-test.jar, spring-webmvc-portlet and spring-webmvc-struts.jar!
        And there you find info about all other distribution jar files.

        Comment

        Working...
        X