Search This Blog

2009-10-23

It has been quite a while...

I has been quite a long time since I have published the last blog post.
As I did a few things I now have to think back what I actually did...:)
First of all, while developing my basketball application (see ) and working for my current customer I got the idea to write an article about best practices in agile software development, which was pretty tough, what I can say right now, because I finally completed it last week. However, it will take some months until it gets published. I will tell you more about it as soon as I have more information.

What about my basketball application?
My goal is to release a snapshot version 1 just before christmas :)
I set up the perfect infrastructure for the application with hudson and sonar and created the first few web pages. By the way, IceFaces won the race for the web framework. Whether I am happy with this choice or not... I don't know. I definitly had to deal with some basic JSF understanding problems, as I am no UI guy. But with the help of some colleagues I could fight my way through the UI jungle and I am happy to say, that the application is on stable ground and ready to be filled with more and more functionality. There's only one problem. I don't really like to develop web content. Apparently I am not getting comfortable with this xhtml code.
Before I decided to choose IceFaces, I also evaluated Adobe Flex in combination with JavaEE. But I broke up with it because it would have been way more work for me to get used to developing Adobe Applications.

Within the next weeks I will focus on posting more about my experiences with the development of my basketball application and because of the article I wrote, I will post some news and experiences about agile, test driven development.

That's all for today, have a great weekend.
Daniel

2009-08-28

Netbeans 6.7.1, Maven WebApp with IceFaces 1.8.1 - a setup guide

Hi guys,
the last few days I had some problems setting up the web part for my upcoming application.
As I know that some of you guys stumbled upon my blog because you were looking for ICE Faces 1.8.x integration, I thought it would be useful to post my 'set up configuration'.
I am using Netbeans 6.7.1 with Maven 2.2.0 and IceFaces 1.8.1 and glassfish V3 prelude.
Let's start with the faces-config.xml, where you have to add the ICEfaces specific view handler

<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="1.2"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<application>
<view-handler>
com.icesoft.faces.facelets.D2DFaceletViewHandler
</view-handler>
</application>
</faces-config>

