ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <levylamb...@tiscali-dsl.de>
Subject Re: NullPointerException error on the <property environment="myenv/>
Date Tue, 27 May 2003 22:18:46 GMT
Sorry, in the log message I have ant 1.4.1
I have had a look at Property.java in ant 1.4.1
http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/taskdefs
/Property.java?rev=1.31.2.1&content-type=text/vnd.viewcvs-markup
Strangely, line 253 is not in LoadEnvironment, but in     protected void
addProperty(String n, String v)
That line says :
            if (project.getProperty(n) == null) {
I wonder whether you do not have parasite ant classes somewhere in your
classpath.

You want to search for org.apache.tools.ant.taskdefs.Property

Is the environment variable classpath set when you start ant ?
Otherwise, could you try ant 1.5.3 or a nightly build, and see whether it
works any better.

Again, beware, some BEA systems embed ant or deliver ant classes in their
jar files. So you should check very carefully.

Antoine

----- Original Message -----
From: "Thomas, Lee E" <Lee.E.Thomas@erac.com>
To: "'Ant Users List'" <user@ant.apache.org>
Sent: Tuesday, May 27, 2003 11:14 PM
Subject: RE: NullPointerException error on the <property
environment="myenv/>


> Hi Antoine,
>
> The verbose option does give me more information. Does this
> help?
>
> Thanks.
>
>
> - Lee
>
>
> C:\temp_test>ant -verbose -buildfile lee.xml
> Ant version 1.4.1 compiled on October 11 2001
> Buildfile: lee.xml
> Detected Java version: 1.3 in: C:\bea70sp2\jdk131_06\jre
> Detected OS: Windows XP
> parsing buildfile C:\temp_test\lee.xml with URI =
file:C:/temp_test/lee.xml
> Project base dir set to: C:\temp_test
>  [property] Loading Environment myenv.
>
> BUILD FAILED
>
> C:\temp_test\lee.xml:8: java.lang.NullPointerException
>         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:485)
>         at
> org.apache.tools.ant.ProjectHelper$AbstractHandler.endElement(Project
> Helper.java:204)
>         at org.xml.sax.helpers.XMLReaderAdapter.endElement(Unknown Source)
>         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.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(Unknown Source)
>         at javax.xml.parsers.SAXParser.parse(Unknown Source)
>         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: 0 seconds
> -----Original Message-----
> From: Antoine Levy-Lambert [mailto:levylambert@tiscali-dsl.de]
> Sent: Tuesday, May 27, 2003 4:01 PM
> To: Ant Users List
> Subject: Re: NullPointerException error on the <property
> environment="myenv/>
>
> Could you try ant -verbose -buildfile lee.xml
> Also, do you know if you are not accidentally using ant classes delivered
by
> BEA, which would be ahead of the "real" ant classes in your classpath ?
> Cheers,
> Antoine
> ----- Original Message -----
> From: "Thomas, Lee E" <Lee.E.Thomas@erac.com>
> To: "'Ant Users List'" <user@ant.apache.org>
> Sent: Tuesday, May 27, 2003 10:54 PM
> Subject: NullPointerException error on the <property environment="myenv/>
>
>
> > Hello,
> >
> > I have been receiving a java.lang.NullPointerException error
> > on the <property environment="myenv"/> line (see examples below). This
is
> > only occurring on a new windows XP machine I have received at work. My
old
> > Windows 2000 machine does not have this problem. I can get around the
> > problem if I set my JAVA_HOME directory to bea7/jdk131-03.
Unfortunately,
> > this is not the release that I need to be using. I need service pack 2.
> >
> > I am hoping someone out there will have seen a similar
> > problem.
> >
> >             Thank you.
> >
> >             Lee Thomas
> >             Lthomas2@erac.com
> >
> >
> >
> >           EXAMPLES:
> >
> >
> > ************************************************************
> > Failed Test with JAVA_HOME set to bea70sp2/jdk131-06
> > *************************************************************
> >
> >
> > C:\temp_test>ant -buildfile lee.xml
> >
> > Buildfile: lee.xml
> >
> >
> >
> > BUILD FAILED
> >
> >
> >
> > C:\temp_test\lee.xml:8: java.lang.NullPointerException
> >
> >
> >
> > Line 8, the line in error is   <property environment="myenv"/>
> >
> >
> >
> > Total time: 1 second
> >
> > C:\temp_test>
> >
> >
> >
> >
> > ***************************************************************
> > Successful Test with JAVA_HOME set to bea7/jdk131-03
> > ****************************************************************
> >
> >
> >
> >
> > C:\temp_test>ant -buildfile lee.xml
> >
> > Buildfile: lee.xml
> >
> >
> >
> > one:
> >
> >      [echo] entering one
> >
> >
> >
> > BUILD SUCCESSFUL
> >
> >
> >
> > Total time: 0 seconds
> >
> > C:\temp_test>
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



Mime
View raw message