6 Replies Latest reply on Jul 9, 2008 1:46 PM by peterj

    Getting started with JBoss4.0 - Ant Build Error

    anupjani

      Hi.
      I was following this tutorial to try Duke's Bank Application on JBoss4.
      After downloading & unzipping j2ee-1_4-doc-tutorial_7.zip I copied examples folder into ${jboss.home}/server/myconfig. Then changed build.properties to set jboss.home path as "C:\JBoss4".
      And ran following ANT command: C:\JBoss4\server\myconfig\examples\bank>ant -f build.xml compile.

      The build fails with

      java.lang.NullPointerException
      showing a window popup dialog saying

      ---------------------------
      16 bit MS-DOS Subsystem
      ---------------------------
      C:\WINDOWS\system32\ntvdm.exe
      Error while setting up environment for the application. Choose 'Close' to terminate the application.
      ---------------------------
      Close Ignore
      ---------------------------

      Even after clicking on Ignore the build fails.

      I ensured there is no problem in build.properties. I ran each command (i.e. variable setting) one by one on command prompt & it came out all fine.

      I have never faced this error before.
      Please help.

      Anup Jani

        • 1. Re: Getting started with JBoss4.0 - Ant Build Error
          peterj

          Please post the full stack trace you get from the ant build. Also, you should add the -v option to the ant command line to get more information about the problem.

          I am not sure about the cause of the error dialog. It looks like a 16-bit app is being run at some point, but the 16-bit virtual device manager (ntvdm.exe) is having problems running (could be a faulty XP install).

          • 2. Re: Getting started with JBoss4.0 - Ant Build Error
            anupjani

            Thanks Peter.
            My XP was installed without any error.
            Following verbose as asked.

            C:\JBoss4\server\myconfig\examples\bank>ant -f build.xml -v
            Ant version 1.4 compiled on September 3 2001
            Buildfile: build.xml
            Detected Java version: 1.4 in: C:\JDK5\jre
            Detected OS: Windows XP
            parsing buildfile C:\JBoss4\server\myconfig\examples\bank\build.xml with URI = f
            ile:C:/JBoss4/server/myconfig/examples/bank/build.xml
            Project base dir set to: C:\JBoss4\server\myconfig\examples\bank
            [property] Loading C:\JBoss4\server\myconfig\examples\common\build.properties
            [property] Loading C:\JBoss4\server\myconfig\examples\bank\build.properties
            resolving systemId: file:C:/JBoss4/server/myconfig/examples/bank/../common/targe
            ts.xml
            [property] Loading Environment env.

            BUILD FAILED

            C:\JBoss4\server\myconfig\examples\bank\build.xml:145: java.lang.NullPointerExce
            ption
            at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:135)
            at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
            a:85)
            at org.apache.tools.ant.Main.runBuild(Main.java:439)
            at org.apache.tools.ant.Main.start(Main.java:153)
            at org.apache.tools.ant.Main.main(Main.java:176)
            --- Nested Exception ---
            java.lang.NullPointerException
            at org.apache.tools.ant.taskdefs.Property.loadEnvironment(Property.java:
            253)
            at org.apache.tools.ant.taskdefs.Property.execute(Property.java:183)
            at org.apache.tools.ant.ProjectHelper$TaskHandler.finished(ProjectHelper
            .java:489)
            at org.apache.tools.ant.ProjectHelper$AbstractHandler.endElement(Project
            Helper.java:204)
            at org.xml.sax.helpers.XMLReaderAdapter.endElement(XMLReaderAdapter.java
            :355)
            at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1523)
            at org.apache.crimson.parser.Parser2.content(Parser2.java:1766)
            at org.apache.crimson.parser.Parser2.externalParsedEntity(Parser2.java:2
            753)
            at org.apache.crimson.parser.Parser2.expandEntityInContent(Parser2.java:
            2487)
            at org.apache.crimson.parser.Parser2.maybeReferenceInContent(Parser2.jav
            a:2364)
            at org.apache.crimson.parser.Parser2.content(Parser2.java:1820)
            at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1494)
            at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:500)
            at org.apache.crimson.parser.Parser2.parse(Parser2.java:305)
            at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)

            at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:225)

            at javax.xml.parsers.SAXParser.parse(SAXParser.java:344)
            at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:117)
            at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.jav
            a:85)
            at org.apache.tools.ant.Main.runBuild(Main.java:439)
            at org.apache.tools.ant.Main.start(Main.java:153)
            at org.apache.tools.ant.Main.main(Main.java:176)

            Total time: 1 second

            Kindly help.
            Anup Jani

            • 3. Re: Getting started with JBoss4.0 - Ant Build Error
              peterj

              Looks like Ant is having problems with your environment variables. From the command prompt where you are running ant, run:

              set


              and post the results.

              • 4. Re: Getting started with JBoss4.0 - Ant Build Error
                anupjani

                Microsoft Windows XP [Version 5.1.2600]
                (C) Copyright 1985-2001 Microsoft Corp.

                C:\Documents and Settings\Anup>set
                ALLUSERSPROFILE=C:\Documents and Settings\All Users
                ANT_HOME=c:\Ant1.4
                APPDATA=C:\Documents and Settings\Anup\Application Data
                classpath=.;c:\jdk5\lib;C:\Ant1.4\lib
                CLIENTNAME=Console
                CommonProgramFiles=C:\Program Files\Common Files
                COMPUTERNAME=ARPITA-PC
                ComSpec=C:\WINDOWS\system32\cmd.exe
                FP_NO_HOST_CHECK=NO
                HOMEDRIVE=C:
                HOMEPATH=\Documents and Settings\Anup
                JAVA_HOME=C:\JDK5
                JBOSS_HOME=C:\JBoss4
                LOGONSERVER=\\ARPITA-PC
                NUMBER_OF_PROCESSORS=2
                OS=Windows_NT
                Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ID
                M Computer Solutions\UltraEdit-32;c:\jdk5\bin;C:\Ant1.4\bin
                PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
                PROCESSOR_ARCHITECTURE=x86
                PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 13, GenuineIntel
                PROCESSOR_LEVEL=6
                PROCESSOR_REVISION=0f0d
                ProgramFiles=C:\Program Files
                PROMPT=$P$G
                SESSIONNAME=Console
                SystemDrive=C:
                SystemRoot=C:\WINDOWS
                TEMP=C:\DOCUME~1\Anup\LOCALS~1\Temp
                TMP=C:\DOCUME~1\Anup\LOCALS~1\Temp
                USERDOMAIN=ARPITA-PC
                USERNAME=Anup
                USERPROFILE=C:\Documents and Settings\Anup
                windir=C:\WINDOWS

                • 5. Re: Getting started with JBoss4.0 - Ant Build Error
                  peterj

                  I do not see anything odd in your environment variables. I looked at the source code for Property, where the NPE happened. I am afraid that the only way to resolve this is to modify both the Property and Execute classes in Ant to see what the problem is. The only other thing I can think of is to try a newer version of Ant.

                  • 6. Re: Getting started with JBoss4.0 - Ant Build Error
                    peterj

                    One more alternative - dig through the build.xml looking at what is uses the env property for and just provide those values as properties. Hopefully it only assigned env values to other properties and does not use env values directly.