About

Jadira Systems is the initiative of Sousan Rassoul and Chris Pheby to produce reusable open source Java modules that provide first class solutions using the most effective current JEE technologies.

Search
Recent Changes
No website changes have been recorded.
Login
Thursday
Jul152010

Release: User Type for Joda Time and JSR 310 version 1.2

The 1.2 release of User Type has been produced.

To work around JSR 310 jars not yet being in Maven Central (as the specification is not yet finalised) this release is separated into Joda Time and JSR 310 jars. This means that Hibernate user types from the project for use with Joda Time can now be obtained from Maven Central. If you want the JSR 310 compatible jar, you can use the project's own Maven repository.

For more information, visit the project pages on Sourceforge

Tuesday
Jun292010

Eclipse Helios

Eclipse Helios is the simultaneous release of Eclipse 3.6 and a bundle of Eclipse projects.

This post updates my previous quick configuration howtos for Ganymede and Galileo, helping to quickly get up and running with essential Eclipse plugins. The Helios release is ready for use with many key thirdparty plugins already working, a much improved situation on the original release of Galileo. The recipe is for Windows - extrapolate as required.

1. Download Eclipse IDE for Java Developers (either eclipse-jee-helios-win32.zip for 32-bit Windows, or eclipse-java-helios-win32-x86_64.zip for 64-bit Windows). These can be found via http://www.eclipse.org/downloads/

2. Make a folder for Eclipse somewhere called 'Eclipse', and unzip the Eclipse SDK zip file to the parent folder. I typically create c:\Java\Eclipse and unzip to c:\Java

3. Create a shortcut to Eclipse, for example:

C:\Java\Eclipse\eclipse.exe -clean -vm "C:\Java\JSE6\bin" -vmargs -Xmx1536m -XX:MaxPermSize=256m

or, potentially using Server VM / ergonomics:

C:\Java\Eclipse\eclipse.exe -clean -vm "C:\Java\JSE6\bin" -vmargs -server -Dcom.sun.management.jmxremote -Xmx1536m -XX:MaxPermSize=256M -XX:+UseParallelGC -XX:+UseParallelOldGC

(where the ‘vm’ argument points to your appropriate Java runtime with Eclipse - this should be at least version 5.0 and should be 32-bit or 64-bit as appropriate).

NB. Best practice is to point to a JDK rather than a JRE location.

4. Next, search for new features using the Helios Updates (with "Show the latest version" selected).

Pick the appropriate platform features - you can safely select everything. Typical selection could be Business Intelligence Reporting and Charting, Database Development, Programming Languages (Eclipse Java Development Tools, Eclipse XML Editors and Tools and JavaScript Development Tools), Test and Performance, Web XML and Java EE Development (excluding PHP Development Tools (PDT) SDK Feature).

Also, from the Mylyn for Eclipse Helios select all updates except C/C++ Development, Mylyn SDK and Mylyn WikiText SDK).

5. After restarting again, the following update sites can be used to add Mylyn Extras, AspectJ Developer Tools, SvnKit, SubClipse, M2 Eclipse, QuantumDB, PMD, Spring Tools Suite, JBoss Tools, and Log4E:

AJDT http://download.eclipse.org/tools/ajdt/36/update

SvnKit http://eclipse.svnkit.com/1.3.x/
SubClipse http://subclipse.tigris.org/update_1.6.x

Eclipse GEF (for release 3.6.x select GEF, Zest and Draw2d only) http://download.eclipse.org/tools/gef/updates/releases/
M2 Eclipse http://m2eclipse.sonatype.org/sites/m2e
QuantumDB http://quantum.sourceforge.net/update-site
Qwickie http://qwickie.googlecode.com/svn/trunk/qwickie.updatesite/

JBoss Tools [DEV] http://download.jboss.org/jbosstools/updates/development/ (only Context and Dependency Injection Tools (all instances), Freemarker IDE (both instances), Hibernate Tools (all instances), JBoss Tools RichFaces, JBossAS Tools, Seam Tools, XULRunner, TPTP Profile on JBoss Server, JBoss Tools RichFaces (both instances), JBossAS Tools (both instances), SeamTools (both instances), XULRunner (both instances)).
then restart

