You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Bill Barnhill <bb...@twcny.rr.com> on 2000/05/21 02:23:36 UTC

Request for Help building with Head co from CVS

I reall need some help. I just checked out the head version
of jakarta-ant and built it according to instructions, but
when I try to use it on a simple test servlet I get
    Exception in thread "main"
javax.xml.parsers.FactoryConfigurationError:
        com.sun.xml.parser.SAXParserFactoryImpl

The full exception frame is below.


D:\home\wab\sandbox\mycode\HelloServlet>ant
Bad command or file name
Buildfile: build.xml
Exception in thread "main"
javax.xml.parsers.FactoryConfigurationError: com.sun.
xml.parser.SAXParserFactoryImpl
        at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFact
ory.java:
84)
        at
org.apache.tools.ant.ProjectHelper.getParserFactory(ProjectH
elper.jav
a:513)
        at
org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:
102)
        at org.apache.tools.ant.Main.runBuild(Main.java,
Compiled Code)
        at org.apache.tools.ant.Main.main(Main.java,
Compiled Code)
Bad command or file name
D:\home\wab\sandbox\mycode\HelloServlet>

I really hope someone can help, as I've never contributed to
an open-source project before, but I would like to start
with Ant.  There are three ideas I'd like to implement
(comments appreciated):

    1. availablelist, a task similar to available that
            .. attributes are classes, resources, files, and
property.
            .. attributes are comma separated lists of
equivalent attributes in available task
            .. unlike available classes,resources,and files
are not mutually exclusive, you can up to all three
            .. If all items in all three lists (or however
many lists are specified 1-3) are available, then property
is yes.
     2. Regexp string replacement for macros, similar to
what's seen in BsdMake and elsewhere.
            .. A property of sources is set to
"a.java,b.java,c.java" then
            $(sources:\.java,\.class) evals to
"a.class,b.class,c.class"
     3.  target attributes iffiles, ifresources, ifclasses
that are a combination of if and availablelist  above, and
            address #1 on TODO list.

I am running jdk1.2.2 on a Win98 machine.

The following is the output from set so you can see what my
environment.

TMP=C:\WINDOWS\TEMP
TEMP=C:\WINDOWS\TEMP
PROMPT=$p$g
winbootdir=C:\WINDOWS
COMSPEC=C:\WINDOWS\COMMAND.COM
BLASTER=A220 I5 D1 H5 P330  T6
windir=C:\WINDOWS
TOMCAT_HOME=D:\bin\jakarta-tomcat
CTCM=C:\WINDOWS
CTSYN=C:\WINDOWS
JSDTHOME=d:\BIN\JSDT20
JSDT_SERVER=localhost
JAVA_HOME=d:\bin\jdk1.2.2
HOME=d:\home\wab
ANT_HOME=d:\test\ant
JAXPHOME=C:\Program Files\JavaSoft\Jaxp1.0.1
WINDIR=C:\windows
LOGNAME=wab
CVSROOT=:local:d:\home\cvs
MSDEVDIR=D:\PROGRA~1\MICROS~2\COMMON\msdev98
MSVCDIR=D:\PROGRA~1\MICROS~2\VC98
PATH=D:\PROGRA~1\MICROS~2\COMMON\MSDEV98\BIN;D:\PROGRA~1\MIC
ROS~2\VC98\BIN;D:\PROGRA~1\MICROS~2\COMMON\TOOLS\WIN95;D:\PR
OGRA~1\MICROS~2\COMMON\TOOLS;C:\WINDOWS\SYSTEM;C:\WINDOWS;C:
\WINDOWS\COMMAND;C:\CVS;D:\BIN\JDK12~1.2\BIN;;C:\PERL\BIN;C:
\WINDOWS;C:\WINDOWS\COMMAND;C:\CVS;D:\BIN\JDK12~1.2\BIN;;C:\
PROGRA~1\MTS;C:\BIN;C:\BINW;D:\TEST\ANT\BIN
INCLUDE=D:\PROGRA~1\MICROS~2\VC98\ATL\INCLUDE;D:\PROGRA~1\MI
CROS~2\VC98\INCLUDE;D:\PROGRA~1\MICROS~2\VC98\MFC\INCLUDE;
LIB=D:\PROGRA~1\MICROS~2\VC98\LIB;D:\PROGRA~1\MICROS~2\VC98\
MFC\LIB;
CLASSPATH=d:\test\ant\lib\ant.jar;d:\test\ant\lib\xml.jar;d:
\bin\jdk1.2.2\lib\tools.jar;;D:\bin\jakarta-tools\javac.jar;
D:\BIN\JSDT20\LIB\JSDT.JAR;D:\BIN\JMF20\LIB\JMF.JAR;D:\BIN\J
MF20\LIB\SOUND.JAR;D:\bin\jakarta-tools\moo.jar;D:\bin\jakar
ta-tools\projectx-tr2.jar;D:\bin\jakarta-tools\servlet-2.2.0
.jar
CMDLINE=java -Dant.home="d:\test\ant"
org.apache.tools.ant.Main



Re: Request for Help building with Head co from CVS

