You are currently browsing the Philipp Meier's weblog posts tagged: java


feed
service

Generate application.xml from ivy.xml for packaging an ear

After a lot of trouble with maven 2 I tried ant with ivy as a build and dependency resolving system. For multi-project builds with ivy you’ll have to dig into the documentation and ivy samples a little deeper but finaly I must say I like it. One show stopper for me was that maven 2 generated an application.xml from the pom. I use now a xslt stylesheet to make an application.xml from an ivy resolution report:

<target name="appxml" depends="resolve">
<property name="meta.dir" value="${basedir}/src/main/resources/META-INF/"/>
<property name="appxml.filename" value="application.xml"/>
<property name="appxml.file" value="${build.dir}/${appxml.filename}"/>
<ivy:report todir="${build.dir}"
outputpattern="ivy.xml"
xml="true"/>
<xslt in="${build.dir}/ivy.xml" style="ivy2appxml.xslt" out="${appxml.file}"/>
</target>

The stylsheet I use currently is simple but does it job. No support for web archvies and connectors yet, or any configuration but it’s doing it’s job:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/javaee/application_5.xsd">
<xsl:template match="ivy-report">
<application>
<display-name>
<xsl:value-of select="info/module"/>
</display-name>
<xsl:apply-templates/>
</application>
</xsl:template>
<xsl:template match="dependencies">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="artifact[@type='jar']">
<module>
<java>
<xsl:value-of select="concat(@name, '.', @ext)"/>
</java>
</module>
</xsl:template>
<xsl:template match="artifact[@type='ejb']">
<module>
<ejb>
<xsl:value-of select="concat(@name, '.', @ext)"/>
</ejb>
</module>
</xsl:template>
<xsl:template match="artifact[@type='sar']">
<module>
<java>
<xsl:value-of select="concat(@name, '.', @ext)"/>
</java>
</module>
</xsl:template>
</xsl:stylesheet>

copyright

EJB 3.0 Annotations Cheat Sheet – Reference 1.2.2

The sheet got it’s own url here.

Minor update: added @AssociationOverride from Java EE 5 API documentation. Thanks to Jonathan O’Connor for catching this one.

Just download it from here as pdf or OpenOffice Document.

jobs

EJB 3.0 Annotations Cheat Sheet – Reference 1.2.1

The sheet got it’s own url here.

Updates to the EJB 3.0 Annotations Cheat Sheet.

Changes

  • Title changed to EJB 2.1 and Ealier Client View
  • Update @RemoteHome and @LocalHome according to the latest spec.
  • Fixed spelling and typos (NamesQueries / SINGLE_TABLE)

Thanks to Jonathan O’Connor for pointing out this errors.

Just download it from here as pdf or OpenOffice Document.

Preview of (old) cheat sheet.

about

Interruptible RMI – Working with JBoss?

Neil O’Toole has a RMI Socket- and ThreadFactory which enables a RMI client to interrupt a RMI invokation. This seems like a nice addition to a fat swing client which accesses a JBoss server. What I wonder is if the library will be compatible with JBoss and EJB 3. Have to try out. More information available at Neil’s blog entry.

service

EJB 3.0 Annotations Cheat Sheet – 1.2

Update: The Annotations Cheat Sheet got it’s own page here

After a longer hibernation I found the time to update the EJB 3.0 Annotations Cheat Sheet. I hope I catched up with all the recent changes to the spec up to the proposed final draft. I’ll appreciate any error or suggestion that is reported to me.

Just download it from here as pdf or OpenOffice Document.

Preview of (old) cheat sheet.

copyright
blog

Bear