Search This Blog

2013-10-17

Startups entdecken die Zielgruppe der Teenager

Check out www.tbh.co My latest mobile app (messenger app for teenagers) check out this article (in german though) about trending mobile messenger apps http://netzwertig.com/2013/06/11/snapchat-ask-fm-tbh-startups-entdecken-die-zielgruppe-der-teenager/

2010-07-12

Social Network Update

Hi there!

Several weeks have passed since my last blog post. But the last few days I spent some time updating my social web profiles.
There's a lot to do if you want to be up to date. And think of all the different passwords ;) But anyway, I finally finished reorganizing all my accounts.
On my google profile you can find all the relevant information and social network links (Google Reader, Twitter, Xing, Picasa and LinkedIn).
Feel free to follow my shared items on google reader or add me on linkedin

Greetings Daniel!

2010-04-10

Article about Agile Best Practices

Hi there,

Java Spektrum, a german magazine for java software development published my article about agile software development best practices.
Here is the link (however it's written in german)
I put a lot of effort into this article. It is written from a developer point of view, but without any language specific issues.

2010-03-23

Maven - Netbeans - JavaEE5 -Compile on Save?

Hi,

it has been quite a long time since I published my last post. I have had a very tough time with lots of stuff to do.
But let's continue with a topic/a solution for a problem I have been waiting for several month.
It's about developing maven JavaEE5 projects with Netbeans 6.8. If you have the following project structure : one EAR which contains webprojects and ejb projects and you want to see changes you add to your web content (e.g. .jsp , .faces) directly in the browser without rebuilding or republishing, Compile on Save is the feature you should be looking for.
However, exactly for this usecase, it's not working. The corresponding netbeans bugfix is scheduled for Netbeans 6.9.
I think it is almost impossible to switch from ant (with ant-based projects it works perfectly) to maven. Maybe you ask yourself why I want to switch to maven? It's because of my favorite, the one and only hudson continuous integration server. Hudson is optimized for Maven-based jobs and it makes it way easier to create, extend and monitor these jobs.
I am kind of surprised because only 4 people voted for this issue. It could be that it's because of the few Netbeans users. But among german voters in this survey at jaxenter I see that this can't be the case. So is it because the few JavaEE5 projects with maven? What's your opinion?

Daniel

2010-01-23

CDI JSR-299 updates

Hi guys,

I just want to tell you that I updated the post about my first CDI impressions. I will update this post regularly (see the red bold update text), in order to have one blogpost that contains all the neccessary information for CDI beginners.
By the way, have you searched for CDI on twitter?
Most of the results are not about JavaEE, but Mercedes Benz cars, as CDI also stands for Capacitor Discharger Ignition, which is used in many Mercedes Benz car models. :)

Another funny thing is WELD TEST (Weld is the JSR 299/CDI reference implementation). In the last few days I was looking for a way to write JUnit test for the CDI features. As you need a container, it's tough to test it outside a container. However, Gavin King described in a forum post how to test CDI(Weld). There's going to be a WELD TEST. If you google it...you'll find ...

Anyway, before jumping to the next JavaEE 6 component, I will try to write some Dependecy Injection Junit Tests and tell you about it... I am of the opinion that CDI testing has not been considered that much until now (at least you won't find much about it)

Greetings
Daniel

2010-01-13

Happy Developers and the ROTI Meeting

Hi alltogether,

As this i my first post in 2010, I wish you all a great start and all the best!
My holiday is over and project work has started.
Before continuing with more Java EE 6 examples, I want to tell you about two really great articles about the motivation of developers and the ROTI Meeting.
I really don't like any stereotype thinking, but as it exists I think it is very important for all the non developers to realize what developers really want....

1) Being Set up to Succeed
- Good requirements
- Realistic Deadlines
"Being forced to build crap is one of the worst things you can do to a craftsman"
2) Having Excellent Management
3) Learning New Things
4) Exercising Creativity and Solving the right kind of problems
5) Having a voice
"When a developer speaks, someone should listen. When several developers are saying the same thing, someone should listen and act . . .quickly"
6) Being Recognized for Hard Work
7) Building Something that Matters
8) Building Software without an Act of Congress
9) Having Few Legacy Constraints
(this is taken from the following article at DZONE)

As a consultant who has a strong focus on developing applications I completely agree with all these points. It is often very hard to have no influence in the decision making process (developers.getProjectRoles().contains(ProjectRoles.DECISION_MAKER)==false). I also sometimes ask myself whether developing software is the main goal of some (software) projects, it could also be attending as many meetings as possible. What I care most about is point 5. Agile Processes, where problems can be solved quickly when several developers try to change something, is a very important part. It's so frustrating if your voice is ignored, especially when you have the whole team behind you. So if the goal is writing software and you really want to do it in time with a certain quality, every project definitly needs happy developers.