(this page helps you add xml code to your blog: http://centricle.com/tools/html-entities/

The next important configuration file is the web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>ICEfaces 1.8.1</display-name>
<description>web.xml for a icefaces 1.8.1 application</description>

<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>

<context-param>
<param-name>com.icesoft.faces.synchronousUpdate</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>com.icesoft.faces.concurrentDOMViews</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>

<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Persistent Faces Servlet</servlet-name>
<servlet-class>
com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>Blocking Servlet</servlet-name>
<servlet-class>
com.icesoft.faces.webapp.xmlhttp.BlockingServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>*.iface</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Persistent Faces Servlet</servlet-name>
<url-pattern>/xmlhttp/*</url-pattern>
</servlet-mapping>


<servlet-mapping>
<servlet-name>Blocking Servlet</servlet-name>
<url-pattern>/block/*</url-pattern>
</servlet-mapping>

<session-config>
<session-timeout>
30
</session-timeout>
</session-config>

<welcome-file-list>
<welcome-file>justatest.iface</welcome-file>
</welcome-file-list>

<listener>
<listener-class>
com.sun.faces.config.ConfigureListener
</listener-class>
</listener>

<!-- Listener implementation to handle web application lifecycle
events -->
<listener>
<listener-class>
com.sun.faces.application.WebappLifecycleListener
</listener-class>
</listener>
<listener>
<listener-class>
com.icesoft.faces.util.event.servlet.ContextEventRepeater
</listener-class>
</listener>
</web-app>


I use xhtml files for developing the user interface. If I enter the URL http://...../justatest.iface , the corresponding xhtml file will be rendered and send back to the client. (see the highlighted parts)

Last but not least the maven pom.file for all the required libraries

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>yourGroupID</groupId>
<artifactId>YourApplicationID</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>YourApplicationName</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-facelets</artifactId>
<version>1.8.1</version>
</dependency>
<dependency>
<groupId>org.icefaces</groupId>
<artifactId>icefaces-comps</artifactId>
<version>1.8.1</version>
<exclusions>
<exclusion>
<artifactId>jxl</artifactId>
<groupId>net.sourceforge.jexcelapi</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
<finalName>YourApplicationName</finalName>
</build>
</project>



So, have fun developing with ICEFaces and let me know if this configuration was helpful for you.
Greetings Daniel

2009-08-11

Which web application framework do you recommend?

Hi guys,
it has been quite a long time since I published my last post. Sorry for that. Now that summer has finally arrived in Germany, it seems that every day there is an event after work. So I haven't found much time for developing. But one of my goals for the next few weeks is to release the first version of a Basketball Software, which a friend of mine asked me to do develop. I am not happy with the progress I am making, but my real life projects have a higher priority.
Considering this Basketball App, I started setting up the entity model, set up the workspace including a hudson environment (I love hudson, even for a one man project) and wrote the first session beans. I chose EJB3 for the backend part. However, what I haven't decided yet is the front-end part. I have done some projects using different JSF implementations, but I am thinking about whether I should try out something else. Can anyone of you recommend me something?
What about JavaFX? How good is the integration with JavaEE?
What about Wicket, GWT or Google Gears?
I'd love to do an evaluation for all of the implementations. Maybe I ll find some time to create one feature (like the createNewPlayer userInterface) with each of the frameworks. But if anyone out there has already done this evaluation, I would be very grateful.
So..as soon as I reached a certain progress level, I will write something about the upcoming application.

Have a great day..
Daniel

2009-07-28

JavaEE with RAD 7.5 and WAS7

Hi guys,

as I promised to post my experiences with RAD7.5 (Rational Application Developer) and WAS7 (Websphere Application Server), I will now show you what I tried to implement during the WAS7 presentation/workshop using the RAD7 wizards and code snippets.

STEP1: I created a WebProject
STEP2: and added a Servlet

--> there was no code skeleton generated for the servlet. Netbeans generates you at least something like this.

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
/* TODO output your page here
out.println("");
out.println("");
out.println("");
out.println("");
out.println("");
out.println("Servlet Testservlet at " + request.getContextPath ());
out.println("");
out.println("");
*/
} finally {
out.close();
}
}
STEP3: I tried to deploy the WebProject to WAS7
--> RAD only allows you to deploy EAR files, so if you want to deploy only the war or ejb, you have to use the admin console. Very inconvenient. If you try to use the context menu and select run on server on the web project, you get the following exception:
Could not find a valid parent module to add to the server.

STEP4: I created a EJB Project
STEP5: and added a local stateless session bean, with some hello(String name) implementation
--> the wizard asks you to create a class diagram, which is a nice feature.
STEP6: I created a EAR project and added the EJB and the WebProject
STEP7: Invoke the local stateless session bean from the servlet
--> Of course, I could have coded this feature very easily by just adding the @EJB annotation but I wanted to see what the snippet produces, so I used the snippet: CALL a Session Bean Service method. The snippet wants to create an ejb reference and asks you to select the session bean. I selected my local stateless session bean and received the following error: Remote interface cannot be empty. So RAD tells me I can not invoke a local session bean from servlet where both projects are part of the same EAR? Interesting....
If I select remote even if the interface doesn't have a remote interface, RAD finally generates something...some code with compile errors...Welcome back to the world of EJB2.1 :) Feoijesfer is the name of the reference I had to enter... :)

protected FeoijesferRemote createFeoijesferRemote() {
= () ServiceLocatorManager.getRemoteHome(STATIC__REF_NAME, STATIC__CLASS);
try {
if ( != null)
return .create();
}catch (javax.ejb.CreateException ce) {
// TODO Auto-generated catch block
ce.printStackTrace();
} catch (RemoteException re) {
// TODO Auto-generated catch block
re.printStackTrace();
}return null;
}