PMD http://pmd.sourceforge.net/eclipse (only PMD for Eclipse 3)
Groovy http://dist.springsource.org/release/GRECLIPSE/e3.6/  (except SDK)
EclipseLink (JPA) http://download.eclipse.org/rt/eclipselink/updates/
Eclipse Target Management Project (all except RSE WinCE Services and Examples & SDKs) http://download.eclipse.org/dsdp/tm/updates/3.2
Atlassian Connector (all except Atlassian Subversive Integration, Atlassian Perforce Integration and Dependencies) http://update.atlassian.com/atlassian-eclipse-plugin/e3.6
then restart

SpringSource Tool Suite [DEV] (except for SpringIDE Core Developer Resources which cannot be installed) http://dist.springsource.com/milestone/TOOLS/update/e3.6
then restart

Log4E http://log4e.jayefem.de/update (note that the free version cannot be installed using the update site)
Azzurri Clay http://www.azzurri.co.jp/eclipse/plugins
JavaCC Plugin http://eclipse-javacc.sourceforge.net/
then restart

Apache Directory Studio http://directory.apache.org/studio/update/1.x
TestNG http://beust.com/eclipse
then restart

6. Other interesting plugins you might want to consider could include:

Checkstyle http://eclipse-cs.sourceforge.net/update/
LogWatcher http://graysky.sourceforge.net/
Color Editor http://www.gstaff.org/colorEditor/download.html

7. A couple of plugins are best installed by hand:

Download Jar Class Finder version 2.1.0 from http://www.alphaworks.ibm.com/tech/jarclassfinder/download and copy the Jar to the Eclipse/dropins/plugins subdirectory.
Download Tarlog Plugin 1.4.0 from http://code.google.com/p/tarlog-plugins/ (I used tarlog.eclipse.plugins_1.4.2.jar) and copy the Jar to the Eclipse/dropins/plugins subdirectory.
Download Bnd from http://www.aqute.biz/Code/Download and copy the Jar to the Eclipse/dropins/plugins subdirectory.

8. Configure eclipse.ini, for example, with the following:

-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.0.v20100503
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1536m

Saturday
May152010

Release: Maven Dependency Navigator Version 1.0 beta 9

Maven Dependency Navigator is a new Jadira project.

Maven Dependency Navigator provides a straightforward way to visualise and track Maven dependencies - including duplicate dependencies and conflicting versions.

The project builds on Maven Dependency Browser, a standalone Swing GUI which we've found to be especially useful in the Release Management and QA function. With Maven Dependency Browser being no longer maintained, we thought it would be useful to bring it up to date and start working on improving it, our goal being to provide a tool useful for visualising Maven builds for users who are not doing day to day development.

This release establishes the project on Sourceforge, and incorporates a new documentation site. The project is updated to be built with the current Maven release (2.2.1) and resolves an issue where groupId and version were not being correctly inherited in multi-module projects.

Download Maven Dependency Navigator.

Tuesday
May042010

Maven Sites and Sourceforge

The Maven site for the User Type project is now online. This site makes use of the excellent Fluido Skin which gives a cleaner, crisper look in comparison to the standard skin.

There's a huge amount of metrics and reporting plugged into the site generation, but some of the features are of particular interest.

Class diagram visualisations can be found throughout the Javadocs. These are generated using the UML Graph doclet, using the following example configuration (suitable for Java 5):

			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-javadoc-plugin</artifactId>
 				<version>2.6.1</version>
 				<configuration>
 					<linksource>true</linksource>
 					<links>
 						<link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
 					</links>
 					<encoding>UTF-8</encoding>
 					<executions>
 						<execution>
 							<id>attach-javadocs</id>
 							<phase>package</phase>
 							<goals>
 								<goal>jar</goal>
 							</goals>
 						</execution>
 					</executions>
 					<aggregate>true</aggregate>
 					<doclet>gr.spinellis.umlgraph.doclet.UmlGraphDoc</doclet>
 					<docletArtifact>
 						<groupId>gr.spinellis</groupId>
 						<artifactId>UmlGraph</artifactId>
 						<version>4.6</version>
 					</docletArtifact>
 					<additionalparam>-attributes -enumconstants -enumerations -operations -types -visibility -inferrel -inferdep -hide (java.*)|(org.hibernate.*)|(org.joda.*)</additionalparam>
 				</configuration>
 			</plugin>