For all of you who don't like those "mandatory no result meetings", have you ever heard of the ROTI Meeting?
The following part is just an extract from the link above, so if you want to read more about it, follow the link.

After every meeting, on the way out the door, draw a diagonal line on the whiteboard with the labels 0, 2, and 4.
Each person in turn gives a number on how the meeting performed as a "Return on Time Invested" and the person with the marker draws in the rating. Here is the rating scale we used:

0 = "I'd have been better off making a Starbuck's run. Complete waste of time"
1 = "You really should have let me stay at my desk and code"
2 = "This was an OK meeting. About as valuable as if I'd been coding"
3 = "Surprisingly, this was more valuable than if I'd been writing code"
4 = "Wow, this meeting saved me tons of time. Thank goodness I didn't skip it to code"

Are you asking yourself about the benefit. It's about retrospective, optimizing your productivity and keeping the motivation at a good level. I am a big supporter of retrospective and I can handle criticism (as long as it is goal-oriented), so I would give the ROTI Meeting a try. What do you think?

2009-12-28

High-Tech

Hello again,

Since I am somehow related to Sweden I travel to this country regularly.
Every time I go there I am astonished by the wide spread technological progress and its common use in every day life. Not only young people are using new technologies, but also grandmas, or grandpas!
To give you some examples.

Number 1: In the supermarket:
At ICA, the largest retail company in the Nordic countries, you can chose between paying your food the normal way (shopping cart, scanning, checkout) OR with a self scanning service. See the following video.



After you chose all of your things you have to go to one of those machines and pay: By the way, I didn't have any problems scanning the goods. And yes, you can cheat, but the Swedes are honest people.




Number 2: Virtual bus ticket (SMS)
If you want to purchase a bus ticket in a city in Sweden, you can send a text message to obtain your virtual ticket. After you receive the message (your ticket) you have to show it to the bus driver.


There's also a nice article about this topic.


Number 3: Facebook usage
Another amazing thing is the fact that in Sweden even grandmas have facebook accounts. They sometimes use facebook to invite their grandchildren for "fika" (the swedish word for coffee break). Unbeliveable! I have problems explaining my dad the difference between SMS, CD, DVD and Email :)

Last but not least, for all the statistics lovers, visit this link
For all the developers out there, the next possibility for a visit to sweden will be on March 16-17, at the Scandinavian Developer Conference 2010. By the way, the Swedes speak English very well, so there are no language barriers not to visit this country :)

Hälsningar/Greetings (from Sweden)
Daniel

2009-12-23

Java EE 6 - CDI (JSR 299) - my first impressions

Hi there!

After taking some time to go through various documents (see link list below) and do some coding samples about the topic CDI, the following things came into my mind:
"lots of annotations", "very abstract specification", "what role will CDI play in JavaEE within the next years?", "can become quite powerful", "I need some best practices".

The specification of CDI (CDI stands for Context and Dependency Injection) with its 92 pages is in my opinion not the right place to start if you want to learn CDI. It is an abstract specification, which shows all the elements a CDI capable container must implement. I really like the specification, but as the code samples didn't really help me (due to missing explanations), I think it is just not the best place to start.
Weld, the reference CDI implementation, offers a great documentation (see link below).
By the way, there are other implementations, too: Resin Candi and Apache Open Web Beans.
If you use Glassfish V3, Weld is included and if you develop using the WebProfile (see earlier post), Weld is even included.

But what is CDi all about? CDI offers..
- an improved lifecycle for stateful objects, bound to well-defined contexts
- a typesafe approach to dependency injection
- object interaction via an event notification facility
- a better approach to binding interceptors to objects, along with a new kind of interceptor, called a decorator, that is more appropriate for use in solving business problems
- an SPI for developing portable extensions to the container.

Gavin King mentioned in the interview:
Originally JSR 299 was called Web Beans, to emphasize its role in making the web technologies of Java EE 6 work better with the transactional access technologies. Originally, one of the key problems we wanted to solve was how can we build an application that uses JSF very easily together with technologies like EJB. So it was originally called Web Beans...It over‑emphasized that this was a web technology, when if you actually look at CDI, it's actually something much more general than that. So after much discussion, the name of the spec ended up being changed to “Context and Dependency Injection."

