UPDATE 1: Flash Builder 4, BlazeDS 4, and Spring 1.0.3 have all been release so you no longer have to use beta or nightly builds of these products. Use the production versions!
UPDATE 2: I’ve done a second part to this screencast that combines Flex 4, Flash Builder 4, Spring 3, BlazeDS 4, and Hibernate 3.
Connecting a Flex 4 application to a Java / Spring back-end couldn’t be easier in Flash Builder 4′s new Data Wizards. I’ve recorded a screencast that shows how to set up the web application project, configure Spring & BlazeDS, and then build a Flex 4 application that connects to the Java / Spring back-end. Check it out and let me know what you think.
(Open full-size video in a new window)


45 Comments
I’m not a big Eclipse fan, which is why I usually tried to do as less as possible in Flex Builder and as much as I could in IntelliJ. But I must say this is pretty impressive stuff. Plus, it doesn’t seem to generate to much black magic code, except for the proxy service and the RDS servlet, which is very important to keep the readability of the code. I’ve got a few questions though:
- don’t you need to compile your Flex client against services-config.xml like it used to be the case with Flex 3?
- does Flash Builder generate Ant scripts to do all the build in headless mode for continuous integration?
- did you use Spring BlazeDS integration library at all in this example?
- how did Flash Builder find on which host and port it could find the RDS servlet to do the introspection?
Oh one last question: could you please publish the projects from the video so that we can try this at home?
Very useful, thanks a lot! Can’t wait to see the second part!
Hi Sébastien,
Thanks for asking these great questions! :)
- don’t you need to compile your Flex client against services-config.xml like it used to be the case with Flex 3?
No because I configured the ChannelSet manually. However by specifying J2EE (uck…) as the server type it automatically adds this. However I could remove it and everything would still functional normally.
- does Flash Builder generate Ant scripts to do all the build in headless mode for continuous integration?
In Flash Builder 4 there is a way to launch a build from an Ant script. It essentially starts a headless instance of FB and does the build. If you give it a try let me know how it works for you.
- did you use Spring BlazeDS integration library at all in this example?
Yes. I had the jar in my libs that I copied over. It has to be a recent nightly build in order to work like I show in the screencast.
- how did Flash Builder find on which host and port it could find the RDS servlet to do the introspection?
In the project creation wizard I specified those parameters.
- could you please publish the projects from the video so that we can try this at home?
I’ll give that a try and post here when I get it posted.
-James
Hey James,
Sorry if this comes across harshly – I just see the evangelists as folks to whom it’s fair to ask this kind of question – but how is any of this an improvement over Flex 3?
What benefit does the wizard you used actually provide? It generated services.FooService, but it looks like nothing but a wrapper around a RemoteObject. If it created wrappers for the actual services methods, I could see some benefit, but why not just skip the wizard and use ?
As far as the MXML goes, is the Flex 4 S.O.P. really going to be to declare ChannelSets inline? I mean, we’d all just do it once in a Swiz/Mate/etc. configuration file anyhow, but I can’t see this being a good thing to show a RIA newbie or, worse yet, someone architecturally minded. I can’t look at an example that hard-codes a URL into the view tier without wincing. If we’re going to have a pile of tooling in Flash Builder 4, maybe something to easily externalize this stuff would be appropriate?
The only thing I see that I don’t already have with Flex 3 and Spring integration is the Data / Services tab, but I can get the same thing by just drilling open the class to look at its methods.
James,
I tried this out, getting exception trying to startup the server. Any clue as to what can cause this:
Jan 13, 2010 9:40:01 AM com.springsource.tcserver.security.PropertyDecoder
INFO: tcServer property decoder has been initialized.
Jan 13, 2010 9:40:02 AM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:springFlex-server’ did not find a matching property.
Jan 13, 2010 9:40:02 AM com.springsource.tcserver.serviceability.rmi.JmxSocketListener init
INFO: Started up JMX registry on 127.0.0.1:6969
Jan 13, 2010 9:40:02 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jan 13, 2010 9:40:02 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 872 ms
Jan 13, 2010 9:40:02 AM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jan 13, 2010 9:40:02 AM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: SpringSource tc Server/6.0.20.C
Jan 13, 2010 9:40:04 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet ‘dispatcherServlet’
Jan 13, 2010 9:40:04 AM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet ‘dispatcherServlet’: initialization started
Jan 13, 2010 9:40:04 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace ‘dispatcherServlet-servlet’: startup date [Wed Jan 13 09:40:04 EST 2010]; root of context hierarchy
Jan 13, 2010 9:40:04 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]
Jan 13, 2010 9:40:06 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1396ef7: defining beans [_messageBrokerHandlerAdapter,_messageBrokerDefaultHandlerMapping,_jsonConfigMapEditorConfigurer,_messageBrokerMessagingProcessor,_flexRemotingAnnotationPostProcessor,_messageBrokerRemotingProcessor,org.springframework.flex.core.ExceptionTranslationAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#0,org.springframework.flex.core.MessageInterceptionAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#1,_messageBrokerEndpointProcessor,_messageBroker,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,fooService,org.springframework.flex.remoting.RemotingDestinationExporter#0]; root of factory hierarchy
Jan 13, 2010 9:40:07 AM org.springframework.flex.config.FlexConfigurationManager$ResourceResolverAdapter getConfigurationFile
INFO: Loading Flex services configuration from: ServletContext resource [/WEB-INF/flex/services-config.xml]
Jan 13, 2010 9:40:07 AM org.springframework.flex.config.FlexConfigurationManager$ResourceResolverAdapter getIncludedFile
INFO: Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/remoting-config.xml]
[BlazeDS]The class loader could not locate the string resource property file ‘flex/messaging/errors_en_US.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors_en_US.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/messaging/errors_en.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors_en.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/messaging/errors_en_US.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors_en_US.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/messaging/errors_en.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors_en.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/messaging/errors_en_US.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors_en_US.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/messaging/errors_en.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors_en.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/messaging/errors_en_US.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors_en_US.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/messaging/errors_en.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors_en.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
[BlazeDS]The class loader could not locate the string resource property file ‘flex/data/errors.properties’. This may not be an issue if a property file is available for a less specific locale or the default locale.
Jan 13, 2010 9:40:07 AM org.springframework.flex.core.MessageBrokerFactoryBean afterPropertiesSet
INFO: BlazeDS – Community Edition: 4.0.0.13441
[BlazeDS]No login command was found for ‘SpringSource tc Server/6.0.20.C’. Please ensure that the login-command tag has the correct server attribute value, or use ‘all’ to use the login command regardless of the server.
Jan 13, 2010 9:40:07 AM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1396ef7: defining beans [_messageBrokerHandlerAdapter,_messageBrokerDefaultHandlerMapping,_jsonConfigMapEditorConfigurer,_messageBrokerMessagingProcessor,_flexRemotingAnnotationPostProcessor,_messageBrokerRemotingProcessor,org.springframework.flex.core.ExceptionTranslationAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#0,org.springframework.flex.core.MessageInterceptionAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#1,_messageBrokerEndpointProcessor,_messageBroker,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,fooService,org.springframework.flex.remoting.RemotingDestinationExporter#0]; root of factory hierarchy
Jan 13, 2010 9:40:07 AM org.springframework.web.servlet.FrameworkServlet initServletBean
SEVERE: 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 org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:561)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
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:587)
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:290)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘_messageBroker’: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:392)
at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1024)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:370)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:71)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.doProcess(ApplicationContextAwareProcessor.java:116)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:99)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
… 31 more
Caused by: org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
… 50 more
Caused by: flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:70)
at flex.messaging.MessageBroker.createEndpoint(MessageBroker.java:574)
at flex.messaging.config.MessagingConfiguration.createEndpoints(MessagingConfiguration.java:298)
at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:113)
at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:149)
… 52 more
Jan 13, 2010 9:40:07 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
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 org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:561)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
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:587)
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:290)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘_messageBroker’: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:392)
at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1024)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:370)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:71)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.doProcess(ApplicationContextAwareProcessor.java:116)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:99)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
… 31 more
Caused by: org.springframework.beans.factory.BeanInitializationException: MessageBroker initialization failed; nested exception is flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:185)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
… 50 more
Caused by: flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:70)
at flex.messaging.MessageBroker.createEndpoint(MessageBroker.java:574)
at flex.messaging.config.MessagingConfiguration.createEndpoints(MessagingConfiguration.java:298)
at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:113)
at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:149)
… 52 more
Jan 13, 2010 9:40:07 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /springFlex-server threw load() exception
flex.messaging.MessageException: Cannot create class of type ”. Type ” not found.
at flex.messaging.util.ClassUtil.createClass(ClassUtil.java:70)
at flex.messaging.MessageBroker.createEndpoint(MessageBroker.java:574)
at flex.messaging.config.MessagingConfiguration.createEndpoints(MessagingConfiguration.java:298)
at flex.messaging.config.MessagingConfiguration.configureBroker(MessagingConfiguration.java:113)
at org.springframework.flex.core.MessageBrokerFactoryBean.afterPropertiesSet(MessageBrokerFactoryBean.java:149)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.AbstractBeanFactory.isSingleton(AbstractBeanFactory.java:392)
at org.springframework.context.support.AbstractApplicationContext.isSingleton(AbstractApplicationContext.java:1024)
at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:370)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandlers(SimpleUrlHandlerMapping.java:129)
at org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.initApplicationContext(SimpleUrlHandlerMapping.java:104)
at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:71)
at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
at org.springframework.context.support.ApplicationContextAwareProcessor.doProcess(ApplicationContextAwareProcessor.java:116)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:99)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1394)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:561)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
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:587)
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:290)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Jan 13, 2010 9:40:07 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /springFlex-server threw load() exception
javax.servlet.ServletException: Unable to find MessageBroker, ensure that if messageBrokerId is set for the MessageBrokerServlet the RDS FrontEndServlet has a matching init-param value
at flex.rds.server.RdsServlet.init(RdsServlet.java:64)
at flex.rds.server.servlet.FrontEndServlet.loadServlet(FrontEndServlet.java:262)
at flex.rds.server.servlet.FrontEndServlet.init(FrontEndServlet.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:212)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4149)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4458)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:741)
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:587)
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:290)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)
Jan 13, 2010 9:40:07 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive insight.war
Jan 13, 2010 9:40:07 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jan 13, 2010 9:40:07 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5498 ms
Hey James,
Nice to see the tooling support working well with Spring! I do have just a few additional tips to help simplify the example even further:
1. There is no need for remoting-config.xml when using Spring BlazeDS. The things being configured there in the case of this example are already set up by the “remoting-service” element in your Spring config.
2. You don’t need to explicitly specify the channels in the @RemotingDestination annotation unless you are using something other than the default channels defined in the “remoting-service” element.
3. You don’t need to explicitly specify the bean id in your @Service annotation. By default, the bean id (and in turn the default name of the remoting destination) will be configured with the class name as the id. Of course, if you make that change, then you need to change the client code to talk to the “foo” destination instead of “fooService”.
- Jeremy
Thanks Jeremy! I will certainly make those changes for part 2!
Hi Toni. I’m not sure what that error means. If you want to email me your project I can take a look at it. jaward at adobe dot com
Hi Joe. Thanks for your honesty. It’s great to get this kind of feedback.
The generated code is just a wrapper around RemoteObject but it did create the client-side stubs for the service methods. And you will see in part 2 that it also generates the value objects.
Declaring the ChannelSet inline has become my regular way of coding demos because when I left it out and let Flex add the channel set automatically based on the services-config.xml file it always seemed to confuse people. They don’t understand how the client knows how to connect to the server. But I always try to mention that both of those ways are *BAD* for production and that options like Swiz are the best way to go.
Allegedly the Data Wizards in FB4 are extensible so Swiz could have a plugin that would generate Swiz knowledgeable service classes. But I’m not sure that the documentation about that has bene published yet.
BTW: It looks like you are a mountain biker. Let me know when you come to Colorado so we can ride together. :)
If possible James can you publish your project so we can go through this type of setup ourselves?
Hi Andrew,
I’ve posted the web app project here:
http://www.jamesward.com/downloads/springFlex-server.zip
-James
james,
I had the same issue that Jeremy described and was resolved by removing remoting-config.xml.
thanks,
- t
hi guys,
I’ve met the same exception above as “Couln’t find _mssageBrokerId”. I just do some experiments.
So I fond that the Eclipse environment must Be JDK 1.6 and tomcat should be version 6.xx. At last make sure that your spring config file is totally right,because most exception comes from spring config will cause
the Unable to find MessageBroker.
I hope this will be useful for men above.
Yet another question: I’m trying to replicate your setup in a Grails environment, where web resources are scattered all around the place. When I try to connect to the Data service, it sees my service but when it tries to generate the service stub, it says the service class is “not available in the specified location”. What is the convention? Where does Flash builder look for the service classes based on which it generates service stubs?
is this RDS servlet some heritage from ColdFusion as the URL seems to show? is it possible to customize it to something more speaking? it seems like the BlazeDS equivalent of WSDL/WADL, is there a public spec for its output?
I found a way to run my Grails application so that Flash Builder finds its way and it’s working great now. Now the only thing that I miss is some basic login/password security in there and I’ll have what I’ve been looking for for months.
Very Very Nice post for beginners,
Can u put link to the video for download so that
we can view it multiple times but save bandwidth.
regards.
@magomarcelo I’m not sure what the history of the RDS Servlet is but I don’t think the URL can currently be changed.
@Raja Try this: http://content.screencast.com/users/jlward4th/folders/Default/media/98f61331-617a-4ac3-87d2-9aeccf317813/springFlex1.mp4?downloadOnly=true
james ,which is the configuration for flex 3 with spring??
Eric,
Check out the Spring Flex Test Drive for the best way to do the configuration.
-James
james, could you please provide us source code of this project for startup ? thanks for posted it .usedfull lots.
Hi pankaj,
The code is here: http://www.jamesward.com/downloads/springFlex-server.zip
-James
Thanks for this awesome screen cast James! I have been looking for something like this for a long time. I am new to AS3, Flex, Spring, Maven, Hibernate, and Java. I wonder if other people find it as complicated as I do. Perhaps it’s the synergizing of so many different technologies and the required base knowledge of each. It’s really nice to have a screen cast from someone who actually know what he’s doing! Well I’m on to your next video “Flex 4, Java, Spring, and Hibernate in Flash Builder 4″! I hope I can use it as a basis for a project that I am working on.I wonder if the coding of the actually project is going to be easier than setting it up! Do you know of any guides or books I could read that helps one learn to setup Hibernate and Flex? Heck I have a hard time just getting maven to work for me. Thanks again for the screen cast, without it I would be totally lost.
Job,
To get a better grasp of Maven I would suggest reading up on the reference document
http://www.sonatype.com/products/maven/documentation/book-defguide
Tons of great info here that was very useful for me when I got started.
If I was you I would focus on setting up Spring with Hibernate first. Get a couple of examples going and then setup Flex with Spring.
I believe James has already posted some sample code for that.
-Andrew
Hi James,
Thanks for wonderful tutorial, it help me a lot to setup flex project… one thing that kill my time for almost a day just to make “Hello World”, why flex-rds-server.jar is no where to be downloaded except from your example ?
I’ve downloaded blazeds.war, adobe flash builder 4, none of this file contain that jar. Am i missing something?
@Wiyanto This should be in the latest nightly builds of BlazeDS 4.
Thank you for your videos and project files, but unfortunately it appears the project download is for the project state at the end of video 2. We are not using Hibernate, and having only the ending files available is making it impossible for me to recreate video 1.
Could you please post the files for video one that actually match the files in the video? That is, includes the missing remoting-config.xml file, has a non-empty tag in servics-config, does not include all the Hibernate stuff, etc. Also, I can not get the basic (video 1) project to work without the appropriate tomcat tag in the tag of services-config.xml.
This is holding me up on adopting Adobe on our project – my management will not let us proceed until we can demonstrate that our recent investment in FB 4 is going to work.
Thanks!
John
Addendum – your security seems to be stripping out the xml tags embedded in my post, so here they are in brackets instead:
…has a non-empty [services] tag in servics-config, does not include all the Hibernate stuff, etc. Also, I can not get the basic (video 1) project to work without the appropriate tomcat tag in the [security] tag …
@John King
Can you email me so we can figure out what the problem is? Also there are a number of examples available in the Spring BlazeDS Test Drive:
http://static.springsource.org/spring-flex/docs/1.0.x/reference/html/ch06.html
Thanks!
jaward at adobe dot com
Great tutorial James. I got a runtime service access error (even though the Data Service test worked) if I didn’t provide a ‘default-channels’ in services-config.xml.
Like this:
Instead of this:
Sorry, forgot the escapes, here are the ‘default-channels’ I had to add to services-config.xml.
Like this:
<services>
<default-channels>
<channel ref=”my-amf” />
</default-channels>
</services>
Instead of this:
<services>
Hello James,
Very useful, thank you so very much
but i have a question, when ever i change some thing in my flex project (mxml) the changes are not picked until i restart the server (I am using flash builder plugin in eclipse 3.5 and jboss server), can you please throw some light on this. (I was just manipulating single mxml and was irritated by that, what if its a big project with bunch of mxmls)
thanks,
Suresh Paleti
The new Data/Services works fine to generate service classes and value objects for the request/response messages on an AMFChannel, question is can it provide any help setting up a messaging consumer and value objects for the pushed data using StreamingAMFChannels?
thank you
@suresh
The problem is likely that the updated app is not being deployed instantly in JBoss. One way to deal with this is to install the JBoss Tools Eclipse plugin and have it do exploded war files. That way as soon as the app is compiled it’s updated in the exploded war.
@Rick Holland
Today the DCD features don’t support the Pub/Sub messaging in BlazeDS / LCDS. But the amount of code to setup a Consumer / Producer is minimal.
Hi, James:
Great tutorial, simple and concise.
I recently downloaded the source code and I’ve noticed there are some slight differences with the tutorial. So, Just one question: When we could enjoy the second part (or if have you published, where could we find it)?
Mauricio.
Maybe this one? http://www.jamesward.com/2010/01/17/flex-4-and-java-spring-hibernate-in-flash-builder-4/
Let me know.
-James
Hello, thanks for the video!
I have the same problem as Sébastien Arbogast:
When I try to connect to the Data service, it sees my service but when it tries to generate the service stub, it says the service class is “not available in the specified location”…
SpringFlexFactory
testSringService
It’s working when I don’t pass through spring…
com.bla.foo
Any idea?
Hi Jeff. Sorry but I’m not sure what the problem is. Can you file a bug? Thanks.
I resovled the issue:
“javax.servlet.ServletException: Unable to find MessageBroker, ensure that if messageBrokerId is set for the MessageBrokerServlet the RDS FrontEndServlet has a matching init-param value”
by adding these additional libraries taken from the project ZIP file, which were not shown on the video:
aopalliance.jar
asm-3.2.jar
backport-util-concurrent.jar
cglib-2.2.jar
My environment was:
blazeds-bin-4.0.0.14931
spring-flex-1.0.3.RELEASE
spring-framework-3.0.2.RELEASE
I still cannot get the error resolved
javax.servlet.ServletException: Unable to find MessageBroker, ensure that if messageBrokerId is set for the MessageBrokerServlet the RDS FrontEndServlet has a matching init-param value
I confirmed that i do have the dependency libraries in lib folder of WEB-INF as mentioned by Nikolay.
My Web.xml is as follows
springFlexServer
Web application descriptor for the springFlexServer web application.
contextConfigLocation
/WEB-INF/spring/*-context.xml
org.springframework.web.context.ContextLoaderListener
flex
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/spring/flex-servlet.xml
1
flex
/messagebroker/*
springmvc
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/spring/springmvc-servlet.xml
springmvc
/spring/*
<!– We will also add the RDSDispatchServlet settings here to be used with the DCD
capabilities for Flex Builder 4. For that we copy the commented section from the
web.xml file that comes with BlazeDS war file.
RDSDispatchServlet
RDSDispatchServlet
flex.rds.server.servlet.FrontEndServlet
useAppserverSecurity
false
MessageBrokerId
_messageBroker
10
RDSDispatchServlet
/CFIDE/main/ide.cfm
–>
index.html
index.htm
index.jsp
default.html
default.htm
default.jsp
—————————————————————-
web-application-sontext.xml is
——————————————–
flex-servlet.xml is as follows
If the RDSDispatchServlet section is commented in the web.xml and i deploy the application everything runs smoothly. I can see that the MessageBroker also initialized and gets the id _messageBroker.
BlazeDS also starts correctly and processes the 4 configuration files (service, remoting, messaging and proxy)
[#|2010-06-13T11:01:00.062-0700|INFO|sun-appserver2.1|org.springframework.web.servlet.DispatcherServlet|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|FrameworkServlet 'flex': initialization started|#]
[#|2010-06-13T11:01:00.062-0700|INFO|sun-appserver2.1|org.springframework.web.context.support.XmlWebApplicationContext|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|Refreshing WebApplicationContext for namespace 'flex-servlet': startup date [Sun Jun 13 11:01:00 PDT 2010]; parent: Root WebApplicationContext|#]
[#|2010-06-13T11:01:00.062-0700|INFO|sun-appserver2.1|org.springframework.beans.factory.xml.XmlBeanDefinitionReader|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/flex-servlet.xml]|#]
[#|2010-06-13T11:01:00.203-0700|INFO|sun-appserver2.1|org.springframework.beans.factory.support.DefaultListableBeanFactory|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@68e38f: defining beans [_messageBrokerHandlerAdapter,_messageBrokerDefaultHandlerMapping,_jsonConfigMapEditorConfigurer,_messageBrokerMessagingProcessor,_flexRemotingAnnotationPostProcessor,_messageBrokerRemotingProcessor,org.springframework.flex.core.ExceptionTranslationAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#0,org.springframework.flex.core.MessageInterceptionAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#1,_messageBrokerEndpointProcessor,_messageBroker]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@d30ee5|#]
[#|2010-06-13T11:01:00.296-0700|INFO|sun-appserver2.1|org.springframework.flex.config.FlexConfigurationManager|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|Loading Flex services configuration from: ServletContext resource [/WEB-INF/flex/services-config.xml]|#]
[#|2010-06-13T11:01:00.359-0700|INFO|sun-appserver2.1|org.springframework.flex.config.FlexConfigurationManager|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/remoting-config.xml]|#]
[#|2010-06-13T11:01:00.390-0700|INFO|sun-appserver2.1|org.springframework.flex.config.FlexConfigurationManager|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/proxy-config.xml]|#]
[#|2010-06-13T11:01:00.421-0700|INFO|sun-appserver2.1|org.springframework.flex.config.FlexConfigurationManager|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/messaging-config.xml]|#]
[#|2010-06-13T11:01:00.546-0700|INFO|sun-appserver2.1|org.springframework.flex.core.MessageBrokerFactoryBean|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|BlazeDS - Community Edition: 4.0.0.14931|#]
[#|2010-06-13T11:01:00.656-0700|INFO|sun-appserver2.1|org.springframework.flex.core.MessageBrokerFactoryBean|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|MessageBroker with id '_messageBroker' is starting.|#]
[#|2010-06-13T11:01:01.265-0700|INFO|sun-appserver2.1|org.springframework.flex.core.MessageBrokerFactoryBean|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|MessageBroker with id '_messageBroker' is ready (startup time: '609' ms)|#]
[#|2010-06-13T11:01:01.265-0700|INFO|sun-appserver2.1|org.springframework.web.servlet.handler.SimpleUrlHandlerMapping|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|Default mapping to handler [flex.messaging.MessageBroker@444340]|#]
[#|2010-06-13T11:01:01.343-0700|INFO|sun-appserver2.1|org.springframework.web.servlet.DispatcherServlet|_ThreadID=16;_ThreadName=httpWorkerThread-4848-1;|FrameworkServlet 'flex': initialization completed in 1281 ms|#]
However if I uncomment the RDSDispatchServlet section and then try to deploy the application
I get the following error
javax.servlet.ServletException: Unable to find MessageBroker, ensure that if messageBrokerId is set for the MessageBrokerServlet the RDS FrontEndServlet has a matching init-param value
However i do have the following specified for the RDSDispatchServlet
MessageBrokerId
_messageBroker
Also in the logs i do see the _messageBroker is initialized
[#|2010-06-13T11:19:06.218-0700|INFO|sun-appserver2.1|org.springframework.web.servlet.DispatcherServlet|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|FrameworkServlet 'flex': initialization started|#]
[#|2010-06-13T11:19:06.218-0700|INFO|sun-appserver2.1|org.springframework.web.context.support.XmlWebApplicationContext|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|Refreshing WebApplicationContext for namespace 'flex-servlet': startup date [Sun Jun 13 11:19:06 PDT 2010]; parent: Root WebApplicationContext|#]
[#|2010-06-13T11:19:06.218-0700|INFO|sun-appserver2.1|org.springframework.beans.factory.xml.XmlBeanDefinitionReader|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/flex-servlet.xml]|#]
[#|2010-06-13T11:19:06.375-0700|INFO|sun-appserver2.1|org.springframework.beans.factory.support.DefaultListableBeanFactory|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@efb5c5: defining beans [_messageBrokerHandlerAdapter,_messageBrokerDefaultHandlerMapping,_jsonConfigMapEditorConfigurer,_messageBrokerMessagingProcessor,_flexRemotingAnnotationPostProcessor,_messageBrokerRemotingProcessor,org.springframework.flex.core.ExceptionTranslationAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#0,org.springframework.flex.core.MessageInterceptionAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#1,_messageBrokerEndpointProcessor,_messageBroker]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@19d3e57|#]
[#|2010-06-13T11:19:06.468-0700|INFO|sun-appserver2.1|org.springframework.flex.config.FlexConfigurationManager|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|Loading Flex services configuration from: ServletContext resource [/WEB-INF/flex/services-config.xml]|#]
[#|2010-06-13T11:19:06.531-0700|INFO|sun-appserver2.1|org.springframework.flex.config.FlexConfigurationManager|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/remoting-config.xml]|#]
[#|2010-06-13T11:19:06.562-0700|INFO|sun-appserver2.1|org.springframework.flex.config.FlexConfigurationManager|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/proxy-config.xml]|#]
[#|2010-06-13T11:19:06.593-0700|INFO|sun-appserver2.1|org.springframework.flex.config.FlexConfigurationManager|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/messaging-config.xml]|#]
[#|2010-06-13T11:19:06.734-0700|INFO|sun-appserver2.1|org.springframework.flex.core.MessageBrokerFactoryBean|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|BlazeDS - Community Edition: 4.0.0.14931|#]
[#|2010-06-13T11:19:06.843-0700|INFO|sun-appserver2.1|org.springframework.flex.core.MessageBrokerFactoryBean|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|MessageBroker with id '_messageBroker' is starting.|#]
[#|2010-06-13T11:19:07.468-0700|INFO|sun-appserver2.1|org.springframework.flex.core.MessageBrokerFactoryBean|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|MessageBroker with id '_messageBroker' is ready (startup time: '625' ms)|#]
[#|2010-06-13T11:19:07.468-0700|INFO|sun-appserver2.1|org.springframework.web.servlet.handler.SimpleUrlHandlerMapping|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|Default mapping to handler [flex.messaging.MessageBroker@69bbee]|#]
[#|2010-06-13T11:19:07.546-0700|INFO|sun-appserver2.1|org.springframework.web.servlet.DispatcherServlet|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;|FrameworkServlet 'flex': initialization completed in 1328 ms|#]
[#|2010-06-13T11:19:07.562-0700|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=18;_ThreadName=httpWorkerThread-4848-0;_RequestID=e6eb524d-1c08-47ed-a9e6-85bb0b4a76f1;|WebModule[/springFlexServer]PWC1396: Servlet /springFlexServer threw load() exception
javax.servlet.ServletException: Unable to find MessageBroker, ensure that if messageBrokerId is set for the MessageBrokerServlet the RDS FrontEndServlet has a matching init-param value
at flex.rds.server.RdsServlet.init(RdsServlet.java:64)
at flex.rds.server.servlet.FrontEndServlet.loadServlet(FrontEndServlet.java:262)
at flex.rds.server.servlet.FrontEndServlet.init(FrontEndServlet.java:127)
at javax.servlet.GenericServlet.init(GenericServlet.java:270)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1023)
Can anyone help wit making me understand what is happening here.
Thanks,
Hemen
Ok found the issue, the init param value for RDSDispatchServlet has a capital M instead of lower case.
hi James
thanks for your video !
i have a problem that the “fooService” could not created when the tomcat was started , the log just like this:
2010-7-6 15:04:06 org.apache.catalina.core.AprLifecycleListener init
infor: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Adobe\Adobe Flash Builder 4 Plug-in-myEclipse\eclipse-host-distro\jre\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Oracle\Oracle10gClient\bin;C:\XEClient\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\TortoiseSVN\bin;C:\Program Files\TortoiseSVN1.5\bin;C:\Program Files\Common Files\Thunder Network\KanKan\Codecs;C:\Program Files\Oracle10g\;C:\Oracle\ora90\BIN\;C:\Program Files\Java\jdk1.6.0_16\bin;C:\Program Files\Java\jdk1.6.0_16\jre\bin;C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\Program Files\UltraEdit\;C:\Program File\UltraCompare\UltraCompare Professional
2010-7-6 15:04:07 org.apache.coyote.http11.Http11BaseProtocol init
infor: Initializing Coyote HTTP/1.1 on http-8080
2010-7-6 15:04:07 org.apache.catalina.startup.Catalina load
infor: Initialization processed in 610 ms
2010-7-6 15:04:07 org.apache.catalina.core.StandardService start
infor: Starting service Catalina
2010-7-6 15:04:07 org.apache.catalina.core.StandardEngine start
infor: Starting Servlet Engine: Apache Tomcat/5.5.29
2010-7-6 15:04:07 org.apache.catalina.core.StandardHost start
infor: XML validation disabled
2010-7-6 15:04:07 org.apache.catalina.core.ApplicationContext log
infor: Initializing Spring FrameworkServlet ‘dispatcherServlet’
2010-7-6 15:04:07 org.springframework.web.servlet.FrameworkServlet initServletBean
infor: FrameworkServlet ‘dispatcherServlet’: initialization started
2010-7-6 15:04:08 org.springframework.context.support.AbstractApplicationContext prepareRefresh
infor: Refreshing WebApplicationContext for namespace ‘dispatcherServlet-servlet’: startup date [Tue Jul 06 15:04:08 GMT+08:00 2010]; root of context hierarchy
2010-7-6 15:04:08 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
infor: Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcherServlet-servlet.xml]
2010-7-6 15:04:08 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
infor: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@15b0333: defining beans [_messageBrokerHandlerAdapter,_messageBrokerDefaultHandlerMapping,_jsonConfigMapEditorConfigurer,_messageBrokerMessagingProcessor,_flexRemotingAnnotationPostProcessor,_messageBrokerRemotingProcessor,org.springframework.flex.core.ExceptionTranslationAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#0,org.springframework.flex.core.MessageInterceptionAdvice#0,org.springframework.flex.core.EndpointServiceMessagePointcutAdvisor#1,_messageBrokerEndpointProcessor,_messageBroker,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor]; root of factory hierarchy
2010-7-6 15:04:08 org.springframework.flex.config.FlexConfigurationManager$ResourceResolverAdapter getConfigurationFile
infor: Loading Flex services configuration from: ServletContext resource [/WEB-INF/flex/services-config.xml]
2010-7-6 15:04:09 org.springframework.flex.config.FlexConfigurationManager$ResourceResolverAdapter getIncludedFile
infor: Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/remoting-config.xml]
2010-7-6 15:04:09 org.springframework.flex.config.FlexConfigurationManager$ResourceResolverAdapter getIncludedFile
infor: Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/proxy-config.xml]
2010-7-6 15:04:09 org.springframework.flex.config.FlexConfigurationManager$ResourceResolverAdapter getIncludedFile
infor: Including Flex services configuration from: ServletContext resource [/WEB-INF/flex/messaging-config.xml]
2010-7-6 15:04:10 org.springframework.flex.core.MessageBrokerFactoryBean afterPropertiesSet
infor: BlazeDS – Community Edition: 4.0.0.14931
2010-7-6 15:04:10 org.springframework.flex.core.MessageBrokerFactoryBean afterPropertiesSet
infor: MessageBroker with id ‘_messageBroker’ is starting.
2010-7-6 15:04:10 org.springframework.flex.core.MessageBrokerFactoryBean afterPropertiesSet
infor: MessageBroker with id ‘_messageBroker’ is ready (startup time: ’516′ ms)
2010-7-6 15:04:10 org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
infor: Default mapping to handler [flex.messaging.MessageBroker@6c2896]
2010-7-6 15:04:11 org.springframework.web.servlet.FrameworkServlet initServletBean
infor: FrameworkServlet ‘dispatcherServlet’: initialization completed in 3172 ms
2010-7-6 15:04:11 org.apache.coyote.http11.Http11BaseProtocol start
infor: Starting Coyote HTTP/1.1 on http-8080
2010-7-6 15:04:11 org.apache.jk.common.ChannelSocket init
infor: JK: ajp13 listening on /0.0.0.0:8009
2010-7-6 15:04:11 org.apache.jk.server.JkMain start
infor: Jk running ID=0 time=0/156 config=null
2010-7-6 15:04:11 org.apache.catalina.storeconfig.StoreLoader load
infor: Find registry server-registry.xml at classpath resource
2010-7-6 15:04:11 org.apache.catalina.startup.Catalina start
infor: Server startup in 4265 ms
look forward for the response !!!!
I don’t see any errors there. Where are you seeing that fooService could not be created?
Thank you for your reply ! You asked me how i decide that the ‘fooService’ could not create. first,i can not see any info in the log about the ‘fooService’,and when connecting the service through the tool “data/service”, i can not see one available either . so ….
Fortunately , i found that i forgot compiling the source , when the .class generated and try again , the problem disappeared . hope others won’t meet with the silly mistake ….
Thank you for your time !
3 Trackbacks
[...] Flash Builder 4 Data Wizards with Java / Spring [...]
[...] there you go. Special thanks to James Ward, whose screencasts really helped me get it right. Now the only thing that this plugin misses, beyond the 2 known [...]
[...] Flash Builder 4 Data Wizards with Java / Spring [...]