private final static String STATIC__REF_NAME = "ejb/Feoijesfer_2";
private final static Class STATIC__CLASS = .class;

After this result I didn't want to waste any more time with RAD7.5. Of course it is now possible to create JavaEE applications with IBM products, but don't use the wizards I used. Do it yourself or switch to Netbeans.


2009-07-22

Free Sun webinar: Make Applications Highly Available: Load Balancing GlassFish Clusters

Hi guys,
today I attended at my first SUN webinar. Hopefully it won't be my last one with SUN, because I really liked it. It started very amusing with a hint regarding questions about Oracle. So, if you have questions regarding the Oracle Sun deal, please go to sun.com or oracle.com website. We won't respond on questions about this.

John Clingan, the GlassFish Group Product Manager, started this webinar with a presentation of the benefits of open source and keywords like: productivity focus, community and transparency, annual subscriptions, performance tuned and pay at point of value. Then he introduced the Sun GlassFish portfolio at a high level. The Enterprise Server, the Web Space Server (portal for website development and collaborative workspaces), Web Stack (a complete LAMP stack) and Glassfish ESB.

The main focus of this 1-hour webinar was on High Availability and Load Balancing with GlassFish V2.1. He quickly explained the features of the High Availability Database (HADB) with its 5-9s and the in-memory replication. If you want to have more information, I recommend reading the administration guide or this slideshow. After John, Shreedhar Ganapathy continued with his part about Load Balancing. He answered the question why Load Balancing is so important. If you want to meet business SLA's you have to have scalability to address any growth requirement. Fault tolerance is also very important to prevent any service degradation. Later he explained the GlassFish Load Balancing Plugin, which works with SunWebServer, Apache WebServer and Microsoft IIS.

Then it was time for the first demo. John showed us how to install Sun GlassFish Enterprise Server v2.1 with HADB on a Solaris platform. Apparently, it didn't work because of some problems while providing the path of the installed webserver. Therefore, this step was skipped and instead replaced with a demo deployment of a HA JSP Sample Application. The application was deployed on a cluster consisting of 2 instances. It showed us how to keep values in a HTTP session if one instance fails (they stopped one instance manually).

The last 10 minutes of the webinar were dedicated to questions: Here are some examples: I asked what makes GlassFish clustering and Load Balancing better than what IBM Websphere offers? Answer: It is much easier to install and support and administer through a centralized UI. In addition, it is the only Open Source App Server that supports 5 9s availability. Another question was: What will healthchecking actually do? Check if there are any exceptions thrown? Healthchecking checks, whether instances in a cluster are alive, dead or slow. What is a node agent or what is IIOP or even what is EJB ;) ? There were many different questions. As John couldn't answer all of them, he got support from other experts.

As already mentioned, I really enjoyed this webinar. The skill of the speakers is amazing. You can ask questions to the real GlassFish experts. Of course you can't teach a topic like this in only one hour, but the speakers did a great job in giving an overview. I have to admit that I still have to learn a lot about High Availability and clustered environments. Until now, I didn't care much about this topic as it didn't affect my work as a developer that much. But there's lots of great documentation to read....which I will start with....tomorrow..





2009-07-21

Introducing Websphere Application Server V7 (or WAS 7 with RAD 7.5)

Today I took part at a workshop/introduction of Websphere Application Server V7 in Stuttgart, held by 2 very nice guys from Nice, France. As a convinced glassfish user I was very curious about the first IBM Product, which is completely JavaEE compatible. Version 6.1 with fix packs for EJB or JAX-WS had still some missing things, such as the administration of web services. As I have been working with Websphere in some projects I had lots of critical questions, like what about the bad server start up time or the installation size? But maybe it has become better and they did some improvements since WAS6.1? Let's see what they told us.

I have learned that Websphere is not just an Application Server. It's an ESB, a ProcessServer, an XD, a Portal, a Business Modeler... Great news, but what about the licenses? Is it all included :)