One of the main buzz words is (Managed) Bean. We have been using beans in Java a lot before. There are Enterprise Java Beans, Message Driven Beans or JSF managed beans. Now, in JavaEE 6 the word bean finally gets a well defined definition.
Managed Beans are defined as container managed objects which support a small set of basic services, such as resource injection, lifecycle callbacks and interceptors
With very few exceptions, almost every concrete Java class (also known as pojo) that has a constructor with no parameters (or a constructor designated with the annotation @Inject) is a bean. This includes every JavaBean and every EJB session bean.

To give you a short impression about what a Managed Bean can look like see my BeyonceBean :)

@Named
@SessionScoped
public class BeyonceBean implements Serializable {

@PrivateMusicLabel
@Inject
private Label label;

@Produces
@Named(value = "singBeyonce")
public String singBeyonce() {
return "Everywhere I am looking now, I am surrounded by your embrace...Halo Halo Halo";
}

public String getInjectedMusicLabelInfo() {
return label.toString();
}
}

If you want to learn CDI you should stick to the Weld Documentation provided by JBoss. There are many well described code samples. Maybe this code sample explains what first came into my mind: " lots of annotations" . I am sure it'll take some time to get used to this way of Java enterprise coding. With CDI you really focus on creating/using lots of annotations, either for type safety reasons, for interceptors or decorators.
UPDATE 01-23-2010
Reza Rahman, a Resin team member, provides some perfect articles for CDI beginners. I really like the way he explains the CDI features. So this link might be a perfect if you are new to CDI.

Another reflection I would like to share with you is my CDI experience with Netbeans 6.8 and Glassfish V3.
- If you don't annotate your Bean with @ManagedBean you don't get the JSF code completion feature. This is very inconvenient. But I am sure the Netbeans developers and community will provide a solution soon.
However, there is actually a more general problem with the @ManagedBeanAnnotation. The article Is @javax.faces.bean.ManagedBean Dead on Arrival?. describes that there are 3 different ways in JavaEE6 of how to define a ManagedBean in the source code: with JSR 316,250/JEE6Spec,AnnotationSpec javax.annotation.ManagedBean, with JSR 314/JSF2Spec javax.faces.bean.ManagedBean and with JSR299/CDISpec javax.inject.Named. So which one should we use? Use the @Named annotation!
- Then I had some problems with the Deploy on Save. When I changed the scope of the bean from request to session, I had to do a clean, otherwise I got a deployment error "Managed bean declaring a passivating scope must be passivation capable" -- which means must implement serializable (even though I added the Serializable interface).
I am going to take a closer look at this and see if there already are some open issues. Otherwise I will submit this problem.

My conclusion:
As I haven't figured out the full capacity of CDI and as it seems to have the power to change the way of writing Java EE applications essentially (or may even become the new JEE6 core programming model), I am very interested in CDI and I will continue reading about it.. As soon as ICEFaces 2.0 will be released I will update my training application from JavaEE5 to EE6 and focus on applying CDI features. As I will have to wait for at least another month I will keep an eye on how CDI is evolving.

Here are the links:
Specification - JCP 299 CDI
Weld documentation - JBOSS about CDI
Gavin King on CDI - tech discussion @ javalobby
CDI capable servers and deployment - see here

UPDATED 01-20-2010:
Java EE 6 Codecamp - Here you can do some CDI homework examples. A great way to learn Java EE.

2009-12-19

Java EE 6 - The WebProfile

Hi guys,

Within the next few weeks/months I will write about the new Java EE6 components.
The first new feature I am focussing on is the so called WebProfile.
The Web Profile is targeted at developers of modern web applications.
Within the last years developing web applications has become more and more important. However, there has also been a large number of technologies for the creation of web applications. All of them had to face similar challenges, like security handling, persitence or transaction handling. The WebProfile aims at defining a basic stack for developing web applications using the Java platform.

The following technologies are required components of the Web Profile:
•Servlet 3.0
•JavaServer Pages (JSP) 2.2
•Expression Language (EL) 2.2
•Debugging Support for Other Languages (JSR-45) 1.0
•Standard Tag Library for JavaServer Pages (JSTL) 1.2
•JavaServer Faces (JSF) 2.0
•Common Annotations for Java Platform (JSR-250) 1.1
•Enterprise JavaBeans (EJB) 3.1 Lite
•Java Transaction API (JTA) 1.1
•Java Persistence API (JPA) 2.0
•Context and Dependency Injection (JSR-299)

The maven repository offers the following jar for the WebProfile
(see maven repository url).
Include it into your pom like this:

<repositories>
<repository>
<id>java.net2</id>
<name>Repository hosting the jee6 artifacts</name>
<url>http://download.java.net/maven/2</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>

If you chose Netbeans 6.8 as your development environment you can create a maven built web project. In the project properties within the run menu you can switch between the different profiles (full and web).

After switching you see the difference in the libraries (the full profile uses the javaee-api-6.0.jar).

The Java EE6 reference implementation Glassfish V3, based on OSGI, allows the dynamic addition of new functionality both from Sun and third parties. Glassfish V3 offers both the Full JavaEE profile and the new WebProfile.
Based on internal Sun benchmarks, Sun GlassFish Enterprise Server v3 startup times are over twice as fast as v2 and in the case of the Web Profile offering, nearly three times faster.
The following glassfish page gives you a perfect overview between what is included in the Web Profile and in the Full Java EE Profile.


I really love the new WebProfile. Not only because of the performance boost, but also because of the simplified packaging (No EAR packaging needed anymore). So if you don't depend on JMS or remote EJBs, the new WebProfile is what you were looking for as a web developer. Give it a try.

2009-12-13

Java EE 6 - The Overview

Hi altogether,

While enjoying my christmas holidays in Sweden I have enough time to look at some of the new features Java EE 6 offers.
Here's the overview:

- JavaTM Platform, Enterprise Edition 6 (Java EE 6) Specification, JSR 316
- Contexts and Dependency Injection for the Java EE Platform (CDI), JSR 299
- Enterprise JavaBeans 3.1 (No Interface, Singelton, asynchronous EJBs vs MDBs, Timer), JSR 318
- Java API for RESTful Web Services (JAX-RS), JSR 311
- JPA 2.0 (Support for Pessimistic Locking), JSR 317
- Dependency Injection for Java, JSR 330:
- Bean Validation, JSR 303
- Servlet 3.0, JSR 315
- JSF 2.0, JSR 314
- new Deployment possibilities
- improved/simplified testing

Right now I am focussing on CDI (JSR 299), which is a pretty big new part in Java EE 6. It'll take some time to summarize. In the meantime, I hope you're enjoying your free days over christmas.

So God Jul, Merry Christmas, Frohe Weihnacht, Feliz navidad, Joyeux Noël! or if you need some more translations...

So JavaEE 6 and Glassfish V3 are ready to rock!

Hi guys,

I want to tell you my first experiences with JavaEE 6 and Glassfish V3.
By the way, I favor Netbeans over Eclipse because of the great JavaEE wizards and maven integration (Netbeans Version 6.8 was released on the same day as Glassfish V3)

The first thing I did was trying to deploy my JavaEE 5 application on glassfish V3. BUT, not as an EAR project, but as a Web Project.
I really like the fact, that you don't necessarily need the EAR packaging. If you put your packaged EJB Content (xxx.jar) into the folder WEB-INF/lib of your WebProject, Glassfish automatically recognizes that your application contains EJBs. The same if have JPA Entities.



One of the biggest benefits I get from using only the WAR file is the great deployment time and the Deploy on Save functionality. There are still problems with Netbeans if you want to use the deploy on save feature with maven built javaEE projects. (Ear, War, EJB), see this post. But with only one war file all the changes you do to your web project will be deployed automatically. You just have to turn on the Deploy on Save within the Projects Properties .



Starting GlassFish V3 and deploying my application on my MacBook Pro takes about 19 seconds:
INFO: GlassFish v3 (74.2) startup time : Felix(3459ms) startup services(15633ms) total(19092ms)
Once started the redeployment due to deploy on save is so fast, i don't event see netbeans redeployment status window in the corner down right. :)
So to make my application be JavaEE 6 compatible I also had to do some changes on the Web Project itself. I had to update the web.xml and I moved the configuration within the faces-config.xml into the beans itself by using the following annotations:
@ManagedBean(name = "Login")
@RequestScoped

But as I use ICEFaces and ICESoft hasn't released the final JSF2.0 compatible version I still have to wait until I can benefit from this great perfomance boost, JavaEE6 will bring. There is a alpha release of ICEFaces V2.0 however, there's too much things to fix if you want to make it work. If you are interested in the latest problems see this post.

So this was just my first impression on JavaEE6 and glassfish. I will tell you more about the new features of JavaEE as soon as ICEFaces 2.0 is released.
Greetings and have a nice day!

2009-12-10

Waiting for JavaEE 6

Hi alltogether,

