Posts tagged struts

a bit confused

Yup, I’m. I’m confused because of lack of good TED presentations for last few weeks. Maybe I’m wrong and there were some, please feel free to show me them, because if so, it means that’s something wrong with me 😉

Never mind, back to business. I was working hard for last few weeks to release a new Apache Struts 2 version. The first attempt failed, as during the Vote progress a bug was detected – so it’s good, better sooner than later 😀 The second attempt is under Vote right now and I’m testing it – like a tester, by clicking here and there with the example Showcase application. It looks good, but Matt reported that tests for AppFuse are slower for version 2.2.3 comparing to version 2.1.8. Hmm… only two seconds but always …

I figured out how to check what can be wrong. In the latest version we’ve introduced mechanism to escape action’s name and method’s name as with Dynamic Method Invocation mechanism a hacker can use them for XSS attack. And as an Action is created per each request, that can slow down the whole framework. So I will use YSlow to measure load times for pages in the Showcase application, next I will rollback the changes regarding escaping and re-run the tests. And then compare the results.

Maybe it will give me the answer 😉

Staying around the Apache Software Foundation – proposal to join ASF is almost ready for OGNL project – it’s a very good information as OGNL was homeless for some time. Many thanks to Simone for taking care of that, lot of good work!

Another thing, I’ve started or rather joined a new project or better an on-going project 😉 It’s for financial industry – again someone could say – but it’s something different from what I had been doing for a previous bank. Anyway it should be funny and interesting – lot of JSF2ise, CDIse and JBossise stuff will be flying in the air 😛

What else is going on ? We’re working hard to prepare the next edition of the Warsaw JUG Conference – Confitura 2011 aka Javarsovia – see you there in June. On the beginning of May the GeeCON conference take place and hopefully I’ll be there as well.

camels and rollbacks

I had been preparing a new Struts 2 release for last few weeks. It contains only a tiny change regarding security and I had been counting that it shouldn’t take more than a week to release it. How wrong I was 😉

Everything had started smoothly, I’ve created a new Subversion branch, to not interfere with current on-going development of the new Struts 2.2.2. The branch was made from Subversion tag (yeah, branches, tags and trunks are all the same, just copies 😉 ). Next, I’ve applied a patch to solve the security hole and I was truly sure that’s it –  I can start the release process. So I’ve gone ahead, mvn release:prepare command went smoothly, so the next step was mvn release:perform. And after almost waiting 1h I’ve got a strange looking massage: not all licenses were approved !?!

The first thought, I’m using the latest Maven 3.0.1 and that’s the problem, but it wasn’t. I started looking into RAT plugin source code to check what could be wrong. I’ve just discovered that the plugin is checking wrong Apache License header but also looking for the License’s URL so it should be ok. The origin of the problem was quite simple. The Maven Release plugin allows to make release only from a SNAPSHOT version, so I’ve changed the version only in the parent pom of the project. The rest was unmodified. After changing all the version signatures in all the poms the problem was gone 😉

To launch another release process I’ve had to rollback all the changes made during previous launching release command. mvn release:rollback did the job but I’ve had to manually remove the tag from Subversion repository. And of course I’ve removed the wrong one 🙁

Thanks to Wes for a tip how to rollback such a huge mistake, the command looks like this:

TAG_1 is the removed tag, number 10 is the revision -1 when the tag was The Bye Bye Man streaming

So I’ve started again, to make a release and again something went wrong. I noticed the release plugin is making a tag base on wrong path – it was using the original path of the tag from which the branch was made of instead the branch path. And again I’ve had to rollback all changes and remove the tag – this time the correct one 😉

Resolution was easy – change scm tag in all the poms to point to the branch 😛

And again, I’ve started the release process and this time everything went more than smoothly, all the artifacts were uploaded to Apache Nexus, so the last think before calling a vote was to close a staging repository. And again I was wrong, during that, Nexus reported that two jar files don’t have corresponding files with signature. I’ve checked locally and everything was ok. After short conversation with guys from support, I’ve got the solution – upgrade to latest Apache Parent 🙂

Yep, easy, but to do that I’ve had to once again rollback everything, prepare a new Struts Parent that will inherit from the latest Apache Parent, release it and call for a vote 😀

Finally, after almost 2 months I was able to release Struts – the vote is under way, so if you are Struts PMC, please test the release and vote!

Just to relax a bit, take a time and watch that very inspiring talk about camels:

are you affraid

The last two weeks I’ve been simplifying an application flow engine base on Apache Struts 1 – I know it’s a bit old technology but I don’t care, I have a job to do 😉

Anyway I discovered lot of strange use cases where some custom mechanism was build instead to use what was already provided with the framework. It was like inventing a wheel once again! Frankly, I was truly surprised how someone could do this that way. And I start thinking what was the reason to do that…

The only thought came to the mind that someone was afraid to use what was already provided to him with Apache Struts 1 – he didn’t know the framework well, he was too lazy to check sources, and so on. I was real devastated! If someone doing application in such way, no framework will help him or do the job for him!

Recently I’ve been solving issues in Apache Struts 2 and one of them was to add wildcard support to a file upload mechanism. Provided patch had solved that problem with some home made RegExp engine. I just added a test case to proof it was working properly and committed all the changes to a source code repository. After that a more experienced Committer pointed me out that I should use existing PatterMatcher class instead, what I did and the code looks much better right now. You can see an example here Apache Struts 2 useful beans.


The “Frozen Zone” was still On, so I had lot of time to contribute to Open Source project – in my case Apache Struts. I’ve been working for few weeks with Maven 2 archetypes, to updated them to latest Strust 2 version. It was quite easy task, I even wrote a simple bash script for automatically testing them.

Nevertheless, became the time when I had to release them – or to be more precise – prepare staging release. I never had been doing that, so always is the first time 😀

I’ve read some tutorials about releasing projects with Maven and there is also a great documentation entry on Apache Struts site about releasing the project. It was the most helpful information. Equipped with knowledge I started the release process. The first three archetypes were released very fast and without any problems (except conflict between Cygwin and Subversion client – next time I will use Linux box 😉 ).

Yap, I thought I’m on the road and then I got problem with checking out tagged project from Subversion. I don’t remember what was the message, but I spent more than hour to solve that problem! Another experience for future.

The whole release process took mi around 5-6 hours so it was enormous achievement in my opinion. The next time it will be faster 😉 And the last thing – the Vote! I started it and was able to relax with cold beer 😀

two days at once

I hadn’t have any particular tasks for last two days. Some minor updates to print layout – that’s it! So I had time to work with Apache Struts2 project and with Xwork project. Also I prepared another presentation from Javarsovia 2009 conference and uploaded it on film Lady Macbeth now

Today we had Code Review – it was a bit to long, over three hours! Code Reviews are great if they are organized more often, but hopefully we will have another Code Review soon 😉

back to work

I returned to main task today. It was a good idea to disconnect myself from the task the day before – I was able to take a distance look on my problems. Yap, that being said, I had a hard time today trying investigate how out project web framework is working – with all this flow control, JavaScript around. I tried many different approaches to avoid exceptions, to allow flow working – once again I filled lost! Anyone I took the best possible solution – I asked my teammate for help, for his idea how to solve that. He didn’t give me a direct solution, but he figured out some points that I never thought about!

At the end of day I had working solution, that didn’t break anything – it was quite simple (if I look on it now 😉 ) – I just implemented the whole download logic in separated Struts action, not connected with the internal framework – that allowed me to skip the problems!

The last thing to do is write a unit test to confirm that!

Go to Top