Java EE 6, GlassFish and the Interceptor API

Aspect oriented programming and the definition of cross-cutting-concerns is made easy in Java EE 6 using interceptors. In the following tutorial we’re going to take a look at the different possibilities to apply interceptors to your EJBs at class or method level and how to setup a GlassFish instance to run the examples. Prerequisites We don’t need much for the following tutorial – just a JDK, Maven and GlassFish… Java Development Kit 6 GlassFish 3.1 Maven 3 ...

August 17, 2011 · 8 min · 1619 words · Micha Kops

Creating Portlets using Java Server Faces 2 and Liferay

Portlets are a common technology to create plug&play components for modern web applications and are specified by the Java Community Process in several specification requests. In the following tutorial we’re going to learn how to create custom portlets and how to deploy and embed them in Liferay, the popular open-source enterprise portal. In addition we’re taking a look at inter-portlet-communication and how to create portlets using annotations. Finally we’re building a portlet-state-aware Java-Server-Faces portlet using the jsf-portlet-bridge mechanism. ...

July 19, 2011 · 14 min · 2783 words · Micha Kops

Integrating Groovy in your Maven builds using GMaven

Often ant tasks are used in Maven builds but wouldn’t it be more attractive to integrate the Groovy language into our build process? GMaven is the answers to this problem and brings together Maven and Groovy. It allows us to execute Groovy scripts inline from our Maven configuration, from a local script or even from a remote location. In the following short examples I am going to show how to configure Maven to execute Groovy scripts from different locations. ...

July 12, 2011 · 4 min · 655 words · Micha Kops

Confluence User Profile Mobile vCard Plugin released

I’ve released a new plugin for the popular Confluence Wiki that extends the user profile with new tab that displays the user’s vcard as a QR code. This allows an easy import of address data from Confluence to your smartphone. Features Display of a Confluence user’s contact data as a QR code in a separate tab in the user profile More to be implemented .. Installation Just download the plugin from Atlassian’s Plugin Exchange and install it using the Universal Plugin Manager in your Confluence’s administration area That’s all .. nothing to configure here .. ...

June 18, 2011 · 1 min · 138 words · Micha Kops

Creating a LDAP server for your development environment in 5 minutes

I am currently working on a plugin that needs to receive some information from an LDAP/Active Directory using JNDI. That’s why I needed to set up a directory server in a short time and I didn’t want to waste much effort for here. Luckily for me the Apache Directory Studio saved my day and allowed me to set up everything I needed in a few minutes. Short and sweet: In this tutorial I’m going to show you how to configure everything you need in your Eclipse IDE and finally how to query the created LDAP server with a tiny java client using JNDI. ...

June 13, 2011 · 5 min · 914 words · Micha Kops

Message Driven Beans in Java EE 6

Message Driven Beans are no new concept due to the fact that they exist since EJB 2.0 but in Java EE 6 and the EJB 3.0 specification it is even more fun to use them. In this tutorial we’re going to take a look at the specification and create an example application that transfers some objects via the Java Message Service to a Message-Driven Bean deployed on a GlassFish application server. ...

June 5, 2011 · 12 min · 2430 words · Micha Kops

Oh JBehave, Baby! Behaviour Driven Development using JBehave

Behaviour Driven Development is the keyword when we’re talking about test scenarios written in an ubiquitous language, strong interaction with stakeholders, product owners or testers and well described, common understandable test scenarios. The popular JBehave framework is our tool of choice here and allows us to decouple our test stories from the test classes, offers an integration for web tests using Selenium and finally there’s a helpful Maven plugin for JBehave, too. ...

May 31, 2011 · 14 min · 2849 words · Micha Kops

Confluence Social Comments Plugin

I have created a new, free plugin for Confluence, the popular enterprise wiki. The plugin allows you to notify users of ongoing discussions in comments on a confluence page by posting a specific token including the user’s name like this: “@username:” Features Configurable notification settings in the administration area Several placeholders to be used in the e-mail template for the notifications User filtering to avoid sending duplicate e-mails For more detailed information take a look at the Maven generated project website ...

May 30, 2011 · 1 min · 197 words · Micha Kops

SCJP/OCPJP Exam Preparation: Pitfalls to avoid

Last year I passed the exam for the “Oracle Certified Professional Java Programmer”successfully and wanted to share my exam preparation notes about common problems and pitfalls to be aware of. That’s why I have added some code and examples for my top 25 challenges below. Figure 1. ocpjp Exam Preparation I won’t cover how to prepare yourself for the exam, how the exam is structured or what is the best way to process the exam’s questions – these questions are very well covered by the SCJP study guide, JavaRanch.com or other resources of choice – I have listed a few at the and of this article in the resources section. ...

April 25, 2011 · 15 min · 3137 words · Micha Kops

Mocking, Stubbing and Test Spying using the Mockito Framework and PowerMock

Today we’re going to take a look at the Mockito framework that not only does sound like my favourite summer cocktail but also offers nice testing, mocking/stubbing, test-spying features and mock injections. After that we’re going to take a look on how to mock static or final classes by extending Mockito’s capabilities with PowerMock. Prerequisites We don’t need much for the following samples .. Java of course, Maven dependency management and that’s all .. ...

March 27, 2011 · 8 min · 1620 words · Micha Kops