Jun 25

 Save time, reduce risk, save money,. and headache.

While development methods (Agility) tend to become easier, more effective and reduce the complexity of managing Java Software Development projects; people are still struggling in finding their way through the numerous different kind of Java OS Technology Solutions, trying to compose the perfect fitting reference architecture to build their solution. A reference archtecture provides a proven template (mix) of Java technologies for building a particular bussiness domain solution. Maven Archetype technology helps companies building these Technology Templates, great technology, but first….what should fit in that template… is it reliable, future proof, do these components fit together are they compatible and finally, do they run on your Java Application Server runtime environment?

An example: you need to develop a business solution which demands general requirements like; Web Services connection with guest company (B2B), reporting capabilities to MS Office and PDF, you heed advanced scheduling batch tasking (nightly builds), Webbased interface and finally a company database stored on MySQL. Now, try to find the best fitting reference archetecture; mayby Java Jasper reporting or Apache POI for the reporting part, WS 2.0 JAX-WS for the B2B WebServices communication, or maybe a more ESB service bus technology to fill in your B2B technology like Mule ESB, or maybe Apache Service MIX because of its JSR compliancy, implement and integrate your business process to a LifeRay portal environment, and so on. hmmmmmmmm, headeache slowly comes up on you.

Match the right  Maven technology template with your Reference Architecture

By 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 archetectures for you. They come by example, every example comes with a Maven Archetype which can be unpacked on your computer and produce a project template for you in matter of minutes, without programming. These projects will reference the correct component libraries that will make up the specific reference archetecture you might need. 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 if it will run on your production runtime environment.

Every project will contain a set of simple classes that demonstrate the core functionality of every technology, this will help to bring down the learning curve. We will attach per example a set of documentation links that can help you further exploring and studying every enclosed technology.

Before you continue reading we kindly as you to install the following technologies from this install page. These development tools are a prerequisite enabling you to participate in enjoying every example.

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 of developing Java EE applications significantly.  Focussing on JEE 6 compliant application engineering, designed to be deployed on JBOSS 6 application server environments.

I will present the different features and technologies my supply a Maven Archetype per case. With a couple of simple instructions you can generate, build and deploy these exampe projects on JBOSS 6 application server. Read the instructions for downloading every Maven archetype from the Maven instruction page.

Additionally discussing the toolset 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.

Finally replacing Log4J logging frameworks by Logback and SLF4J and how you can channel and bridge logging produced by legacy API’s with SLF4J bridging facilities.

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 LogBack logging and learn how to bridge legacy Commons Logging, Jave Logging and Log4J via SLF4J.
  7. And more to come…

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

Kind regards and hope we can keep you posted on all the new features on java coming up in the future.

Stay with us…

