8 Replies Latest reply on Feb 14, 2005 4:11 AM by Huub van Thienen

    Compile failed in Duke's Bank App

    jerry ying Newbie

      When I run "ant -f jboss-build.xml compile" command,I get the errors in the console:

      Buildfile: jboss-build.xml

      prepare:

      compile:
      [javac] Compiling 4 source files to D:\Sun\AppServer\j2eetutorial14\examples
      \bank\build
      [javac] D:\Sun\AppServer\j2eetutorial14\examples\bank\src\com\sun\ebank\web\
      template\DefinitionTag.java:67: inconvertible types
      [javac] found : javax.servlet.jsp.JspContext
      [javac] required: javax.servlet.jsp.PageContext
      [javac] PageContext context = (PageContext) getJspContext();
      [javac] ^
      [javac] D:\Sun\AppServer\j2eetutorial14\examples\bank\src\com\sun\ebank\web\
      template\InsertTag.java:58: inconvertible types
      [javac] found : javax.servlet.jsp.JspContext
      [javac] required: javax.servlet.jsp.PageContext
      [javac] PageContext context = (PageContext) getJspContext();
      [javac] ^
      [javac] D:\Sun\AppServer\j2eetutorial14\examples\bank\src\com\sun\ebank\web\
      template\InsertTag.java:93: cannot resolve symbol
      [javac] symbol : constructor JspTagException (java.lang.String,java.lang.Th
      rowable)
      [javac] location: class javax.servlet.jsp.JspTagException
      [javac] throw new JspTagException(ex.getMessage(), rootCause);
      [javac] ^
      [javac] 3 errors

      BUILD FAILED
      D:\Sun\AppServer\j2eetutorial14\examples\bank\jboss-build.xml:49: Compile failed
      ; see the compiler error output for details.

      Total time: 7 seconds

      Any suggestions?

      Thanks.

        • 1. Re: Compile failed in Duke's Bank App
          Norman Richards Master

          What does your jboss-build.properties look like?

          • 2. Re: Compile failed in Duke's Bank App
            jerry ying Newbie

            Here is my build.properties:

            # Set the path to the JBoss directory containing the JBoss application server
            # (This is the one containing directories like "bin", "client" etc.)

            jboss.home=F:/software/jboss-3.2.3

            # Set the path to the JBoss server environment. For 3.2.x it is under JBoss Home
            # in the server directory either "default" or "all"
            #jboss.server=${jboss.home}

            jboss.server=${jboss.home}/server/default

            jboss.deploy.dir=${jboss.server}/deploy

            # Set the path to the servlet archive
            servlet.jar=${jboss.server}/lib/javax.servlet.jar
            #servlet.jar=${jboss.home}/tomcat-4.1.x/common/lib/servlet.jar

            • 3. Re: Compile failed in Duke's Bank App
              kasen wang Newbie

              I meet the same problem.
              the servlert version ?
              the correct servlert version ?
              help!help!help!help!

              • 4. Re: Compile failed in Duke's Bank App
                kasen wang Newbie

                I user the servlet-api.jar and jsp-api.jar of jakarta-tomcat-5.0.28, BUILD SUCCESSFUL!
                but update jboss-build.xml








                go ahead!!

                • 5. Re: Compile failed in Duke's Bank App
                  K P Newbie

                  I have the same problem.

                  My jboss-build.properties looks like this:

                  # Set the path to the JBoss directory containing the JBoss application server
                  # (This is the one containing directories like "bin", "client" etc.)

                  jboss.home= C:\jboss-4.0.1

                  jboss.server=${jboss.home}/server/default
                  jboss.deploy.dir=${jboss.server}/deploy


                  OpenEyes, could you be more specific - do you mean you changed this:










                  to point at your tomcat jars instead?

                  • 6. Re: Compile failed in Duke's Bank App
                    Huub van Thienen Newbie

                    Hi,

                    This problem seems to be closely related to the one I mentioned in my previous post. I updated the build.properties as follows (last four lines only):

                    # Set the path to the servlet archive
                    #servlet.jar=${jboss.server}/lib/javax.servlet.jar
                    #servlet.jar=${jboss.home}/tomcat-4.1.x/common/lib/servlet.jar
                    servlet.jar=C:/Program\ Files/Apache\ Software\ Foundation/Tomcat 5.0/common/lib/servlet-api.jar

                    This solves the problem of missing servlet packages, but I still can not find the jsp packages.

                    OpenEyes, you have solved this problem successfully. Could you please share your wisdom with us? How do I modify build.properties or jboss-buil.xml to pointto the correct jar? (I assume that C:/Program\ Files/Apache\ Software\ Foundation/Tomcat 5.0/common/lib/jsp-api.jar is the one that I need).

                    Thanks,
                    Huub

                    • 7. Re: Compile failed in Duke's Bank App
                      K P Newbie

                      I've solved it! (at least on my system.)

                      I had another servlet.jar hanging around on my machine.. in my classpath. Having removed it, everything compiles fine.

                      (I think jboss-build.xml is looking in ${jboss.server}/lib/ for javax.servlet.jar etc.. but presumably the other servlet.jar was getting picked up first.)

                      Hopefully you have the same situation Huub.

                      Katie

                      • 8. Re: Compile failed in Duke's Bank App
                        Huub van Thienen Newbie

                        Hi,

                        Yes! I finally solved it too, but in another way. I used Tomcat5.0/common/lib/servlet.jar for my servlet packages. An analysis of the error output showed that only two packages were missing: javax.servlet.jsp and javax.servlet.jsp.tagext. These packages are not included in my servlet.jsp, but can be found in Tomcat5.0/common/lib/jsp-api.jar. To enable the build to access this file, I changed build.properties and jboss-build.xml, as follows:

                        in build.properties, I added the lines:
                        tomcat.home= ... path to your local Tomcat installation directory ...
                        jsp-api.jar=${tomcat.home}/lib/common/jsp-api.jar

                        in jboss-build.xml, I replaced the lines:

                        <!--
                        | The build classpath
                        -->
                        < path id="build.classpath">
                        < path refid="client.classpath"/>
                        < pathelement location="${servlet.jar}"/>
                        </ path>

                        by:

                        <!--
                        | The build classpath
                        -->
                        < path id="build.classpath">
                        < path refid="client.classpath"/>
                        < pathelement location="${servlet.jar}"/>
                        < pathelement location="${jsp-api.jar}"/>
                        </ path>

                        And now it compiles.

                        I assume that the contents servlet.jar in Tomcat 4.x.y is distributed over servlet-api.jar and jsp-api.jar in Tomcat 5.x.y, but I have not been able to test that assumption.

                        Thanks for all the help and support!

                        Huub