Posted by Bill Barnhill <bb...@twcny.rr.com>.
I think I resolved my problem.  The download I was trying to
work with was the latest and greatest, equivalent to a
nightly snapshot. Once I went back to the last release build
I was fine. Is the release build what we should be testing
new code with? Or am I doing setting up my environment the
wrong way?

----- Original Message -----
From: "Bill Barnhill" <bb...@twcny.rr.com>
To: <an...@jakarta.apache.org>
Sent: Saturday, May 20, 2000 8:23 PM
Subject: Request for Help building with Head co from CVS


> I reall need some help. I just checked out the head
version
> of jakarta-ant and built it according to instructions, but
> when I try to use it on a simple test servlet I get
>     Exception in thread "main"
> javax.xml.parsers.FactoryConfigurationError:
>         com.sun.xml.parser.SAXParserFactoryImpl
>
> The full exception frame is below.
>
>
> D:\home\wab\sandbox\mycode\HelloServlet>ant
> Bad command or file name
> Buildfile: build.xml
> Exception in thread "main"
> javax.xml.parsers.FactoryConfigurationError: com.sun.
> xml.parser.SAXParserFactoryImpl
>         at
>
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFact
> ory.java:
> 84)
>         at
>
org.apache.tools.ant.ProjectHelper.getParserFactory(ProjectH
> elper.jav
> a:513)
>         at
>
org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:
> 102)
>         at org.apache.tools.ant.Main.runBuild(Main.java,
> Compiled Code)
>         at org.apache.tools.ant.Main.main(Main.java,
> Compiled Code)
> Bad command or file name
> D:\home\wab\sandbox\mycode\HelloServlet>
>
> I really hope someone can help, as I've never contributed
to
> an open-source project before, but I would like to start
> with Ant.  There are three ideas I'd like to implement
> (comments appreciated):
>
>     1. availablelist, a task similar to available that
>             .. attributes are classes, resources, files,
and
> property.
>             .. attributes are comma separated lists of
> equivalent attributes in available task
>             .. unlike available classes,resources,and
files
> are not mutually exclusive, you can up to all three
>             .. If all items in all three lists (or however
> many lists are specified 1-3) are available, then property
> is yes.
>      2. Regexp string replacement for macros, similar to
> what's seen in BsdMake and elsewhere.
>             .. A property of sources is set to
> "a.java,b.java,c.java" then
>             $(sources:\.java,\.class) evals to
> "a.class,b.class,c.class"
>      3.  target attributes iffiles, ifresources, ifclasses
> that are a combination of if and availablelist  above, and
>             address #1 on TODO list.
>
> I am running jdk1.2.2 on a Win98 machine.
>
> The following is the output from set so you can see what
my
> environment.
>
> TMP=C:\WINDOWS\TEMP
> TEMP=C:\WINDOWS\TEMP
> PROMPT=$p$g
> winbootdir=C:\WINDOWS
> COMSPEC=C:\WINDOWS\COMMAND.COM
> BLASTER=A220 I5 D1 H5 P330  T6
> windir=C:\WINDOWS
> TOMCAT_HOME=D:\bin\jakarta-tomcat
> CTCM=C:\WINDOWS
> CTSYN=C:\WINDOWS
> JSDTHOME=d:\BIN\JSDT20
> JSDT_SERVER=localhost
> JAVA_HOME=d:\bin\jdk1.2.2
> HOME=d:\home\wab
> ANT_HOME=d:\test\ant
> JAXPHOME=C:\Program Files\JavaSoft\Jaxp1.0.1
> WINDIR=C:\windows
> LOGNAME=wab
> CVSROOT=:local:d:\home\cvs
> MSDEVDIR=D:\PROGRA~1\MICROS~2\COMMON\msdev98
> MSVCDIR=D:\PROGRA~1\MICROS~2\VC98
>
PATH=D:\PROGRA~1\MICROS~2\COMMON\MSDEV98\BIN;D:\PROGRA~1\MIC
>
ROS~2\VC98\BIN;D:\PROGRA~1\MICROS~2\COMMON\TOOLS\WIN95;D:\PR
>
OGRA~1\MICROS~2\COMMON\TOOLS;C:\WINDOWS\SYSTEM;C:\WINDOWS;C:
>
\WINDOWS\COMMAND;C:\CVS;D:\BIN\JDK12~1.2\BIN;;C:\PERL\BIN;C:
>
\WINDOWS;C:\WINDOWS\COMMAND;C:\CVS;D:\BIN\JDK12~1.2\BIN;;C:\
> PROGRA~1\MTS;C:\BIN;C:\BINW;D:\TEST\ANT\BIN
>
INCLUDE=D:\PROGRA~1\MICROS~2\VC98\ATL\INCLUDE;D:\PROGRA~1\MI
> CROS~2\VC98\INCLUDE;D:\PROGRA~1\MICROS~2\VC98\MFC\INCLUDE;
>
LIB=D:\PROGRA~1\MICROS~2\VC98\LIB;D:\PROGRA~1\MICROS~2\VC98\
> MFC\LIB;
>
CLASSPATH=d:\test\ant\lib\ant.jar;d:\test\ant\lib\xml.jar;d:
>
\bin\jdk1.2.2\lib\tools.jar;;D:\bin\jakarta-tools\javac.jar;
>
D:\BIN\JSDT20\LIB\JSDT.JAR;D:\BIN\JMF20\LIB\JMF.JAR;D:\BIN\J
>
MF20\LIB\SOUND.JAR;D:\bin\jakarta-tools\moo.jar;D:\bin\jakar
>
ta-tools\projectx-tr2.jar;D:\bin\jakarta-tools\servlet-2.2.0
> .jar
> CMDLINE=java -Dant.home="d:\test\ant"
> org.apache.tools.ant.Main
>
>