The enforcer plugin is being used to require Java 5, and Maven 2.2.1 - to help guarantee that builds are reproducible. Together with these requirements, the use of commons-logging is prohibited. This is a great practice which helps ensure all logging is performed using SLF4J:

 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-enforcer-plugin</artifactId>
 				<version>1.0-beta-1</version>
 				<executions>
 					<execution>
 						<id>enforce-versions</id>
 						<goals>
 							<goal>enforce</goal>
 						</goals>
 						<configuration>
 							<rules>
 								<requireMavenVersion>
 									<version>2.2.1</version>
 								</requireMavenVersion>
 								<requireJavaVersion>
 									<version>1.5.0</version>
 								</requireJavaVersion>
 								<bannedDependencies>
 									<excludes>
 										<exclude>commons-logging:*</exclude>
 									</excludes>
 								</bannedDependencies>
 								<requirePluginVersions>
 									<banLatest>true</banLatest>
 									<banRelease>true</banRelease>
 									<banSnapshots>true</banSnapshots>
 									<unCheckedPluginList></unCheckedPluginList>
 								</requirePluginVersions>
 							</rules>
 						</configuration>
 					</execution>
 				</executions>
 			</plugin>

You will also note that enforcer requires that exact versions are required for all utilised plugins. Again, this guarantees the reproducibility of builds.

Another point of interest is the use of toolchains. Toolchains allows you to externalise the JDK under which Maven runs from the JDK used for building. This would be particularly relevant for a project using recent builds of Maven which require Java 5, but needing to build using an older JDK.

			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-toolchains-plugin</artifactId>
 				<version>1.0</version>
 				<executions>
 					<execution>
 						<phase>validate</phase>
 						<goals>
 							<goal>toolchain</goal>
 						</goals>
 					</execution>
 				</executions>
 				<configuration>
 					<toolchains>
 						<jdk>
 							<version>5.0</version>
 							<vendor>sun</vendor>
 						</jdk>
 					</toolchains>
 			 	 </configuration>
 			</plugin>

Setting up a Maven site is surprisingly straightforward. A good howto guide is available on CommunityMapBuilder, and the Maven documentation describes the steps that need to performed to enable a shell which can be used with mvn site-deploy. You must display the Sourceforge logo on your Maven site, which can be achieved by including a 'poweredBy' entry in the site.xml file:

    <poweredBy>
        <logo name="Hosted by SourceForge" href="http://www.sourceforge.net/" img="http://sourceforge.net/sflogo.php?group_id=16035&amp;type=1" />
        ...
    </poweredBy>

			<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.6.1</version>
<configuration>
<linksource>true</linksource>
<links>
<link>http://java.sun.com/j2se/1.5.0/docs/api/</link>
</links>
<encoding>UTF-8</encoding>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<aggregate>true</aggregate>
<doclet>gr.spinellis.umlgraph.doclet.UmlGraphDoc</doclet>
<docletArtifact>
<groupId>gr.spinellis</groupId>
<artifactId>UmlGraph</artifactId>
<version>4.6</version>
</docletArtifact>
<additionalparam>-attributes -enumconstants -enumerations -operations -types -visibility -inferrel -inferdep -hide (java.*)|(org.hibernate.*)|(org.joda.*)</additionalparam>
</configuration>
</plugin>
Sunday
May022010

Configuring Open Source JTA Transaction Managers with Spring

This blog post records in one place the Spring configuration required for each of the four most commonly used open source standalone transaction managers:

For Arjuna / JBossTS, apply the following configuration.:

<bean id="jbossTS"  class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple"  />
<bean id="jbossUserTransaction"  
    class="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"  />

<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="transactionManager" ref="jbossTS" />
    <property name="userTransaction" ref="jbossUserTransaction"  />
</bean>    

For JOTM, apply the following:

<bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean" />
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="userTransaction" ref="jotm" />
    <property name="allowCustomIsolationLevels" value="true" />
</bean>

For Atomikos, the following configuration can be used:

<bean id="atomikos" class="com.atomikos.icatch.jta.UserTransactionManager"  
    init-method="init" destroy-method="close">
   <property name="forceShutdown" value="false" />
</bean>

<bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
   <property name="transactionTimeout" value="300" />
</bean>

<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
   <property name="transactionManager" ref="atomikos" />
   <property name="userTransaction" ref="AtomikosUserTransaction" />
</bean>

Finally, for Bitronix you can use the following:

<bean id="bitronixConfig" factory-method="getConfiguration" 
    class="bitronix.tm.TransactionManagerServices">
    <property name="serverId" value="spring-btm" />
</bean>
<bean id="bitronix" factory-method="getTransactionManager"
    class="bitronix.tm.TransactionManagerServices" depends-on="bitronixConfig" 
    destroy-method="shutdown" />
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="transactionManager" ref="bitronix" />
    <property name="userTransaction" ref="bitronix" />
</bean>