After the approval of the Java Enterprise Edition 6 (Java EE 6) Specification we are very close to the final release.
Roberto Chinnici writes in his blog that the release date will be december 10, 2009, when Glassfish V3 will be available.
I am really looking forward to these releases. However, as a user of the ICEFaces Framework, I still have to wait until ICEFaces 2.0 is going to be released. ICEFaces 2.0 will be the JSF2.0 compatible version. Right now there's only a alpha version available.

So, if you like to read more about the new features of JavaEE6 and Glassfish V3, check out the following links:
- JavaEE6 @Sun
- GlassFish V3

2009-11-30

Netbeans 6.8 Release Candidate 1 - my first impression

Hi there,

from now on you can download the release candidate 1 for Netbeans 6.8. download it here
For those who don't know anything about the build types for Netbeans releases here are the possible enums :)
- Milestone
- Early Access
- Beta
- Release Candidate
- Release

I was very curious about this release candidate. The most important feature I am missing / waiting for is the Compile on Save feature for Maven Java EE Projects (vote for it here) However, this feature hasn't been implemented yet. In my opinion, this is a must have feature if you develop javaEE projects with maven and netbeans. So hopefully it will be implemented in the 6.8 release version. Let's wait and see.

Another problem I faced with Netbeans 6.8 M2 was the very frequent Glassfish PermGen Out of memory exception. I've been getting it whenever I published too often (means after about 20 deployments of the ear project within an hour).
While working with this release candidate for the last hour this OutOfMemory Glassfish problem hasn't occured. Good news.

Another problem also vanished. Netbeans sometimes crashed when I was trying to insert jsf value binding in xhtml files.

All in all the Netbeans developers are doing a great work. Keep on developing!!! Thanks a lot for this great IDE.

2009-11-15

Netbeans 6.8beta, Glassfish V2.1, EJB 3.0 Deployment Problems

Hi alltogether,
Within the last few weeks I sometimes had to face with the following exception, which appeared out of nothing.

Exception occured in J2EEC Phasejava.lang.IllegalArgumentException: Invalid ejb jar [...EJB-1.1-SNAPSHOT.jar]: it contains zero ejb.
Note:
1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or message driven bean.
2. EJB3+ entity beans (@Entity) are POJOs and please package them as library jar.
3. If the jar file contains valid EJBs which are annotated with EJB component level annotations (@Stateless, @Stateful, @MessageDriven), please check server.log to see whether the annotations were processed properly.

At first, I thought it was a problem with changing the snapshot version (see this post)) but this actually wasn't the problem. Maybe, it's a problem of Netbeans 6.8beta version. Anyway, I still haven't figured out the source of the problem, I can only tell you what you have to do to make it work again. Recreate your glassfish domain. Here is a how to link

I hope this is helpful for you. It took me some hours to fix the problem, which was very annoying.

2009-11-01

ICEFaces meets JSF2.0

Hello again,

As I have been developing most of my applications with ICEFaces as JSF implementation, I am very curious to test the first version of ICEFaces 2.0 Alpha. The ICEFaces core is now on the Mojarra JSF 2.0.1 runtime.
Read more about it
http://blog.icefaces.org/blojsom/blog/default/2009/10/30/ICEfaces-2-0-Alpha-1-is-out
As soon as I migrated from 1.8.2 to this Alpha version, I will tell you my experiences.

Netbeans, Maven, JavaEE, new snapshot version problem

Hi guys,
instead of celebrating Halloween I struggled with a problem building my maven based javaEE Trainer application in Netbeans 6.7.1. A few minutes ago, I finally found out what was wrong. The problem I am telling you took me about 3 hours to fix...grrrr

So, what was the problem?
I have an Ear project, consisting of a web project, an ejb project and a jar project, all maven projects created with Netbeans.
When I changed the IceFaces Libraries of the web project I also updated all of the projects pom.xml files, as I created a new snapshot version.
From this point on, I wasn't able to deploy/publish the application anymore! The error message I received was: invalid ejb jar it contains zero ejb

1. A valid ejb jar requires at least one session, entity (1.x/2.x style), or
message driven bean.
2. EJB3+ entity beans (@Entity) are POJOs and please package them as library
jar.
3. If the jar file contains valid EJBs which are annotated with EJB component
level annotations (@Stateless, @Stateful, @MessageDriven), please check
server.log to see whether the annotations were processed properly.


The problem was, that I forgot updating the application.xml within the EAR project. In it, I was still using the older snapshot version of the EJB project. So in my projects target folder, the gfdeploy folder had both the older and the latest snapshot version, which made publishing to glassfish impossible. So never forget to update both your poms and your applicationx.xml, if you are creating a new snaphot version!

Enjoy your weekend!
Daniel

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.