PDA

View Full Version : a error when creating messageBroker



fogcreep
Jul 1st, 2009, 12:44 AM
I try to integrate spring with blazeds , but ..i get a problem, when i start tomcat , background throws exception like this


org.springframework.beans.factory.BeanCreationExce ption: 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.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:728)
at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:380)
at org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:4 02)
at org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:316 )
at org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:282)
at org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:126)
at javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
at org.apache.catalina.core.StandardWrapper.loadServl et(StandardWrapper.java:1172)
at org.apache.catalina.core.StandardWrapper.load(Stan dardWrapper.java:992)
at org.apache.catalina.core.StandardContext.loadOnSta rtup(StandardContext.java:4058)
at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4371)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:719)
at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:443)
at org.apache.catalina.core.StandardService.start(Sta ndardService.java:516)
at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalin a.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:413)
Caused by: java.lang.NullPointerException
at org.springframework.util.ReflectionUtils.makeAcces sible(ReflectionUtils.java:412)
at org.springframework.flex.core.MessageBrokerFactory Bean.setInitServletContext(MessageBrokerFactoryBea n.java:303)
at org.springframework.flex.core.MessageBrokerFactory Bean.afterPropertiesSet(MessageBrokerFactoryBean.j ava:139)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.invokeInitMethods(Abstr actAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1335)
... 34 more

and my applicationconfig.xml like this


<?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.MessageBrokerFactory Bean" />
<!-- 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...

jeremyg484
Jul 1st, 2009, 10:52 AM
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?

fogcreep
Jul 1st, 2009, 11:06 AM
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

jeremyg484
Jul 1st, 2009, 11:16 AM
What server are you running on? Are you able to run the testdrive without these errors?

fogcreep
Jul 1st, 2009, 11:26 AM
Tomcat 6.0, i didn't bulided the testdrive yet

jfzlhxd
Jul 9th, 2009, 08:38 PM
I have the same error.
"The matching wildcard is strict, but no declaration can be found for element 'flex:message-broker'."

fogcreep
Jul 10th, 2009, 10:01 AM
i still haven't found how to resolve this error......so i give up to use this method for integrate spring and flex

xaos
Jul 13th, 2009, 07:39 AM
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

fogcreep
Jul 13th, 2009, 09:14 AM
thx a lot , i'll have a try