Make “Duke’s Bank” J2EE demo app work on JBoss 4.2.0.GA

I was trying to learn a bit about JBoss AS by following their Getting Started doc/tutorial.

When I got up to Chapter 4, which involves building and deploying the “Duke’s Bank” application from Sun’s J2EE tutorial to JBoss, I ran into errors when trying to compile.

~/j2eetutorial14/examples/bank$ ant -f jboss-build.xml compile | head
Buildfile: jboss-build.xml

prepare:

compile:
    [javac] Compiling 61 source files to 
/Users/marca/j2eetutorial14/examples/bank/build
    [javac] /Users/marca/j2eetutorial14/examples
/bank/src/com/sun/ebank/web/template/DefinitionTag.java:31: 
package javax.servlet.jsp does not exist
    [javac] import javax.servlet.jsp.JspTagException;

To fix this, I edited jboss-build.xml as follows:

--- jboss-build.xml.2007-06-21-102200   2007-06-21 10:18:55.000000000 -0700
+++ jboss-build.xml     2007-06-21 10:22:14.000000000 -0700
@@ -20,7 +20,7 @@
     <path id="build.classpath">
         <path refid="client.classpath"/>
        <fileset dir="${jboss.server}/lib/">
-            <include name="javax.servlet*.jar"/>
+            <include name="*.jar"/>
         </fileset>
     </path>

Later on in the tutorial, you are directed to run an Ant task to display some newly inserted rows in the hsql database.

~/j2eetutorial14/examples/bank$ ant -f jboss-build.xml db-list
Buildfile: jboss-build.xml

db-list:
     [java] ScriptTool.init error: sql/hsql-list.sql (No such file or directory)
     [java] java.io.FileNotFoundException: sql/hsql-list.sql 
(No such file or directory)

For some reason, I didn’t have the hsql-list.sql file. So I created one with SELECT * FROM account; as its contents.

Aside from these hiccups, the the tutorial worked fine.

One thought on “Make “Duke’s Bank” J2EE demo app work on JBoss 4.2.0.GA

  1. Thanks. This is the kind of thing that drives a beginning programmer crazy.

Leave a Reply

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