- This topic has 1 reply, 1 voice, and was last updated 16 years, 11 months ago by
scsherwood.
-
AuthorPosts
-
scsherwoodMemberI’m totally frustrated. I can’t get myEclipse on my Mac Pro to run an ANT script that runs fine on myEclipse on Windows XP. I’ve tried copying all of the configuration settings from myEclipse on the PC to myEclipse on the MAC, but that doesn’t work.
The issue has to do with ANT NOT finding classes that (to me) are obviously in the CLASSPATH.
Here is a slimmed down version of the ANT script containing the part that is failing:
<?xml version=”1.0″ encoding=”UTF-8″?>
<project basedir=”.” default=”doIt” name=”Prototype”>
<property file=”build.ant.properties”/>
<!– JiBX binding compiler task definition –>
<taskdef classname=”org.jibx.binding.ant.CompileTask” name=”bind”>
<classpath>
<pathelement location=”lib/bcel.jar”/>
<pathelement location=”lib/jibx-bind.jar”/>
<pathelement location=”lib/jibx-run.jar”/>
<pathelement location=”lib/xpp3.jar”/>
</classpath>
</taskdef>
<target name=”doIt”>
<!– Run JiBX binding compiler –>
<echo> ${basedir} </echo><bind load=”true” verbose=”true”>
<bindingfileset includes=”binding.xml” dir=”config/jibx”/>
<classpathset dir=”lib/”/>
<!– classpathset dir=”lib/jibx-run.jar” / –>
</bind>
</target>
</project>The taskdef named “bind” above references 4 jars in the project-workspace/lib directory. Under the External Tools Dialog on the “Classpath” tab I have added these four jars from the project-workspace/lib directory. When I run the ANT script, I get the verbose errors: shown below. Note the “Caused by: ” line that states that Class org.jibx.runtime.Utility not found in any classpath. This class is in the “jibx-run.jar,” which was added in the Classpath tab. What gives?
On the “JRE” tab of the External Tools Dialog I have selected “Run in the same JRE as the workspace,” because if I select “Separate JRE,” I get another error that says the CLASS org.apache.xerces.jaxp.SAXParserFactoryImpl is not found even though the xercesImpl.jar, which contains this class was also added to the Classpath. So, with “Run in the same JRE as the workspace” selected, I get the following error:
Apache Ant version 1.7.0 compiled on February 29 2008
Buildfile: /Volumes/Data/JavaProjectsWork/estreetDev/testBuild.xml
parsing buildfile /Volumes/Data/JavaProjectsWork/estreetDev/testBuild.xml with URI = file:/Volumes/Data/JavaProjectsWork/estreetDev/testBuild.xml
Project base dir set to: /Volumes/Data/JavaProjectsWork/estreetDev
[antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found.
[property] Loading /Volumes/Data/JavaProjectsWork/estreetDev/build.ant.properties
[property] Unable to find property file: /Volumes/Data/JavaProjectsWork/estreetDev/build.ant.properties
Arguments: -verbose -Dbasedir=/Volumes/Data/JavaProjectsWork/estreetDev -Dorg.eclipse.ant.core.ANT_PROCESS_ID=1215200917368
Build sequence for target(s) `doIt’ is [doIt]
Complete build sequence is [doIt, ]doIt:
[echo] /Volumes/Data/JavaProjectsWork/estreetDev
[bind] Using the following paths:
[bind] /Volumes/Data/JavaProjectsWork/estreetDev/lib
[bind] Using the following binding paths:
[bind] /Volumes/Data/JavaProjectsWork/estreetDev/config/jibx/binding.xmlBUILD FAILED
/Volumes/Data/JavaProjectsWork/estreetDev/testBuild.xml:17: java.lang.ExceptionInInitializerError
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:623)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:456)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:377)
at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:230)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.ExceptionInInitializerError
at org.jibx.binding.Compile.compile(Compile.java:270)
at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:238)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
… 17 more
Caused by: java.lang.IllegalArgumentException: Class org.jibx.runtime.Utility not found in any classpath
at org.jibx.binding.def.StringConversion.<init>(StringConversion.java:153)
at org.jibx.binding.def.PrimitiveStringConversion.<init>(PrimitiveStringConversion.java:152)
at org.jibx.binding.def.BindingDefinition.<clinit>(BindingDefinition.java:66)
… 25 more
— Nested Exception —
java.lang.ExceptionInInitializerError
at org.jibx.binding.Compile.compile(Compile.java:270)
at org.jibx.binding.ant.CompileTask.execute(CompileTask.java:238)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:623)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:456)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:377)
at org.eclipse.ant.internal.ui.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:230)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.IllegalArgumentException: Class org.jibx.runtime.Utility not found in any classpath
at org.jibx.binding.def.StringConversion.<init>(StringConversion.java:153)
at org.jibx.binding.def.PrimitiveStringConversion.<init>(PrimitiveStringConversion.java:152)
at org.jibx.binding.def.BindingDefinition.<clinit>(BindingDefinition.java:66)
… 25 moreTotal time: 552 milliseconds
SURELY myECLIPSE WORKS ON MAC OS X. If you have any idea what I’m doing wrong, please post a reply.
Thanks.
July 6, 2008 at 8:57 am #286769
scsherwoodMemberTo configure xerces correctly on the Mac, a copy of xercesImpl.jar had to be put in /Library/Java/Home/lib/endorsed/
Now, after setting External Tools JRE tab to “Run in separate Environment” the ANT build script runs fine.
-
AuthorPosts