<build>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<goals>
<goal>translate-war</goal>
</goals>
<configuration>
<classifier>jdk1.4</classifier>
<attach>true</attach>
<advanced>true</advanced>
</configuration>
</execution>
</executions>
</plugin>
</build>
I also had to include a couple of new dependencies introduced by Retrotranslator:
<dependencies>
<dependency>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.2.1</version>
</dependency>
</dependencies>
I had to use the 1.0-alpha-2 version of the plugin, otherwise I got an obscure java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean failure...
Unfortunately, that was not quite enough. When running the portlet, I would get an exception about a missing javax.xml.namespace.NamespaceContext class which XWork aparently needs. It appears that this class is included in the Java 5 libraries, but not with Java 1.4. I found it in the jaxp-api.jar in the Sun Java Web Services Developer Pack 2.0. I placed this jar in the %WAS_HOME%/java/jre/lib/ext folder (I tried putting it in the web application, but that didn't work... Classloading in JEE application servers has always been fun...). I also had to exclude any web application dependencies that included Xerces, Xalan or xml-apis.
No guarantees that this works for you though. But I guess as long as you don't break any of the limitations retrotranslator has, you'll be fine.
3 comments:
don't forget there's the optional settings 'verify' to check the resulting class code
Hi Nils. Do you have sources or jars of struts2-portlet-plugin for jdk 1.4? Next project on wps... hate it...
Thanks.
Sorry. Don't have any pre-built jars. You have to go through the steps described...
Post a Comment