Total Pageviews

Monday, February 26, 2007

If you want to boost your IDEA startup performance and the loading of your projects try to run IDEA with JDK6. There is an entry in Jetbrains support forum describing this underhttp://support.jetbrains.com/kb/entry.jspa?externalID=222&categoryID=4
It really kicks asses!
But be aware: Please note that running IDEA under JDK 1.6 is not officially supported yet

Thursday, February 15, 2007

MAIDEA, a plugin that integrates the Maven2 build functionality into IntelliJ IDEA, is moving into the Mevenide project hosted on Codehaus.

The goal is to provide one plugin that supports all aspects of Maven's functionality (e.g. dependency management, repo browsing, running builds, etc.).
The code base of the Mevenide2 IDEA plugin will consist of the formerly known Maven Reloaded plugin and MAIDEA.

Sunday, February 11, 2007

When using Maven you get a lot of reports out of the box. Version control reports, code quality reports, javadocs, etc.
This blog entry focuses on code quality reports, especially on the JDepend report and other ways of measuring and controlling code quality.

Why is dependency management so important?

This is a question that will arise sooner or later in almost every software project. Good dependency management is the key to maintainable software. In conjunction with well designed package architecture the dependency management will save lots of time and money when it comes to maintain and take care of a released software.
Maven enforces you to think about your project artifacts and dependencies before you start to implement your software. Because it follows the principle: One artifact per Maven project. Thus you are able to separate different tiers of your software into small artifacts which can be compiled, tested and released independently of the release of the full software system.
Think of a web enterprise application bundled in an EAR archive. The application usually consists of several artifacts:

Foundation JAR archive(s)

EJB JAR archive(s)

Web application archive (WAR)

Every artifact can be tested independently from the others. Of course integration tests are often necessary to make sure the whole thing is still working. But it lets you concentrate on one point of your software system.
Things that must be avoided at any time are cyclic dependencies between those artifacts. For example, a method from an EJB JAR calls a method from a foundation JAR, and another method from the same foundation JAR calls an EJB JAR method. This would produce a cycle between the foundation tier and the EJB (Business Logic) tier. Maven is able to detect cycles and refuses to compile a project that contains cycles.
Even harder to detect are cycles between vertical slices in the same tier or cycles between logical layers of a physical artifact. Those cycles can be detected using JDepend. But JDepend is very limited and a System Architect is not able to define a logical architecture which can be controlled and oberved through the complete life of a software system. In this case you might want to consider the use of SonarJ or Sotograph. Why using a software to detect cycles? Because it is almost impossible for a human to see when a cycle creeps in!
Maven enforces you to keep an eye on your software design by providing a JDepend report out of the box. With JDepend you can control the couplings between packages and the stability or instability of particular packages or even cyclic dependencies between packages in your artifact.
If this is not enough for you and you would like to be able to define an architecture which can be controlled and observed by a Software Architect and/or the Software Developers have a closer look at the above mentioned SonarJ. It is recommend for middle-sized or big-sized software projects and can easily help you in maintaining and controlling your software design.
With SonarJ it is easily possible to declare allowed dependencies and directions between logical layers and vertical slices and to see when those dependencies or access directions are violated.

Thursday, February 08, 2007

Since I updated to JBoss 4.0.4.GA I randomly receive the following execption in one of my applications:
23:22:19,812 ERROR [TimerServiceImpl] Cannot create txtimerjava.lang.IllegalStateException: Unable to persist timerat org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:126)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:585)at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)Caused by: java.sql.SQLException: Uniqueconstraint violation: in
statement [insert into TIMERS
(TIMERID,TARGETID,INITIALDATE,TIMERINTERVAL,INSTANCEPK,INFO) values(?,?,?,?,?,?)]at org.hsqldb.jdbc.Util.throwError(Unknown Source)at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:95)at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)at
It turns out to be a problem with a TimerBean.
A solution is described in the JBoss JIRA: http://jira.jboss.com/jira/browse/JBAS-3380
To make is short:
The "localDB.script" file ($JBOSS_INSTALL_DIR/server/default/data/hypersonic) must be cleaned up by deleting all (or the particular) timer entries (INSERT INTO TIMERS ...). Those entries are inserted by JBoss and represent timers which should be executed after a server crash. Unfortunately the ID generator for inserting unique timer ids doesn't generate unique ids :-(