The Agile team

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 implicitely 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 authirozation 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 (unername, 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
Jun 23

Maven Multi Module EAR projects and JBoss 5 Mircocontainer’s Classloading
Many Java Engineers struggled finding out how pass DTO’s (data transfer object) as an argument while calling methods on a EJB stateless session bean from a JSF managed bean residing in a separate WAR deployment.

In most cases these transfer objects are part of a dedicated Maven Module of packaging type EJB which produces the EJB client jar, which is referenced from a Maven Module of packaging type WAR containing your applications presentation logic. This EJB client jar contains all interfaces and DTO objects which can be references from your web layer.

The following Maven POM.XML fragment on your Maven EJB module will generate a client jar which contains that value object which will be referenced by your web module.

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-ejb-plugin</artifactId>
				<configuration>
					<generateClient><em><strong>true</strong></em></generateClient>
					<archive>
						<manifest>
							<addClasspath>true</addClasspath>
						</manifest>
					</archive>
					<clientIncludes>
                          <clientInclude>*/service/dto/*.class</clientInclude>
                          <clientInclude>*/service/interface/*.class</clientInclude>
					</clientIncludes>
					<ejbVersion>3.0</ejbVersion>
				</configuration>
			</plugin>

Line 12 exposes all classes from the dto  package to the client jar file. After building and deploying your EAR (containing the EJB jar and web WAR) on JBoss 5 or 6 you will be prompted with the following exception when trying to invoke the EJB session bean from your JSF managed bean.

The exception will be something like this;

javax.ejb.EJBException: java.lang.illegalArgumentException: Wrong target….

What went wrong?…;

Since Java 2, the runtime identity of a class is defined by the fully qualified class name and its defining class loader. This means that the same class, loaded by two different class loaders is seen by the Virtual Machine as two completely different types. This so called namespace isolation is mandated by the Java EE 5 specifications. Applications load their classes in different class name spaces or class loading domains. Good thing is that these domains can hold their own unique version, not so nice thing however, is the fact that you are not able to pass object instances by reference between two class loading domains, this will lead to a ClassCastException.

Getting back to the subject; your web module is loaded by a Tomcat specific classloader, which is different from the classloader which loaded your EJB deployment. As a result, the DTO transfer object passed by reference as an argument of any service interface between the two class loading domains is incompatible and recognized by the Virtual Machine as two completely different types.

Solving the problem:

Solving this problem you need to have a minimal understanding of the JBoss Microcontainer’s ClassLoading architecture. JBoss 5 introduced the jboss-classloading.xml descriptor, which provides the facilities for customizing the classloading behavior on different deployment levels. I will show you how and where to provide these descriptors, so that your WAR classloader can see jars in the EAR deployment.

Expose EAR classes to the WAR

First provide jboss-classloading.xml on your ear/META-INF location with the following content:

<classloading xmlns="urn:jboss:classloading:1.0"
	domain="ear-domain"
	export-all="NON_EMPTY"
	import-all="true"
	parent-first="true">
</classloading>


Line 2 specifies a domain name, which can be any arbitrary name which can be referenced by other class loading environments, like your WAR. Line 3 specifies that all classes are getting exposed to other applications. Line 4 “import-all” makes all classes exported from others visible to this configuration. Lline 5 is a non JEE compliant mode, which specifies whether to search for a class first in its own domain before searching in a parent domain.

Let your WAR import classes exposed by the EAR

Provide a jboss-classloading.xml on your war/WEB-INF location with the following content:

<classloading xmlns="urn:jboss:classloading:1.0"
    domain="war-domain"
    parent-domain="ear-domain"
    import-all="true">
</classloading>


Line 2 specifies again a domain name, which can be anything you can come up with. line 3 “parent-domain” and line 4 “import-all” tells you to make all classes visible to this war exposed by the ear-domain we specified earlier. This will finally enable your WAR to see classes which are part of jars deployed at EAR level. This will also take care of the DTO class compatibility problem mentioned earlier.

All the best in solving your JBoss classloading problems…

May 17

This page is about providing a lightweight solution for making ITIL Asset Management affordable and especially managable for your IT staff. Most ITIL management tools and environments come with a high price and implementation effort.

Main objective of Asset Management is providing a logical model of your IT infrastructure by identifying, maintaining and keeping track of versions of all the infrastructure artefefacts As your infrastructure becomes increasingly complex and critical to executing your enterprise business strategy, you need to effectively manage your assets.

Focus is managing Java JEE assets running under different VMWare virtualization configurations on Linux, AEX and Sun Solaris. This so called CMDBLite ITIL Asset Management environment will be developed as an extension of OneCMDB open source CMDB platform.

Read the introduction page on this product and the archictecture page about the technology.

Aug 27

Up front on the  discussion on how marketing automation evolves and how nowadays technology can fit in the needs on this new marketing discipline,  I would like to introduce this short post on how Java OS frameworks are keeping up on this area.

The business domain

Successful marketing needs more than only segmenting their target customer areas. Most Internet marketing based solution are generally capable of collecting information on customer behaviour and running statistics on this data.

Internet marketing new approach is all about gathering this information, instrumenting this data with the right classification parameters, persist this data in the existing CRM database and steering and driving a work flow based on this enriched customer (CRM) data.

Basically this work flow wires up all the necessary processes based on dynamically interpreted business rules, these rules specify on how the customer behaviour patterns should be interpreted and how this customer information should flow through the modelled processes on your business process flow.  Ideally this process flow would route customer information automatically through the correct marketing campaign processes, reaching out the customers with the relevant information through predefined channels, like personalized mails, SMS, etc.  Offline, channels like mail, collaboration tools like calendar events, activity trackers, instant messaging, will automatically create new leads and assign  the appropriate sales/marketing professionals. Finally all these efforts should improve the overall well addressed response rates to your customers and add up your marketing efforts.

How Java OS frameworks fits in on this new discipline

From experience in the past many companies from this report “Lessons learned from Using marketing Automation” http://crm.sys-con.com/node/1063160, tells us that companies need to be aware to be organized in front before stepping into this adventure “better prepare their organization by building proper processes and content offers to feed the automation system “.

Above all, most experiences come with a large effort in integrating the new solution on top of your existing applications, databases and processes. Most of standard solutions assume a perfect application landscape infrastructure to be present. This is realy the case in reality.  As an alternative Java OS frameworks might give you more flexibility to perticipate in supplying a more finegraned grip on exotic integration problems.

I will just decribe in concept how a mix of Java frameworks fit needless together in solving many problems in setting up marketing automation workflows.  Jboss BPM wofkflow, JRules business rules engine and Apache ServiceMIX ESB service bus technology offer a powerfull join of functionalities that will cover the following set of  steps.

  • Consume and interprete any type of campaign data in internal format, instrumet data with workflow logic parameters and persist data in existing CRM database structure. (Apache ServiceMIX ESB)
  • Route the data through the appropriate workflow channel. (Apache ServiceMIX ESB)
  • Apply business rules logic on parameterized customer data. (jBoss Drools rules engine)
  • Route the data based on the rules to the appropriate channel, enriched mail, SMS, IM, or internal collaboration tool, like task tracking, internal mail, etc.. (jBPM workflow)

Apache ServiceMIX ESB service bus

Based on JBI (Java Business Integraion) provides a plugable infrastructure with binding components that support most common data formats to be converted into a internal Normalized Message Format. New custome designed message adapters can easily  produced with low development effort. Here can the logic be applied for routing the message to dedicated workflow components.

JBI architecture

JBI architecture

JBoss jBPM Business Process Modeling workflow management

jBoss jBPM offers a structure for graphically design business actions/transactions and executing them using automated processes, tasks and flows. For ex. an insurance company can use BPM to automate the steps involved in processing insurance claims, a finance company can use BPM for loan approval, an HR department for employee performance management etc.,.Business processes in jBPM are defined by XML documents known as process definitions which are written in jBPM Process Definition Language (JPDL). JBoss also provides a graphical JPDL editor which is implemented as an Eclipse plugin. This editor allows you to design workflows graphically, rather than using an XML editor

Applying the business logic with JBoss Drools

Drools is one of the open source java business rules engines. Its job is match facts (based on enriched campaign data) and rules (pattern matching) to make conclusions which ends in actions applied on the workflow. The JBoss rules engines enables business experts to express their business rules in an easy understandable language outside the application code, without re-deploying the runtime environment. In this case market campaign decisions can be expressed in a logical language by business and directly interpreted by the business flow runtime environment, directly effecting the marketing business process flow behaviour.

This high level of introduction just gives a impression on how these frameworks could be set together

Aug 04

Why this Blogpost

In the recent couple of years Portal technology has become increasingly popular concept discussed about in IT and many organisations. Portal technology has been significantly matured since the introduction of first generation portals. From start on introducing of portals, one of the main problems for companies was to get a clear understanding on the concept and the way how to benefit from this technology and how to fit this concept onto their business processes. The expectation is that in the near future more than half of the companies will be owner of some kind of portal implementation. A good reason to have a more closer look on what portal technology is about. Hopefully this Blog is a starting point for an active discussion about issues like, basic architecture,  the major portal contenders, future trends, best practises on setting up portals in your organization, what is the impact on integrating portals with your existing application and database infrastructure, and when to decide between commercial product or open source, and so on.

What is Portal

In general, a portal is basically a web site containing a set of modules (portlets) exposing content to the user from different sources. On top of this, offering users the ability to create a site that is personalized for individual interests.

Evolution of portals
First generation portal technologies were mainly supporting internet search and navigation capabilities, providing start point for web consumers for exploring the web. Meanwhile the market for portal technology focuses increasingly on delivering better cooperative information to dedicated user groups.  The next step was offering instrumentation for allowing personalization, notification, collaboration, workflow, knowledge management, groupware and integration of business applications. The general idea is to collect information from different sources, creating a single secured point of access to this information as a library of categorized and personalized content.
When is there a need for a portal

Nowadays lots of companies depend on the information and services they provide to their users via web technologies, say internal staff members, external customers, business partners, etc… In organizational environments where users increasingly make extensive use of web applications, users might be easily get exposed to information overload and find it difficult to locate the needed information or services, in this case there is an obvious need in streamlining and grouping information. To eliminate problems described it would be desirable to set up a portal infrastructure for streamlining and organizing the large flow of information in an effective and efficient manner, so that different type of data owners can be identified by the portal, personalized information is serviced out on relevance and interests of the users according a profile that can be centrally managed by the supporting organization. In this case portal technology can fit in the needs on supplying these kind of services.

Key factors and desired functionality:

In general portals should support the following list of features.

  • Enable single secured access to one look and feel entry point, enabling the user to gain access to different information and services that are offered via different systems.
  • Information integration (CMS), enabling different departments to setup and update tailored information for different user groups according a common user profile.
  • Personalization, allowing individual users to select the information that are of his interest, able to customize the presentation of this information.
  • Task management and workflow, business process modeling . Collaboration and groupware facilities, enabling plugin facilities for enriching the portal environment with all nowadays groupware wikis, IM, alerts, RSS, etc..
  • Integration technology to other systems, and other portals via WSRP.

Platform and product considerations:

Multiple commercial software vendors have been delivering portal solutions, products from IBM, Oracle (BEA), MS and other solutions all come with relatively high license fees. The costs of integration and implementing can add considerably high investments on top of these license costs. Most of these commercial products have highly advanced application integration features allowing quick linking in with ERP, back offices platforms, CMS, etc.. For many small to medium companies this is far too much than needed and not even desired for. Alternatively there is a large number of OS portal software initiatives enabling ease setup of all needed basic portal facilities, almost out of the box, which can than be customized to individual needs. Aspects to be considered when starting the OS selection process are, easiness of managing and setting up the product, the quality of documentation, the size of community (users and developers), what features come out of the box without requiring additional development, is the product based on nowadays standards, has the product any features beyond authentication and site administration, like CMS, collaboration, and much more things to be considered.

Hope this quick introduction will lead to an active discussion on this complex but highly interesting topic.

Jul 09

Which Eclipse plugin do you use to cover effective JUnit test during iterative development

Eclipse with this pluging enables us to produce a high test coverage for delivering stabel releases, reporting all the code details not covered by Junit testing. During continuous integration by Cruisecontrol, this approach gives us a powerfull support for testing the code before the solutions are delivered to the end customer for end user testing.

The unit test code coverage plugin eclemma accomplishes also small miracles…It produces little reports in Eclipse and will highlight code which is not unit test covered as well, inside the eclipse java editor.

EclEmmaEclipse

Jun 25

Start building application from ground up, from UML Use Case requirement to J2ee webbased, SOA applications based on J2ee 5 technologies like JSF, EJB3, JPA, JAX-WS/JAXB, etc,,, We introduce you a complete overview from start to end implementation.

Project initiation and setup

Based on type of product the reference architecture is composed. This is a really short process, mainly setting up a list of frameworks and java libraries that fit in the design concept. Fx, in case of a straightforward web app, this will probably consist of JSF presentation layer, Spring beans business logic and JPA persistency layer. In most cases from experience AS has fixed goal architectures for different flavour of applications, best practise collaboration of products that make the best fit.

When this is in place, this can be done in a couple of hours, the development environment can be fit together, this will involve the next steps to be performed.

  • Configurering the correct Eclipse plugin set
  • Setting up the Maven references to the corresponding product libraries, fx JPA, JSF, Spring archives, etc…
  • Configure SVN repository to facilitate the source code managment
  • Configure CruiseControl, setup the build cycles fitting on the iterative development process, setup the mail escalation to inform the team on the build proces status

Highlevel design and break down in iterations

Setup highlevel requirment use cases, per use case specify the diagram and use case template. In parallel setup the first raw datamodel, this datamodel will be refined through every development iteration.  When this is in place, prioritise the first use case to be implemented.  According the diagram below every use case design is refined (elaboration), programmed and tested (construction) and finally deployed on final user acceptance test environment (transition). Per Use Case this process can be repeated to fine tune the final functionality.

Unified Process processes

Unified Process processes

The client will get a better understanding on the whole system, when he sees the system growing step by step. The learning effect will enable the client to feed back and refine the requirements during the overall project, minimizing the risk of delivering uncomplete functionality.

preload preload preload