Jun 25

 Save time, reduce risk, save money,. and improve quality.

While Agile development methods tend to become easier, more effective and reduce the complexity of managing Java Software Development projects and processes; people are still struggling in finding their way through the numerous Java OS technologies, while trying to fit together the most suitable reference architecture for building their business solution. A reference architecture provides a proven template (mix) of Java technologies for building a particular business domain solution. Maven Archetype technology helps companies building these Technology Templates. 

Maven Archetypes

An Archetype is a template for a Maven type of project which is used to create new projects. This technology helps you to establish a set of template projects which serve as a foundation for new applications. These can be extremely useful for organizations that want to encourage standards across series of same type of projects. These templates will be available to your complete organization from one centrally managed respository. Ideally, every company should  supply all projects with a set of templates covering most common type of applications. You might think of having a template for straight forward web based application(JSF, EJB, JPA), SOA service oriented solutions with JAX-WS, ESB Mule or message oriented projects based on MQ Series with message driven beans, and so on.

Archetype content

What can you provide through  this template and how can you encourage standardization? These templates may contain the following artefact’s:

  • Predefined set of Maven dependencies, reporting and build plugins, everything you can configure on Maven project configuration that you would like to standardize for your company.
  • Standard set of configuration files for Log4j, JPA persistence.xml, JSF faces-config.xml, everything that you can imagine that could come by default for every project.
  • Set of mock objects, abstract JUnit tests, everything that could be standardized.
  • A module and package structure, which expresses the layered structure of your solution.
  • A thin set of demonstration components, which illustrate the best practise usage of the technology.
  • Standard Maven site generation templates, for instance a default set of xdoc templates for generating the technical documentation on your projects.
  • Anything more you can imagine that could be standardized for all projects.

The biggest challenge composing these template projects is in finding the correct set of technologies and libraries that fit in one template. For all individual technologies the same criteria applies; reliabability, stability, maturity, future proof, do these components fit together and finally; do they run on your Java Application Server run-time environment?

Templates provided by this site

Match the right  Maven project template with your Reference Architecture

Through this Blog we try to help you a bit in finding the right technology mixes for different kind of requirement areas, trying to compose reference architectures for you. Every Maven Archetype contains a small set of  components which demonstrate the technology, they can be unpacked on your computer generate new projects for you. The resulting projects will reference the correct component libraries that will make up the specific reference architecture you might need for developing a certain kind of business solution. From that point on you can fill in your business logic, not bothering about which technologies to choose, if they perform, if they conflict, etc… and finally you will be able to build, deploy and run your solution on JBoss Application Server without additional effort.

Find the best Agile Development Environment to continue developing the new project

These Maven Archetypes will generate the basis package structure, references to all libraries, initial setup of configuration files on your new Java Maven project. From that point on you start building up your application in a Agile approach, in which your system is broken down in small increments, each increment will be developed  through multiple iterations. You probably need a powerful development environment which helps you to continuously build, test and deploy your system while delivering all these increments to run-time environment. ADE (Agile Development Environment) is a environment composed of best of breed tools which are practised by a large Java development community. These components are all free of license, read more on how you can put your own Agile Development Environment together with no cost and low effort.

 Before reading this page you should first install the minimal set of tools (Eclipse, Maven, JDK 1.6) which are part of setting up ADE. Read the ADE pages for installing and configuring these tools.

This web log is about modern technologies and effective guidelines which will help you develop enterprise Java applications more effectively and bring simplicity back into the world of JEE software development. Key technologies covered on these pages are JSF, EJB3.1, Hibernate JPA which help reducing the complexity with developing Java EE applications significantly.  Focusing on JEE 6 compliant application engineering, ready to be deployed on JBOSS 6 application server environments.

Additionally discussing the tool-set which will help you managing the complete Agile iterative development lifecycle, like Eclipse, Maven2, SubVersion,  Continuum continuous integration, Junit test automation, test coverage  and code quality assessment tools like Findbugs, PMD, Checkstyle and Cobertura test coverage. How to setup effective Maven reporting, implement your own technical documentation site generated by Maven reporting and xDoc templates.

Discussing how object mocking frameworks like Mockito can help simulating infrastructure components while unit testing your business logic components.

The Agile Java subjects that will be demonstrated by example are:

  1. Developing JSF2.0/EJB3.0/Hibernate JPA 2.0/Mockito/HsqlDB apps  with Eclipse/Maven/Continuum running on JBOSS 6.
  2. Developing Simple EJB3.0 webservice with Eclipse/Maven/Continuum running on JBOSS 6.
  3. Developing DDD Domain Driven Design app with Naked Objects (Apache Isis) with Eclipse/Maven/Continuum running on JBOSS 6.
  4. Developing scheduling solution with Quartz with Eclipse/Maven/Continuum running on JBOSS 6.
  5. Manage your Java App configuration more effectively with Apache Commons Configuration, we deliver an example by Maven Archetype.
  6. New generation Java LogBacklogging and learn how to bridge legacy Commons Logging, Java Logging and Log4J via SLF4J.
  7. And more to come…

 All these subjects will be accompanied by Maven Archetype template projects from which you can generate new projects, build and run from scratch without any additional effort.

