As a lot of you out there know, I write a lot about flex and java. For my flex posts I use a sample called books-overview. You can find the sourcecode on google code. A lot of different frameworks released new versions. In this post I describe the some of the upgrades that are important to me
- flex-mojos (3.1) – the maven flex plugin
- Mate (0.8.7.1) – a flex framework
- Spring BlazeDS Integration 1.0.0.RC1
Read on to find out the changes I had to make, the problems I ran into (not that much actually).
Let us start with the build system. I want to upgrade to the latest and greatest 3.1 version of the flex-mojos plugin. This is not hard, there is excellent documentation available in the form of this open source book.
I did not have to make a lot of changes, the groupId and the artifactId of the plugin have changed, but that is easy. I do have problems running the tests on a mac. The mentioned book does give a method to make the flex unit tests work, but it does not work for me like I would have wanted it to. It seems that the call to the flash executable is wrong. The suggested way is to cp the Flash Player.app to the /Applications folder. Please do not do this using sudo, I prefer to do it by hand using the Finder. Another problem is the call from the plugin. It calls FlashPlayer.app, I think It should be Flash\ Player. Therefore I add the following directive to the maven command:
This only works if you make sure the player is on the path, I included the following line in my .bash_profile file:
export PATH=$PATH:/Applications/Flash\ Player.app/Contents/MacOS
Now the application is running again. Time to move on.
Mate is now upgraded to the released version 0.8.7.1. I did not find a good repository containing this release for maven. Therefore I had to add it manually. I did not really go into the new features. I see there are mock objects now for services. I have not come up with the right way to use them without changing my code in for instance unit tests. Therefore there are no exiting things to do for mate. Feel free to add a comment if I missed something.
Spring BlazeDS Integration
It seems to be a small step, but I had to make some adjusments. I had to change the bean from flex:remote-service into flex:remoting-destination. Beware to change the service-id into destination-id if you need another name of the destination than the default name deduced from the exposed bean. This was not right at the moment in the documentation.
The flex:remoting-destination configuration than becomes:
<flex:remoting-destination destination-id="remoteBookManager" ref="bookManager" exclude-methods="internalUseStoreBook"/>
To make this all work, I had to add a dependency which is optional by default but I did need it. Not sure why.
<dependency> <groupId>org.codehaus.jackson</groupId> <artifactId>jackson-core-asl</artifactId> <version>0.9.9-6</version> </dependency>
The next problem I ran into, had to do with the following error message. I do only show the first line, not the complete stacktrace.
Problem with the : org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named '_filterChainList' is defined
As described is this forum post, this can be resolved by disabling session fixation in the http configuration of spring security. Jeremy has tested this as well and stated it is indeed a bug. A fix is committed and will be in the next release.
Now everything is working again. I am personally not fond of the spring dependencies labelled 2.5.6.A. These have to do with the special OSGi enabled jars. But they give a lot of double dependencies on external jars. Luckily Jeremy has promised to create a version without the OSGi versions as well. Check this post. The responsiveness of the community and the committers is great, this is what I like so much about the spring framework. I had to say it
Some additional remarks
Next to the framework upgrades I also want to mention some things you can find in the sample. I added a unit test based on FlexUnit. I took the flex security out of the normal project and placed it into a seperate swc project.
What is left? Well I need to add the old features in the new mate version. You cannot add new books at the moment. I also want to have a good look at the security integration in the BlazeDS integration project of the spring framework. I also want to do some messaging, which I have done already in another project. Finally I have a nice maven solution to print a build version number in the flex application. If you like that idea, be patient. I’ll try to write my next post about that topic.
Thanks for reading, hope to see you back soon. Do not forget to connect to me via linkedin, gridshore has it’s own group. You can also stay up to date using twitter.
- http://www.sonatype.com/books/maven-book-stage/reference/ch20.html – reference manual for the flex maven build plugin.
- http://www.statusq.org/archives/2008/07/30/1954/ – reference to the easiest way to get wget on your machine.