Flex & Spring Integration




Other Refcardz


thumb

Dependency Injection in EJB 3

Features include Dependency Injection in EJB 3, Resource Injection, Injection of EJB References, Injecting JPA Resources, Using Spring with EJB 3, Hot Tips and more...

"Compact and extremely useful reference from one of the world's foremost authorities on EJB 3." --Reza Rahman


thumb

Groovy

Features include Groovy/Java Integration, Language Elements, Operators, Collective Datatypes, Meta Programming, Hot Tips and more.


thumb

IntelliJ IDEA

Features include basics of navigating and understanding IDEA, Running and Debugging Your Project, Write Less Code, Hot Tips and more...


thumb

Silverlight 2

Features include the Silverlight Plug-in, Calling Managed Code from JavaScript, Using Managed Code to Manage the HTML DOM, Accessing the User’s Browser Window, Hot Tips and more.




Click Here To
Download PDF


Overview

In 2009,  an increasing number of organizations will look to replace the user interface of existing Spring applications using Flex. This Refcard shows you how to integrate Flex and Spring to create a powerful platform for building robust RIAs.  It starts off by showing you how to set up a server-side Java project with BlazeDS and the Spring Framework. After configuring your project with a basic Spring bean for use in BlazeDS, you’ll write your Flex application to use the Spring/BlazeDS service.

 


About the Author

Jon Rose is the Flex Practice Director for Gorilla Logic, an enterprise software consulting company located in Boulder, Colorado. He is an editor and contributor to InfoQ.com, an enterprise software community. Visit his website at: www.ectropic.com. Gorilla Logic, Inc. provides enterprise Flex and Java consulting services tailored to businesses in all industries. www.gorillalogic.com

James Ward is a Technical Evangelist for Flex at Adobe. He travels the globe speaking at conferences and teaching developers how to build better software with Flex. Visit his websit at: www. jamesward.com. First Steps in Flex, co-authored by James, will give you just enough information, and just the right information, to get you started learning Flex--enough so that you feel confident in taking you own steps once you finish the book. For more information visit: http://www.firststepsinflex.com

 

Comments

wyqt replied on Tue, 2009/04/21 - 4:13am

Thanks very much for sharing this !! Very good!

balicamp replied on Fri, 2009/05/08 - 4:45am

Nice shot for this article but poor documented files. I found some blank in downloaded files. Please provide with the correct one .

Regards,

Balicamp 

ethomas.joseph replied on Mon, 2009/05/11 - 2:44am

Good one. I ve been a fan of DZone refcards, but for this one, the PDF would show most of the pages as blank if I open it in Evince Document Viewer (I can see the text if I select the text). Other refcards have no such issues. Also I should mention that there is no issue if I view this refcard on Adobe PDF reader.

alainaltet replied on Mon, 2009/05/11 - 10:42am

I can't get this to work. There's a problem sending the message from the Flex client: [RPC Fault faultString="Send failed" faultCode="Client.Error.MessageSend" faultDetail="Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Status 500: url: 'http://localhost:8080/dzone-server/spring/messagebroker/amf'"]

glose25 replied on Wed, 2009/05/27 - 4:35pm in response to: alainaltet

I'm getting the same error as alainaltet. Tore down and rebuilt entire project, and I'm still getting that error. Instead of Tomcat, I'm using OC4J 10.1.3.1.0.

Miguel Juteau replied on Sat, 2009/09/26 - 11:31pm

Very nice tutorial, unfortunately there is a problem when using the latest org.springframework.flex-1.0.1.RELEASE. It seems the XSD has changed, and as a result the <flex:remote-service ref="myService" /> tag triggers the following SAX parsing error: "The matching wildcard is strict, but no declaration can be found for element 'flex:remote-service'". The problem seems to be fixed when replacing the tag by this one, which conforms to the new XSD: <flex:remoting-destination ref="myService" />. Alas, I am now getting a runtime exeption "java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonFactory". This should be easy to fi though, obviously I'm still missing some JSON library ..

Miguel Juteau replied on Sun, 2009/09/27 - 12:11am

This is the JSON library I was missing: http://wiki.fasterxml.com/JacksonDownload

 

emeka_kanu replied on Fri, 2009/10/23 - 2:25pm

I got the same error as glose25 and alainaltet. Did any of you have this problem? How did you solve it?

emeka_kanu replied on Fri, 2009/10/23 - 2:50pm

I cannot believe the solution to this problem. It is actually the most stupid thing I have ever seen. When you copy the services-config.xml from this ref-card, be careful that there are no spaces in the channel definition uri. As an option, use an ANT build file to automate the process. Eclipse is unreliable

emeka_kanu replied on Sat, 2009/10/24 - 3:59am

Moving on from the first part of the tutorial, I have a problem with the second part. Upon configuring the application for security and deploying, I have the following error. org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [intercept-methods] Offending resource: ServletContext resource [/WEB-INF/application-config.xml] Any ideas?

pr144 replied on Fri, 2009/10/30 - 5:34pm

What am I doing wrong? <?xml version="1.0" encoding="UTF-8"?> Oct 30, 2009 5:26:10 PM org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring FrameworkServlet 'Spring MVC Dispatcher Servlet' Oct 30, 2009 5:26:12 PM org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/flex] Offending resource: ServletContext resource [/WEB-INF/application-config.xml] at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1324) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1317) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:134) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:91) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:475) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:372) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:316) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:284) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:127) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:429) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:356) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:447) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:342) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:308) 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.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:987) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:909) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) 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:583) 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) Oct 30, 2009 5:26:12 PM org.apache.catalina.core.StandardContext loadOnStartup SEVERE: Servlet /EssUtilServer threw load() exception org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/flex] Offending resource: ServletContext resource [/WEB-INF/application-config.xml] at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1324) at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1317) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:134) at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:91) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:475) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:372) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:316) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:284) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:127) at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:429) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:356) at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:447) at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:342) at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:308) 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.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:987) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:909) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:495) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1206) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:314) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053) at org.apache.catalina.core.StandardHost.start(StandardHost.java:722) 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:583) 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) Oct 30, 2009 5:26:12 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Oct 30, 2009 5:26:12 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized()

ducafelipe replied on Thu, 2009/11/12 - 3:35pm

 

"Why yet another AMF implementation?". Well, why don't you ask the Adobe guys, of these three products BlazeDS was the last one to be released. ;-)



Seriously, I'm not sure if I understand the question. In my previous comment I listed several Cinnamon features that are not available in other products like support for pure AS3 clients and deep integration with Spring. And since these were/are often requirements for our own projects we pretty much did not have another choice than to roll our own. GraniteDS was already available when we started last summer but it didn't seem easy to add these features to their existing architecture.



I think BlazeDS, GraniteDS and Cinnamon all have a slightly different focus so I'd say they all have their "right to exist". We know developers who used to work with GraniteDS and then changed to Cinnamon and are much happier now. I guess this might be the other way around for other devs. Why are there hundreds of Java web frameworks? ;-)

Submited by : Padre Rico Padre Pobre

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.