Re: Request for Help building with Head co from CVS

Posted by Bill Barnhill <bb...@twcny.rr.com>.
Thanks for answering, I appreciate it.

Yes. I needed to do that when I grabbed the latest release.
I think the release I had used before was old, as it seemed
to use DOM, not SAX.  I have the current release version
running, and I can do a full cycle (change, build ant, build
test project and have changes reflected).  Question is
whether I should be developing from a release base or from a
nightly build base?  If nightly builds may not run, then if
possible I'd like to stay working as I am now.

Btw, MacroExpansion package is going quickly, so I'm going
to need help in how to submit this for review.  I read that
I should submit a msg to this list with a subject line
    PATCHES - short description of patch
and a body containing a cvs diff of the changed code versus
baseline code. Can my baseline be the current release, or
does it have to be nightly builds?

What follows is a semi-short description of MacroExpander
package:

MacroExpander interface -
    .. exposes a public static void expandMacros method
MacroExpanderException, extends BuildException,
    .. used for parsing errors, missing properties, etc.
Eventually this will be base for more detailed exceptions
DefaultMacroExpander, implements MacroExpander
    .. this is the current macro functionality pulled out
into a MacroExpander impl.
    .. macro format (Tried doing this in formal state spec,
but I don't remember enough of it to be valie. I'll brush
        up and have something cleaner when I submit)
    .. $(macrostr) and macrostr has format macroname
SubstMacroExpander, implements MacroExpander, extends
DefaultMacroExpander
    ..  if  macroname has no colons then default to
DefaultMacroExpander
    ..  otherwise handle format $(macrostr) where macrostr
has format macroname[substlist]
    .. substlist has format
:replacedstr,replacementstr[substlist]
    .. no patterns in either string in this version
    .. substlist are handled in sequence, so the second acts
on the output of the first, etc.
RegExMacroExpander, same as above except can handled
RegExpressions in replacedstr

I am thinking of another package to go along side it,
Feature, which would encapsulate most of the generic aspects
of a feature.
For example init, cleanup, maybe eventually an ability to
decide if it wants to listen to build events, and then to
listen to them.  For right now this would just be a clean
way to implement a check for a Feature.MacroExpander.Class
property and grab instance of class so we don't have to do
introspection every time a string is expanded.

Change would also include
    .. some mods to Main to accommodate MacroExpander init
from property as above and cleanup
    .. possibly a task that changes that property and re
grabs an instance if class different
    ..  most of the functionality of replaceProperties in
ProjectHelper being replaced with an outcall to the
        selected MacroExpander.


----- Original Message -----
From: "Conor MacNeill" <co...@m64.com>
To: <an...@jakarta.apache.org>
Sent: Sunday, May 21, 2000 6:59 AM
Subject: RE: Request for Help building with Head co from CVS


> I think you need to install JAXP to run the latest ant.
Try
> http://java.sun.com/xml/download.html
>
> --
> Conor MacNeill
>
> > -----Original Message-----
> > From: Bill Barnhill [mailto:bbarnhil@twcny.rr.com]
> > Sent: Sunday, 21 May 2000 10:24
> > To: ant-dev@jakarta.apache.org
> > Subject: Request for Help building with Head co from CVS
> >
> >
> > I reall need some help. I just checked out the head
version
> > of jakarta-ant and built it according to instructions,
but
> > when I try to use it on a simple test servlet I get
> >     Exception in thread "main"
> > javax.xml.parsers.FactoryConfigurationError:
> >         com.sun.xml.parser.SAXParserFactoryImpl
>
>


RE: Request for Help building with Head co from CVS

Posted by Conor MacNeill <co...@m64.com>.
I think you need to install JAXP to run the latest ant. Try
http://java.sun.com/xml/download.html

--
Conor MacNeill

> -----Original Message-----
> From: Bill Barnhill [mailto:bbarnhil@twcny.rr.com]
> Sent: Sunday, 21 May 2000 10:24
> To: ant-dev@jakarta.apache.org
> Subject: Request for Help building with Head co from CVS 
> 
> 
> I reall need some help. I just checked out the head version
> of jakarta-ant and built it according to instructions, but
> when I try to use it on a simple test servlet I get
>     Exception in thread "main"
> javax.xml.parsers.FactoryConfigurationError:
>         com.sun.xml.parser.SAXParserFactoryImpl