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:
   
    
        
  
            
            
            
            
        
    
  • 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.

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

  1. Just to add to the solution given above, with JBoss 5, the change would be:

    Go to examples/bank/. Edit jboss-build.xml, and modify the build.classpath to appear as follows:

    <!-- The build classpath -->
    <path id="build.classpath">
        <path refid="client.classpath"/>
    <fileset dir="${jboss.server}/lib/">
            <include name="javax.servlet*.jar"/>
        </fileset>
    <fileset dir="${jboss.home}/common/lib/">
            <include name="servlet-api.jar"/>
        <include name="jsp-api.jar"/>
       <include name="jboss-javaee.jar"/>
        </fileset>
     </path>
    

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">