NoClassDefFoundError com.google.gwt.dev.Compiler while building on Hudson

While compiling a maven webapp using GWT on Hudson, I’ve got the following issue :

[ERROR] Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gwt/dev/Compiler
[ERROR] Caused by: java.lang.ClassNotFoundException: com.google.gwt.dev.Compiler
[ERROR]  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
[ERROR]  at java.security.AccessController.doPrivileged(Native Method)
[ERROR]  at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
[ERROR]  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[ERROR]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
[ERROR]  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
[ERROR]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

This can be solved by telling gwt-maven-plugin to use a localWorker. Here is the config for pom.xml :

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <version>1.3-SNAPSHOT</version>
  <executions>
    <execution>
      <goals>
        <goal>compile</goal>
        <goal>generateAsync</goal>
        <goal>test</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <runTarget>mypage.html</runTarget>
    <extraJvmArgs>-Xmx512m</extraJvmArgs>
    <generateDirectory>src/main/java</generateDirectory>
    <localWorkers>1</localWorkers>
  </configuration>
</plugin>

Then, you will happily see :

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------

jBPM5 is coming

On jBPM website, we can find the features of the new release of the powerful webflow framework : jBPM 5. This one is planned for the end of 2010.

We can read that the first release will focus on the core of the various components. This refactoring of the API (setting sessions, loading process definitions, executing process instances, event listeners, …) will lead to extend the framework to more advanced features.

The key features of this release include:

  • Native BPMN2 execution
  • Highly configurable, embeddable, lightweight process engine using a generic process engine (PVM) underneath
  • Domain-specific processes and rule / event integration
  • Independent, human tasks service (using WS-HT)
  • Web tooling for things like BPMN2 process creation, deployment, management, reporting (with BIRT) and human tasks
  • Migration capabilities from jBPM 3 and 4 (jPDL 3, 4 to BPMN2)

More details on the jBPM 5 roadmap. This roadmap is not finalized yet, it is a proposal that might still be changed.

EasyPHP not reachable from the outside world

First of all, let’s just say EasyPHP is not designed to be used as a production server (it’s rather used as a developement server to test your pages). But sometimes, it can be useful to reach it anyway.

In apache config file, change

Listen 127.0.0.1

or maybe

Listen 127.0.0.1:8080

into

Listen yourIPaddrress:yourPort

This allow me to test Drupal on my netbook in the sun using http://yourIPaddrress:yourPort 😀

If you want to access your web pages through the internet, open a port (yourPort) in your firewall and/or router. This can be useful for a quick demonstration.

Spring and jBPM 4.3

Instead of using the following old jBPM 4.0 way, to inject those beans :

<bean id="jbpmConfiguration" p:sessionFactory-ref="sessionFactory">
  <constructor-arg value="jbpm.cfg.xml" />
</bean>
<bean id="processEngine" factory-bean="jbpmConfiguration"
      factory-method="buildProcessEngine" />
<bean id="taskService" factory-bean="jbpmConfiguration"
      factory-method="getTaskService" />
<bean id="repositoryService" factory-bean="jbpmConfiguration"
      factory-method="getRepositoryService" />
<bean id="executionService" factory-bean="jbpmConfiguration"
      factory-method="getExecutionService" />
<bean id="historyService" factory-bean="jbpmConfiguration"
      factory-method="getHistoryService" />
<bean id="managementService" factory-bean="jbpmConfiguration"
      factory-method="getManagementService" />

jBPM 4.3 has a new Spring integration configuration :

<bean id="springHelper">
  <property name="jbpmConfiguration" value="jbpm.cfg.xml"/>
</bean>
<bean id="processEngine" factory-bean="springHelper" 
      factory-method="createProcessEngine" />

In java classes, you can simply use :

@Resource
private ProcessEngine processEngine;
...
ExecutionService executionService = processEngine.getExecutionService();
...

Using CXF with maven

Simply add those dependencies to use Apache CXF with Maven.

<properties>
  <cxf.version>2.2.3</cxf.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.apache.cxf</groupId>
		<artifactId>cxf-rt-frontend-jaxws</artifactId>
		<version>${cxf.version}</version>
	</dependency>
	<dependency>
		<groupId>org.apache.cxf</groupId>
		<artifactId>cxf-rt-transports-http</artifactId>
		<version>${cxf.version}</version>
	</dependency>
        <!-- Jetty is needed if you're are not using the CXFServlet -->
	<dependency>
		<groupId>org.apache.cxf</groupId>
		<artifactId>cxf-rt-transports-http-jetty</artifactId>
		<version>${cxf.version}</version>
	</dependency>
</dependencies>