Getting the J2EE Duke’s Bank Example running on JBoss-4.2.2.GA

This was annoying, but understandable. The tutorial “patch” to the Sun J2EE-1.4 tutorial, distributed by JBoss.org, is difficult to find [it's a zip inside a zip, here], and also needs some additions to its classpath to get a correct compile.

For the good of the internet, here’s what to do:

  • Unzip the startguide40.zip package.
  • Move jbossj2ee-src.zip into the j2eetutorial directory.
  • Chdir into that dir.
  • Unzip the jbossj2ee-src.zip.
  • After it’s unzipped, edit jboss-build.properties, and put the location of your jboss install in jboss.home
  • Go to examples/bank/.
  • Edit jboss-build.xml, and modify the build.classpath to appear as follows:
   
    <path id="build.classpath">
        <path refid="client.classpath"/>
  <fileset dir="${jboss.server}/lib/">
            <include name="javax.servlet*.jar"/>
            <include name="jboss-j2ee.jar"/>
            <include name="servlet-api.jar"/>
            <include name="jsp-api.jar"/>
        </fileset>
    </path>
  • Edit src/com/jboss/ebank/WSClient.java, and look for the import lines re: ServiceFactoryImpl and ServiceImpl. Modify them to look as follows:

    import org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl;
    import org.jboss.ws.core.jaxrpc.client.ServiceImpl;

After that, hopefully the instructions will work. My understanding is that versions of JBoss-4.2X are backportings of popular 5.X features, and they’ve probably ceased updating the Getting Started guides while work is prioritized on the 5.X branch. No harm done, I suppose.

Leave a Reply