Posts tagged jboss

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.

migration and bosses

The whole last week I was migrating my current project from the JBoss AS 6 M2 to the JBoss AS 6 CR1. First of all I had been thinking it should be easy, just switch few things, use other Java packages and so on. Niether I had been expecting some problems nor it will take a week. So I’ve just started my migration “project” – yep, you should always treat it that way, it isn’t just renaming packages or tweaking some configuration files. It’s a huge project that either can take a hour or a week. So be prepared!

To move to the JBoss CR1 I had to also switch to latest versions of our internal libraries, commonly called SML Commons. The main problem was with the CDI Extension package, which base on WELD. During switching the version I discovered some problems during an application deployment. First of all Bean Manager was missing in JNDI context. Googling and looking through existing solution didn’t help. I had to prepare a demo application and try to register an issue with JBoss’ JIRA. The problem was, that my demo application was working just fine with the JBoss CR1. Just Adam was able to break it – the trick was to include in EAR package another module as a Java JAR archive with CDI enabled beans. Then the application blown up!Sandy Wexler film trailer

After few hours we got answer to the problem –  add additional beans.xml file to WAR archive!

So I thought the rest should be easy, but wasn’t 😛

The next problem was with the application’s tests. All the tests that were base on Arquillian started yielding – wrong dependency in Maven pom, I had to remove few of them, cut out some unused profile and everything went smoothly.

So, the next problem was with Selenium and it looked strange as the whole JVM blown up with irritating “red zone” message. And till now I don’t know what it was, maybe just wrong configuration or missing dependency. And during solving that problem I discovered a really interesting CDI behaviour. When you defining a bean with @Produces annotation you have access to the InjectionPoint object. It provides many different information about where your bean will be injected.

But there is a slight diference how InjectionPoint.getBean() is working. If your @Produces annotated bean will be used / injected in already CDI managed bean, getBean() will return that bean. But in other way it will return null 😛

Finally, I gave up 🙁 After passing all that problems, another one hit me directly in the face and I haven’t had enough energy to solved it. I shelved all my changes with IntelliJ IDEA and returned to normal coding work, ufff…. 🙂

And just to change my attitude, today’s morning I got monthly newsletter from TED and I want to share with you that brilliant talk about why bosses and meetings are boilerplate at work, enjoy!

making a cloud

Recently I’ve been changing a cluster configuration. Maybe it isn’t a real cluster, it looks more like a cloud or load balancer. The ingredients are as follow:berryjam.ru

The problem I had was that I just want to enable clustering for given VirtualHost section and not for the whole Web server. Current configuration was quite simple, as you can find out on mod_cluster’s web page. On the JBoss AS side you must uncomment one line or so and provide list with mod_cluster enabled web servers.. But as I said, such configuration enable clustering for the entire web server. I didn’t want that, as I want to create another Virtual Host to serve static content.

So, the first step was to read the documentation, but it didn’t answer my questions. I was trying many different configurations and what I achieved was a separation of Virtual Hosts – I could define the different clusters for different Virtual Hosts, but still wasn’t able to serve static content 😛

The answer was simple, just disable creation of balancer for all Virtual hosts with this directive:

The second thing was to enable use of aliases (and disabling advertising as it isn’t supported by Amazon EC2)

Also on JBoss AS I had to define the Alias:

The rest was easy, just I have had to enable use of Virtual Hosts on given IP address, specify the web server name and define the Virtual Hosts. After restart everything seemed to work perfectly. I had static pages under one domain name and an application under second. The only problem was that I wasn’t able to login to the application. Why? Simply, my session wasn’t a Sticky Session. And not because JBoss server didn’t support it. Much simpler. My session ID wasn’t passed to the JBoss server and back to the Apache HTTPD 😀

To solve that I just had to add ProxyPass and ProxyPassReverse directive:

And that was the end, everything was working smoothly. But the customer decide not to use the same server for load balancing and serving static pages. So all my work was useless, except experience I’ve got 😉

Anyway it’s a very elastic configuration, as you can add another JBoss servers and attach them to the cloud in a minute.

The whole configuration just for future reference:

Go to Top