Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » ant can't find javax.xml.transform when run from inside eclipse
ant can't find javax.xml.transform when run from inside eclipse [message #141835] Fri, 13 February 2004 18:07 Go to next message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

hi, have a build.xml which runs fine from the command line on windoze xp
and on deadrat's fedora (both with CLASSPATH=""). the app runs fine in
eclsipe (3.0.0 Build id: 200308281813), and the unit tests run fine in
eclipse as apps and as junit tests. but i get a: compile: [javac] Compiling
16 source files to U:\projects\mappingtools\build\classes\srcobj
[javac]
U:\projects\mappingtools\src\com\ediidea\mappingtools\Mappin gTools.java:10:
cannot resolve symbol
[javac] symbol : class TransformerException
[javac] location: package transform
[javac] public static void csvToTransformedXml(final Reader csv,final Reader
xslt,final File intermediate,final Writer xml,final String
lineSeparator,final boolean discardBlankLines) throws
javax.xml.transform.TransformerException, IOException { ...

when running ant from with in eclipse (sorry about the color, i am new to
this brain damaged outlook).

i am using 1.3 as a target, naict, everything in eclipse is ponting to that.
there is no xml apis, xerces or other jars in jre/lib or jre/lib/ext. but
ant has xerces impl and xml apis jars in his lib, so he finds them when run
from the command line. but seems like for some reason, ant can't find the
stuff in his own lib when run from within eclipse? or maybe i am just
confused :(

anybody got a clue?

thanks

<?xml version="1.0" encoding="UTF-8"?>
<!-- note: you *must* have a copy of junit.jar in ant.home/lib to run the
junit task! -->
<project basedir="." default="all" name="mappingtools">
<property environment="env"/>
<property file="${user.home}/build.properties"/>
<property file="build.properties"/>
<target name="init">
</target>
<target name="clean" depends="init" description="clean">
<delete dir="dist"/>
<delete dir="build"/>
<delete dir="doc/apidoc"/>
<delete dir="deleted"/>
</target>
<target name="compile" depends="init" description="compile">
<mkdir dir="build"/>
<mkdir dir="build/classes"/>
<mkdir dir="build/classes/srcobj"/>
<javac debug="true" deprecation="true" destdir="build/classes/srcobj"
srcdir="src">
<classpath>
<pathelement location="lib/ostermillerutils_1_02_21.jar"/>
</classpath>
</javac>
<mkdir dir="build/classes/srcobj/com/ediidea/mappingtools/files"/ >
<copy todir="build/classes/srcobj/com/ediidea/mappingtools/files" >
<fileset dir="src/com/ediidea/mappingtools/files" includes="*.*"
excludes="*_.* *.nbattrs"/>
</copy>
</target>
<target name="compiletst" depends="compile" description="compile tests">
<mkdir dir="build/classes/tstobj"/>
<javac debug="true" deprecation="true" destdir="build/classes/tstobj"
srcdir="tst">
<classpath>
<pathelement location="lib/ostermillerutils_1_02_21.jar"/>
<pathelement location="${ant.home}/lib/junit.jar"/>
<pathelement location="build/classes/srcobj"/>
</classpath>
</javac>
<mkdir dir="build/classes/tstobj/com/ediidea/mappingtools/testfiles "/>
<copy todir="build/classes/tstobj/com/ediidea/mappingtools/testfiles ">
<fileset dir="tst/com/ediidea/mappingtools/testfiles" includes="*.*"
excludes="*.nbattrs"/>
</copy>
</target>
<target name="jar" depends="init,compile" description="jar">
<mkdir dir="build/lib"/>
<jar basedir="build/classes/srcobj" compress="true"
jarfile="build/lib/mappingtools.jar">
<exclude name="**/deleted/**"/>
<exclude name="**/RCS/**"/>
<exclude name="*.class"/><!-- exclude default package classes-->
</jar>
</target>
<target name="all" depends="init,compile">
</target>
<target name="test" depends="init,compiletst" description="test">
<java classname="com.ediidea.mappingtools.MappingToolsTestCase"
failonerror="true" fork="true">
<classpath>
<pathelement location="${ant.home}/lib/xercesImpl.jar"/>
<pathelement location="lib/xalan.jar"/>
<pathelement location="lib/ostermillerutils_1_02_21.jar"/>
<pathelement location="${ant.home}/lib/junit.jar"/>
<pathelement location="build/classes/srcobj"/>
<pathelement location="build/classes/tstobj"/>
</classpath>
</java>
</target>
<target name="testjar" depends="init,jar,compiletst" description="test
jar">
<java classname="com.ediidea.mappingtools.MappingToolsTestCase"
failonerror="true" fork="true">
<classpath>
<pathelement location="${ant.home}/lib/xercesImpl.jar"/>
<pathelement location="lib/xalan.jar"/>
<pathelement location="lib/ostermillerutils_1_02_21.jar"/>
<pathelement location="${ant.home}/lib/junit.jar"/>
<pathelement location="build/lib/mappingtools.jar"/>
<pathelement location="build/classes/tstobj"/>
</classpath>
</java>
</target>
<target name="junit" depends="init,jar,compiletst" description="test jar
using junit">
<junit printsummary="true" haltonfailure="true">
<formatter type="plain" usefile="false"/>
<test name="com.ediidea.mappingtools.MappingToolsTestCase"/>
<classpath>
<pathelement location="lib/xalan.jar"/>
<pathelement location="lib/ostermillerutils_1_02_21.jar"/>
<pathelement location="build/lib/mappingtools.jar"/>
<pathelement location="build/classes/tstobj"/>
</classpath>
</junit>
</target>
<target name="javadoc" depends="init" description="javadoc">
<mkdir dir="doc/apidoc"/>
<javadoc destdir="doc/apidoc" packagenames="com.ediidea.mappingtools.*">
<sourcepath>
<pathelement location="src"/>
</sourcepath>
<classpath>
<pathelement location="${ant.home}/lib/xml-apis.jar"/>
<pathelement location="lib/xalan.jar"/>
<pathelement location="lib/ostermillerutils_1_02_21.jar"/>
<pathelement location="build/classes/srcobj"/>
</classpath>
</javadoc>
</target>
</project>
Re: ant can't find javax.xml.transform when run from inside eclipse [message #141845 is a reply to message #141835] Fri, 13 February 2004 18:29 Go to previous messageGo to next message
Eclipse UserFriend
Which Ant are you specifying Eclipse to use...the default ant home which is
in the org.apache.ant plugin which has no Xerces or are you pointing to your
external install that has the xerces JARs?

Darins

"Ray Tayek" <rtayek.no@spam.freightgate.com> wrote in message
news:c0jksl$ia$1@eclipse.org...
> hi, have a build.xml which runs fine from the command line on windoze xp
> and on deadrat's fedora (both with CLASSPATH=""). the app runs fine in
> eclsipe (3.0.0 Build id: 200308281813), and the unit tests run fine in
> eclipse as apps and as junit tests. but i get a: compile: [javac]
Compiling
> 16 source files to U:\projects\mappingtools\build\classes\srcobj
> [javac]
>
U:\projects\mappingtools\src\com\ediidea\mappingtools\Mappin gTools.java:10:
> cannot resolve symbol
> [javac] symbol : class TransformerException
> [javac] location: package transform
> [javac] public static void csvToTransformedXml(final Reader csv,final
Reader
> xslt,final File intermediate,final Writer xml,final String
> lineSeparator,final boolean discardBlankLines) throws
> javax.xml.transform.TransformerException, IOException { ...
>
> when running ant from with in eclipse (sorry about the color, i am new to
> this brain damaged outlook).
>
> i am using 1.3 as a target, naict, everything in eclipse is ponting to
that.
> there is no xml apis, xerces or other jars in jre/lib or jre/lib/ext. but
> ant has xerces impl and xml apis jars in his lib, so he finds them when
run
> from the command line. but seems like for some reason, ant can't find the
> stuff in his own lib when run from within eclipse? or maybe i am just
> confused :(
>
> anybody got a clue?
>
> thanks
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!-- note: you *must* have a copy of junit.jar in ant.home/lib to run the
> junit task! -->
> <project basedir="." default="all" name="mappingtools">
> <property environment="env"/>
> <property file="${user.home}/build.properties"/>
> <property file="build.properties"/>
> <target name="init">
> </target>
> <target name="clean" depends="init" description="clean">
> <delete dir="dist"/>
> <delete dir="build"/>
> <delete dir="doc/apidoc"/>
> <delete dir="deleted"/>
> </target>
> <target name="compile" depends="init" description="compile">
> <mkdir dir="build"/>
> <mkdir dir="build/classes"/>
> <mkdir dir="build/classes/srcobj"/>
> <javac debug="true" deprecation="true" destdir="build/classes/srcobj"
> srcdir="src">
> <classpath>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> </classpath>
> </javac>
> <mkdir dir="build/classes/srcobj/com/ediidea/mappingtools/files"/ >
> <copy todir="build/classes/srcobj/com/ediidea/mappingtools/files" >
> <fileset dir="src/com/ediidea/mappingtools/files" includes="*.*"
> excludes="*_.* *.nbattrs"/>
> </copy>
> </target>
> <target name="compiletst" depends="compile" description="compile tests">
> <mkdir dir="build/classes/tstobj"/>
> <javac debug="true" deprecation="true" destdir="build/classes/tstobj"
> srcdir="tst">
> <classpath>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="${ant.home}/lib/junit.jar"/>
> <pathelement location="build/classes/srcobj"/>
> </classpath>
> </javac>
> <mkdir dir="build/classes/tstobj/com/ediidea/mappingtools/testfiles "/>
> <copy
todir="build/classes/tstobj/com/ediidea/mappingtools/testfiles ">
> <fileset dir="tst/com/ediidea/mappingtools/testfiles" includes="*.*"
> excludes="*.nbattrs"/>
> </copy>
> </target>
> <target name="jar" depends="init,compile" description="jar">
> <mkdir dir="build/lib"/>
> <jar basedir="build/classes/srcobj" compress="true"
> jarfile="build/lib/mappingtools.jar">
> <exclude name="**/deleted/**"/>
> <exclude name="**/RCS/**"/>
> <exclude name="*.class"/><!-- exclude default package classes-->
> </jar>
> </target>
> <target name="all" depends="init,compile">
> </target>
> <target name="test" depends="init,compiletst" description="test">
> <java classname="com.ediidea.mappingtools.MappingToolsTestCase"
> failonerror="true" fork="true">
> <classpath>
> <pathelement location="${ant.home}/lib/xercesImpl.jar"/>
> <pathelement location="lib/xalan.jar"/>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="${ant.home}/lib/junit.jar"/>
> <pathelement location="build/classes/srcobj"/>
> <pathelement location="build/classes/tstobj"/>
> </classpath>
> </java>
> </target>
> <target name="testjar" depends="init,jar,compiletst" description="test
> jar">
> <java classname="com.ediidea.mappingtools.MappingToolsTestCase"
> failonerror="true" fork="true">
> <classpath>
> <pathelement location="${ant.home}/lib/xercesImpl.jar"/>
> <pathelement location="lib/xalan.jar"/>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="${ant.home}/lib/junit.jar"/>
> <pathelement location="build/lib/mappingtools.jar"/>
> <pathelement location="build/classes/tstobj"/>
> </classpath>
> </java>
> </target>
> <target name="junit" depends="init,jar,compiletst" description="test jar
> using junit">
> <junit printsummary="true" haltonfailure="true">
> <formatter type="plain" usefile="false"/>
> <test name="com.ediidea.mappingtools.MappingToolsTestCase"/>
> <classpath>
> <pathelement location="lib/xalan.jar"/>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="build/lib/mappingtools.jar"/>
> <pathelement location="build/classes/tstobj"/>
> </classpath>
> </junit>
> </target>
> <target name="javadoc" depends="init" description="javadoc">
> <mkdir dir="doc/apidoc"/>
> <javadoc destdir="doc/apidoc" packagenames="com.ediidea.mappingtools.*">
> <sourcepath>
> <pathelement location="src"/>
> </sourcepath>
> <classpath>
> <pathelement location="${ant.home}/lib/xml-apis.jar"/>
> <pathelement location="lib/xalan.jar"/>
> <pathelement location="lib/ostermillerutils_1_02_21.jar"/>
> <pathelement location="build/classes/srcobj"/>
> </classpath>
> </javadoc>
> </target>
> </project>
>
>
Re: ant can't find javax.xml.transform when run from inside eclipse [message #142430 is a reply to message #141845] Mon, 16 February 2004 18:24 Go to previous message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

"Darin Swanson" <Darin_Swanson@us.ibm.com> wrote in message
news:c0jm7d$1mu$1@eclipse.org...
> Which Ant are you specifying Eclipse to use...the default ant home which
is
> in the org.apache.ant plugin which has no Xerces or are you pointing to
your
> external install that has the xerces JARs?
>

ant and optional jars that are specified in the ant runtime are from the
3.0/plugins.

but i was working on the project over the weekend (i took it home and hacked
at it). my problem seems to be fixed and now i am stuck with:
BUILD FAILED: file:U:/projects/mappingtools/build.xml:77: Could not create
task or type of type: junit.

despite the fact that i have junit.jar in the ant run time :( - i guess i
will try reproduce this on a simpler project.

thanks


> Darins
>
> "Ray Tayek" <rtayek.no@spam.freightgate.com> wrote in message
> news:c0jksl$ia$1@eclipse.org...
> > hi, have a build.xml which runs fine from the command line on windoze
xp
> > and on deadrat's fedora (both with CLASSPATH=""). the app runs fine in
> > eclsipe (3.0.0 Build id: 200308281813), and the unit tests run fine in
> > eclipse as apps and as junit tests. but i get a: compile: [javac]
> Compiling
> > 16 source files to U:\projects\mappingtools\build\classes\srcobj
> > [javac]
> >
>
U:\projects\mappingtools\src\com\ediidea\mappingtools\Mappin gTools.java:10:
> > cannot resolve symbol
> > [javac] symbol : class TransformerException ...
> >
> > when running ant from with in eclipse ...

> > i am using 1.3 as a target, naict, everything in eclipse is ponting to
> that.
> > there is no xml apis, xerces or other jars in jre/lib or jre/lib/ext.
but
> > ant has xerces impl and xml apis jars in his lib, so he finds them when
> run
> > from the command line. but seems like for some reason, ant can't find
the
> > stuff in his own lib when run from within eclipse?...
Previous Topic:source of an errant cvs command
Next Topic:Creating a java project programmaticaly
Goto Forum:
  


Current Time: Thu May 08 17:34:04 EDT 2025

Powered by FUDForum. Page generated in 0.03555 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top