Tag: java

Amazon EC2, autoscaling and Glassfish challenges

Posted by – July 9, 2011

Are you thinking about put a awesome java webapplication running on top of Glassfish application server and use the awersome Amazon Elastic Balancer? If the answer is yes, please read this article first.

At first time the autoscaling feature seens to be an awesome solution, but it may bring some problems if the website deployment isn’t properly planned.

The first and the biggest issue that I found is website update, I created a simple script that check if there’s a new version of site war file at Amazon S3 and then perform its download, if I just redeploy the war file it may crash because of the current database connections made by JPA which cause to put all website down.
More

Share

Why not use RESTeasy to create REST services?

Posted by – February 9, 2009

After few days using RESTeasy in my project I found a very annoying issue related with its Spring support, please consider the bean declaration below:

1
2
3
4
5
6
<bean id="remoteAuthenticationService" class="org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean">
    <property name="serviceUrl"
            value="http://${host}:${port}/adminserver/remoteAuthenticationService.esp"/>
    <property name="serviceInterface" value="com.fastsearch.esp.admin.RemoteAuthenticationService"/>
    <property name="httpInvokerRequestExecutor" ref="executor"/>
</bean>

For some reason the RESTeasy ContextLoaderListener implementation is unable to resolve property placeholders used by some properties of beans at singleton scope, when I read these properties from my bean logic I see all properties placeholders there as they weren’t resolved.

So I decided to try Jersey since it uses the standard implementation of ContextLoaderListener that comes with Spring, now my application works as expected, all properties placeholders are being correctly resolved on my Spring singleton beans.

Share

Rational Application Developer and Websphere Portal Express

Posted by – January 8, 2009

I just started to use IBM RAD and IBM Websphere Portal few weeks back, IBM RAD is a very complete tool built on top of Eclipse, it has a lot of features that facilitates the work on portlet development, you can create in a few minutes a portlet using Struts or JSF as framework. Once a portlet is created you can build and package this portlet as WAR file to deploy on Websphere Portal.

Websphere Portal is completely updated portal solution, you can run JSR 168 and JSR 286 compliant portlets, you also have the option to create portlets using the IBM specific implementation that contains a lot of additional features.

The entire portal is fully customizable, you can change the portal appearance by adding new themes, all portlets can be added to a portal page by just drag and drop then on a page, access control can be easily done via deep integration with LDAP. You can even use google gadgets on your portal page!

Are you worried about scalability? Don’t worry, you can put several websphere portal instances running on a cluster mode.

Share

Facelets EL Functions can save your day

Posted by – November 2, 2008

In the last week I had several issues during the development of a jsf application that could be solved by creating few custom Facelets EL functions, let’s take a look on which scenarios Facelets EL functions helped me.

1. Simple loop over a range of numbers

JSF has a lot of components that can be used to iterate over a model and repeat its own child components several times, some of them are Tomahawk’s dataList and Richfaces repeat.

But in all of these components I couldn’t find a way to do a simple iteration on a range of numbers, like repeat all child components starting from 1 and stopping at n number of times.

Maybe you will say: “What about c:forEach? It can do this kind of iteration!”, oh yes, it can, and I tried to use it but it crashes when I pass EL expressions to both begin and end attributes, it only accepts hardcoded values.
More

Share

Back button issues with JSF and server side state saving

Posted by – October 27, 2008

For several months I tried to avoid this problem that only happens with server side state saving, but now I can’t run away anymore. Really sad.

I have a page that contains a dataList used to render a list of commandLinks, when I click on one of these commandLinks, the attached ActionListener gets called, but if I click on back button and then click on any other commandLink, the ActionListener attached to this component isn’t called, after several hours of debugging I discovered JSF are always trying to restore the current viewstate and not the viewstate related with the original version of my view.

JSF helped a lot on development of many projects, but now I’m really considering the use of Wicket on development of some search frontends that requires good back button support.

Share