Task Scheduling in Java EE 6 on GlassFish using the Timer Service

Creating cronjobs or scheduled service executions is made really easy in Java EE 6. Scheduled tasks may be created in a programmatic style or simply by adding some annotations to an EJB. In the following tutorial we’re creating some simple scheduled tasks and let them run on an embedded GlassFish instance using the Maven Embedded GlassFish plugin.. Java EE 6 Maven Project from Archetype First of all we’re creating a new maven-ized project using one of the appropriate jee6 Maven archetypes ...

June 22, 2012 · 5 min · 956 words · Micha Kops

Java EE 6 Development using the Maven Embedded GlassFish Plugin

Today we’re going to take a look at the Maven Embedded GlassFish Plugin and how it allows us quick creation of GlassFish server instances in no time and Java EE 6 application deployment. Figure 1. GlassFish + Maven With a few lines of configuration in your Maven’s pom.xml we’ve got a running GlassFish instance and are able to redeploy our application fast by pressing enter in our console. In the following tutorial we’re going to build a Java EE 6 Web Application with a stateless session bean and a web servlet and finally deploy – and redeploy the application using the Maven GlassFish Plugin. ...

September 20, 2011 · 5 min · 978 words · Micha Kops

Creating a sample Java EE 6 Blog Application with JPA, EJB, CDI, JSF and Primefaces on GlassFish

Java EE 6 is out and it indeed offers an interesting stack of technologies. So in today’s tutorial we are going to build a small sample web application that builds on this stack using Enterprise JavaBeans, Java Persistence API, Bean Validation, CDI and finally Java Server Faces and PrimeFaces. The application we’re going to develop is a simple blog app that allows us to create new articles, list them and – finally delete them. We’re also covering some additional topics like JSF navigation, i18n, Ajax-enabled components and the deployment on the GlassFish application server. ...

February 8, 2011 · 17 min · 3575 words · Micha Kops

Creating a REST Client Step-by-Step using JAX-RS, JAX-B and Jersey

Often in a developer’s life there is a REST service to deal with and nowadays one wants a fast and clean solution to create a client for such a service. The following tutorial shows a quick approach using JAX-RS with its reference implementation, Jersey in combination with JAX-B for annotation driven marshalling between XML or JSON structures and our Java-Beans. Prerequisites The following stuff is needed to run the following examples and code samples ...

November 25, 2010 · 8 min · 1630 words · Micha Kops

Using PrimeFaces to pimp up existing Java Server Faces / JSF 2 Applications

In this tutorial we’re going to modify an existing Java Server Faces / JSF 2 web application by adding rich UI components to the existing layout. Our tool of choice here is the PrimeFaces framework. It offers a wide range of interesting, customizable and (several) Ajax-enabled components that blend very well with JSF1+2 and also a solid documentation that allows a quick integration into existing projects. Project setup For this tutorial we’re going to reuse the web application from my JSF2 Tutorial “Java Server Faces/JSF 2 Tutorial – Step 1: Project setup, Maven and the first Facelet” – the source code is available at GitHub.org. ...

November 14, 2010 · 6 min · 1197 words · Micha Kops