The installation of WAS 7 takes about 200-300 Megabyte of your hard disk and a installation time of about 10 Minutes, maybe a bit faster, depending on your machine. If you want to create a profile which takes about 20 MB, you need some additional time for its creation. At lunch i asked how it can take up to 10 Minutes for 200 MB???? The speaker told me he has been asking this question since 10 years.. It's unbelievable.. WAS7 is installable on Windows and Linux/Unix. But let's be honest. Windows, RedHat and AIX.

With the same license for WAS7 you get a RAD Assembly and Deploy version, which provides basic support for creating JavaEE applications, deployment and testing. You have to pay some extra money if you want to have the RAD for Websphere (Rational Application Developer) where you get extra features like Adapters, Portlets, Crystal Reports, RUP, ReqPro, etc.

Then they gave an overview over the new features of JavaEE 5. It was mainly about the changes/improvements between EJB2.1 and EJB3 and JPA. They agreed that the release of WAS7 is pretty late, as we are almost about the new release of JavaEE 6 this year.

The next topic was the first demo. It was about the creation of Jax-WS webservices.
I looked at the time, as I remembered having had some problems with creating webservices with WAS6.x and RAD7. He started at 10.22 am, created a HelloService POJO, and created a webservices from this pojo with the help of the IDE. Within this menue u can can choose to create a client as well, deploy everything and call the test page. At 10.26 he was done. This was pretty good, as he did some explanation in between. He could have been faster ;) After this he attached a policy set through the admin console, added WS-ReliableMessaging, assigned a binding for it and finally exported it (you could choose between WSDL or WS MetadataExchange). After this, the client was configured, using generated policy. This was a very nice demo.

After the demo, they showed us the huge configuration possibilities Websphere provides, like BLAs (I like this expression, Business Level Applications), Filtering Options, Security Settings, Messaging Improvements and Clustering Settings. After lunch they presented the second demo. Also a very nice one. They created a clustered environment with two laptops and two nodes. Then we finally had time on our own to do some labs, which were prepared for us. I took the time for developing some servlets, jsf pages and ejbs, which weren't part of the lab. More about my experiences in the next post.

So, what about my summary?
I was really impressed by the skill of the 2 speakers. I wasn't sure whether it would be a pure marketing event or not? And it was a very technical event, which I really liked. I see that Websphere has its strength in it's admin console, where you can configure like almost everything. They have a strong focus on security and clustering issues and they don't care much about start up time or deployment time. If everything is configured well and you have a well clustered environment, you will have a good running environment in the end. But I am not sure if they focused on how to get there. Server start up time or redeployments is what a developer does every day, and there you have other applications where you can develop much faster. In my opinion, a developer will definitely be happier with Netbeans and glassfish.

2009-07-17

ICEfaces-1.8.1 AND NetBeans-6.7

Hi guys,
for all of you who developed web applications using ICEfaces with Netbeans 6.5.1 and now switched to Netbeans 6.7, you will no longer find the ICE Faces Plugin within 'Plugins - Available Plugins'
Instead you have to download it manually from http://www.icefaces.org/main/downloads/
After downloading go to Netbeans>Plugins>Downloaded>Add Plugins...>
Select both org-icefaces-netbeans-modules-lib.nbm and
org-icefaces-netbeans-modules-web-frameworks.nbm
The first one provides the run-time-libraries whereas the second one is for the netbeans project integration.
And if you are now about to create a new WebProject, Select ICEfaces and under ICEfacesConfiguration, you can now make Netbeans create a welcomeICEfaces.xhmtl (Facelets only). You should focus on using Facelets, as jsp will probably vanish with JSF2.0

So have fun!

For those who don't know ICEfaces (I really love this name..sounds pretty cool :) )
ICEfaces is an open-source Ajax application framework that enables JSF application developers to easily create and deploy thin-client rich Internet applications (RIA) in pure Java.