Announcement Announcement Module
Collapse
No announcement yet.
Issue upgrading to RC1: Init method failed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Issue upgrading to RC1: Init method failed

    I updated to the RC1 version but get the following runtime error when starting the server.

    Here is the stacktrace:

    Code:
    >ERROR   [09:47:13,484] org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:270) - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.findField(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Field;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:217)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:354)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:292)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:262)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:981)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4045)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.findField(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Field;
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:217)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:366)
    	at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:897)
    	at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:294)
    	at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
    	at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:103)
    	at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
    	at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:69)
    	at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
    	at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:70)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1329)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:471)
    	... 33 more
    Caused by: java.lang.NoSuchMethodError: org.springframework.util.ReflectionUtils.findField(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Field;
    	at org.springframework.flex.core.EndpointConfigProcessor.fixFilterChain(EndpointConfigProcessor.java:96)
    	at org.springframework.flex.core.EndpointConfigProcessor.processAfterStartup(EndpointConfigProcessor.java:69)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.processAfterStart(MessageBrokerFactoryBean.java:286)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:166)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1367)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1333)
    	... 54 more

    My webconfig.xml looks like this:

    Code:
    <flex:message-broker />
    	
    	<flex:remoting-destination ref="userFacade" />
    	
    	<!-- Dispatches requests mapped to a MessageBroker -->
    	<bean class="org.springframework.flex.servlet.MessageBrokerHandlerAdapter"/>   
    
    	<!-- URL Mapping -->
    	<bean id="urlHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    		<property name="mappings">
    			<value>
    				/messagebroker/**/* = _messageBroker
    			</value>
    		</property>
    		<property name="alwaysUseFullPath" value="true" />
    	</bean>

  • #2
    I found out that it works fine when changing:

    Code:
    <flex:message-broker />
    
    to 
    
    <bean id="_messageBroker" class="org.springframework.flex.core.MessageBrokerFactoryBean" />
    Something wrong with the namespace?

    Comment


    • #3
      You can use <flex:message-broker /> when you have spring 3.0, but that is not yet an official release.

      If you use spring 2.5, dont use the <flex:....

      but use

      <bean id="_messageBroker"
      class="org.springframework.flex.messaging.MessageB rokerFactoryBean">
      </bean>

      and to make a bean remote:

      <bean id="remoteSomeBean" class="org.springframework.flex.remoting.RemotingD estinationExporter">
      <property name="messageBroker" ref="_messageBroker" />
      <property name="service" ref="someBean" />
      <property name="serviceId" value="someBean" />
      <property name="channels" value="my-amf, my-secure-amf" />
      </bean>

      Originally posted by marcelpanse View Post
      I found out that it works fine when changing:

      Code:
      <flex:message-broker />
      
      to 
      
      <bean id="_messageBroker" class="org.springframework.flex.core.MessageBrokerFactoryBean" />
      Something wrong with the namespace?

      Comment


      • #4
        What version of Spring are you using?

        Looks like the version you are using is missing a method we're using from ReflectionUtils.

        Comment


        • #5
          Peter is right, i updated from spring 2.5 to spring 3.0 and it is working fine now..

          thnx

          Comment


          • #6
            Specifically, which version of 2.5? We are doing all of our development and testing against 2.5.6, so that version should work.

            Comment


            • #7
              it didn't work with 2.5.3

              Comment


              • #8
                message broker

                I get the same error and I am using Spring 2.5.6. Could you kindly verify whether <flex:message...really works with Spring 2.5.6 or am I missing something?

                Comment


                • #9
                  Yes, it definitely works with 2.5.6. See the sample app.

                  Comment


                  • #10
                    Happened to me when I had multiple spring versions on my classpath. Since I cleaned it so as to have only one spring.jar, everything is working fine.

                    Comment

                    Working...
                    X