Announcement Announcement Module
Collapse
No announcement yet.
a error when creating messageBroker Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • a error when creating messageBroker

    I try to integrate spring with blazeds , but ..i get a problem, when i start tomcat , background throws exception like this

    Code:
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_messageBroker' defined in ServletContext resource [/WEB-INF/application-config.xml]: Invocation of init method failed; nested exception is java.lang.NullPointerException
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
    	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:222)
    	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:423)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
    	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:1172)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:992)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4058)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4371)
    	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:578)
    	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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: java.lang.NullPointerException
    	at org.springframework.util.ReflectionUtils.makeAccessible(ReflectionUtils.java:412)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.setInitServletContext(MessageBrokerFactoryBean.java:303)
    	at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:139)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
    	... 34 more
    and my applicationconfig.xml like this

    Code:
    <?xml version="1.0" encoding="UTF-8"?>  
    <beans xmlns="http://www.springframework.org/schema/beans"  
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
     xmlns:flex="http://www.springframework.org/schema/flex"  
     xsi:schemaLocation="   
     http://www.springframework.org/schema/beans   
     http://www.springframework.org/schema/beans/spring-beans-2.5.xsd   
     http://www.springframework.org/schema/flex   
     http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">     
     <!-- Spring Beansís -->  
     <bean id="myService" class="MyServiceImpl" />  
     <!-- Simplest possible message broker -->    
    <bean id="_messageBroker" class="org.springframework.flex.core.MessageBrokerFactoryBean" />
      <!-- exposes myService as BlazeDS destination -->  
     <flex:remoting-destination ref="myService" />  
    </beans>

    my spring version is 2.5.6 .... i have no idea why this happend...

  • #2
    Why are you using the MessageBrokerFactoryBean directly? Do you get the same error when using the <flex:message-broker> tag? Do you have the DispatcherServlet configured in web.xml?

    Comment


    • #3
      uh...i get the same error if user the <flex:message-broker> tag. so i try to user the direct config.
      and the DispatcherServlet be configured in web.xml already

      Comment


      • #4
        What server are you running on? Are you able to run the testdrive without these errors?

        Comment


        • #5
          Tomcat 6.0, i didn't bulided the testdrive yet

          Comment


          • #6
            I have the same error.
            "The matching wildcard is strict, but no declaration can be found for element 'flex:message-broker'."

            Comment


            • #7
              i still haven't found how to resolve this error......so i give up to use this method for integrate spring and flex

              Comment


              • #8
                Actually I'm playing with BlazeDS on dm Server, but anyway its the same Tomcat at the end

                I think I had similar error when my installation was missing some dependency libraries. Check if you have all of them.

                These are the libraries I had to install
                com.springsource.edu.emory.mathcs.backport-2.2.0.jar
                com.springsource.flex.messaging-3.2.0.3978.jar
                com.springsource.flex.messaging.common-3.2.0.3978.jar
                com.springsource.flex.messaging.services.remoting-3.2.0.3978.jar
                com.springsource.net.sf.cglib-2.1.3.jar
                com.springsource.org.apache.bcel-5.2.0.jar
                com.springsource.org.apache.commons.codec-1.3.0.jar
                com.springsource.org.apache.commons.collections-3.2.1.jar
                com.springsource.org.apache.xalan-2.7.0.jar
                com.springsource.org.apache.xerces-2.8.1.jar
                com.springsource.org.apache.xml.resolver-1.2.0.jar
                com.springsource.org.apache.xmlcommons-1.3.3.jar
                com.springsource.org.codehaus.jackson-1.0.0.jar
                com.springsource.org.jgroups-2.5.1.jar
                org.springframework.flex-1.0.0.RELEASE.jar
                org.springframework.integration-1.0.2.SR1.jar
                org.springframework.security-2.0.4.A.jar
                in addition to the libraries already present on the dm Server
                com.springsource.com.google.common.collect-0.5.0.alpha.jar
                com.springsource.edu.emory.mathcs.backport-3.0.0.jar
                com.springsource.javax.annotation-1.0.0.jar
                com.springsource.javax.ejb-3.0.0.jar
                com.springsource.javax.el-1.0.0.jar
                com.springsource.javax.jms-1.1.0.jar
                com.springsource.javax.mail-1.4.0.jar
                com.springsource.javax.persistence-1.0.0.jar
                com.springsource.javax.servlet-2.5.0.jar
                com.springsource.javax.servlet.jsp-2.1.0.jar
                com.springsource.javax.servlet.jsp.jstl-1.1.2.jar
                com.springsource.javax.xml.rpc-1.1.0.jar
                com.springsource.javax.xml.soap-1.3.0.jar
                com.springsource.javax.xml.stream-1.0.1.jar
                com.springsource.javax.xml.ws-2.1.1.jar
                com.springsource.json-1.0.1.RELEASE.jar
                com.springsource.org.antlr-3.0.1.jar
                com.springsource.org.aopalliance-1.0.0.jar
                com.springsource.org.apache.catalina-6.0.18.jar
                com.springsource.org.apache.catalina.ha-6.0.18.jar
                com.springsource.org.apache.catalina.tribes-6.0.18.jar
                com.springsource.org.apache.commons.fileupload-1.2.0.jar
                com.springsource.org.apache.commons.io-1.4.0.jar
                com.springsource.org.apache.coyote-6.0.18.jar
                com.springsource.org.apache.el-6.0.18.jar
                com.springsource.org.apache.jasper-6.0.18.jar
                com.springsource.org.apache.jasper.org.eclipse.jdt-6.0.18.jar
                com.springsource.org.apache.juli.extras-6.0.18.jar
                com.springsource.org.apache.taglibs.standard-1.1.2.jar
                com.springsource.org.aspectj.runtime-1.6.2.RELEASE.jar
                com.springsource.org.aspectj.weaver-1.6.2.RELEASE.jar
                com.springsource.slf4j.org.apache.log4j-1.5.6.jar
                org.eclipse.equinox.cm-1.0.0.v20080509-1800.jar
                org.eclipse.osgi.services-3.1.200.v20071203.jar
                org.springframework.aop-2.5.6.A.jar
                org.springframework.aspects-2.5.6.A.jar
                org.springframework.beans-2.5.6.A.jar
                org.springframework.context-2.5.6.A.jar
                org.springframework.context.support-2.5.6.A.jar
                org.springframework.core-2.5.6.A.jar
                org.springframework.jdbc-2.5.6.A.jar
                org.springframework.jms-2.5.6.A.jar
                org.springframework.orm-2.5.6.A.jar
                org.springframework.osgi.core-1.1.3.RELEASE.jar
                org.springframework.osgi.extender-1.1.3.RELEASE.jar
                org.springframework.osgi.io-1.1.3.RELEASE.jar
                org.springframework.transaction-2.5.6.A.jar
                org.springframework.web-2.5.6.A.jar
                org.springframework.web.servlet-2.5.6.A.jar

                Comment


                • #9
                  thx a lot , i'll have a try

                  Comment

                  Working...
                  X