Kind regards and hope I can keep you posted on new Java Agile developments.

Tagged with:
Jun 24

This post walks you through steps for setting up SPNEGO SSO on JBoss AS Server 5 and 6 and MS AS Active Directory on your JBoss AS 5 and 6 environments, based on the credentials kept in your companies Windows AD (Active Directory).  Most companies specify user groups on their AD while designing and implementing conceptual access policy rules for accessing certain kind of application resources.  Users registered in this same AD can be assigned for these special policy groups, which will implicitly grant them specific rights in the application domain.

As for JEE application concerned, these groups can be mapped to Java application roles by configuration, according JEE standards. These Java application roles regulate the access to Web resources (content, pages, etc) and business logic modelled in Java components (EJB / enterprise java beans).  The process for granting the initial access to the application based on a AD user account is called authentication, granting access to specific resources in the application based on the AD user groups which are associated to that specific AD user account is called authorization. Total of  process of authentication and authorization is called RBAC (Role Based Access Control).

In the JEE world, both these processes are facilitated by JAAS (Java Authentication and Authorization Services).  I will not get into the details of JAAS, for this you can read this great article on JavaWorld. To be short, JAAS is a small abstraction layer which allows you to provide different kind of JAAS Login Modules. Each of these implement a certain kind of login procedure based on user registration information (username, password and access roles) specific media, like databases, repositories, etc..

This article is about configuring a SPNEGO Kerberos login module, which is designed to prove user’s identity based on user accounts and group rights that sit in your companies AD Active Directory. Unlike conventional authentication mechanisms which challenge the user for a username and password, this module issues authentication tickets based on information from AD, which allows users to access applications unchallenged.

SPNEGO SSO by example

This post will include an example of a simple JEE JSF/EJB application which demonstrates how you can SSO enable your application with SPNEGO and how you can propagate your AD user groups to JEE Roles which will regulate the access to your WEB and EJB resources. (TODO : will be included in the near future). This example will include all the JBoss configuration artifacts which will enable you to setup your JBoss AS server to be SPNEGO ready.

Short introduction on SPNEGO and Kerberos

SPNEGO (Simple and Protected GSSAPI Negotiation Mechanism) is an abstraction layer and API sitting on top of Kerberos. Kerberos is an authentication protocol used in providing a proof of identity between a client and a server. Kerberos is tightly integrated with Windows AS. When a users logs in on the Windows network, the user is issued a encrypted ticket from AD KDC, which allows the user to gain access to other applications. Important part of AD which is responsible for processing these tickets is KDC (Key Distribution Center). Enough about this, now lets get on with the real work.

Preparing your AD environment (SPN and Keytab file creation)

Per server environment you need to establish a SPN (Service Principal Account), this is a regular AD non interactive user account that is used to identify the server during the Kerberos SSO process. You perform this configuration task on the Microsoft®Active Directory domain controller machine.  Create a user account (in this case the full hostname of your server) in the Microsoft Active Directory (Important: Do not select “User must change password at next logon.) for the server where your JBoss AS is running.

Use the setspn command to map the Kerberos service principal name, HTTP/<host name>, to a Microsoft user account. An example of setspn usage is as follows:

C:\Program Files\Support Tools>setspn -A HTTP/servername.yourdomain.com servername 
To be continued, sorry
Jul 09

Which Eclipse plugin do you prefer to check your projects on effective JUnit test coverage during iterative development

EMMA is a free Java code coverage analysis tool for measuring and reporting JUnit test coverage on your Java code. EMMA offers excellent integrate with Eclipse Indigo through the EclEmma Eclipse plug-in.

After installing the plugin, Eclipse allows you to run the coverage analyzer directly from the Eclipse launcher by launching your project in Coverage mode. After launching your project, the Coverage view automatically appears on your Eclipse editor, showing you a graphical coverage summary view over all your Java components (See screenshot).

The EclEmma Eclipse plugin enables development teams to produce a high test coverage for delivering stabel releases, reporting all the code details not covered by Junit testing. During continuous integration with Continuum, this approach gives us a powerful support by verifying if all business logic is covered by JUnit tests, before delivering the final solution to the end customer for end user testing.

The Unit Test Code Coverage Eclipse plugin EclEmma produces little reports in Eclipse which will highlight code coloured in red which is not covered by JUnit tests.

EclEmmaEclipse

This tool particularly helps developers to check the test coverage on their code on the fly during iterative Agile development approach, before checking in their code to the SVN source code library. Please read more about this subject from the ADE (Agile Development Environment) page.

preload preload preload