facebook

ANT script won’t run myEclipse Mac OS X (Runs in Windows)

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #286676 Reply

    scsherwood
    Member

    I believe my problem is a configuration problem, but for the life of me I can’t figure it out.

    I’m running on a Mac Pro (8 cores) with 10GB of memory, 600GB of disk space. I’m running Mac OS X 10.5.3 and myEclipse Version 6.0.1 GA
    eclipse.buildId=M20080221-1800

    I have an ant build.xml file that runs fine in myEclipse on a PC for the very same project. On the Mac I have configured the project as follows:
    I have right clicked the project and selected “Java Build Path,” clicked on the “Libraries” tab and added all of the jar files that are in the <project>/lib folder in the workspace. There are approximately 53 jars that I add. Of special interest for this discussion are the following jar files:

    bcel.jar
    jibx-bin.jar
    jibx-run.jar
    xpp3.jar
    xercesImpl.jar

    In the external tools dialog where I set up the Ant build, I have again selected the Classpath tab and added the 53+ jars including those above to the “User Entries” classpath.

    In the Ant build file there is a section as follows:

    <?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 –>
    <bind load=”true” verbose=”true”>
    <bindingfileset includes=”binding.xml” dir=”config/jibx”/>
    <classpathset dir=”lib/”/>
    </bind>
    </target>

    </project>

    binding.xml exists in the <project>/config/jibx/ directory.

    When the ANT script runs, I receive the following Failure error:

    BUILD FAILED
    /Volumes/Data/JavaProjectsWork/estreetDev/testBuild.xml:17: java.lang.ExceptionInInitializerError

    The verbose mode provides the following detail:

    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 more

    The key element from the verbose mode is that:
    1. Class org.jibx.runtime.Utility not found in any classpath

    I don’t understand this. I added jibx-run.jar to the project classpath and the external tools classpath. Inside of jibx-run.jar is

    org/jibx/runtime/Utility.class

    Can anyone tells me what gives????

    #286712 Reply

    Riyad Kalla
    Member

    I’m running on a Mac Pro (8 cores) with 10GB of memory, 600GB of disk space. I’m running Mac OS X 10.5.3 and myEclipse Version 6.0.1 GA
    eclipse.buildId=M20080221-1800

    That’s your problem, your computer isn’t powerful enough….

    that’s a joke by the way 😀

    The key element from the verbose mode is that:
    1. Class org.jibx.runtime.Utility not found in any classpath

    I don’t understand this. I added jibx-run.jar to the project classpath and the external tools classpath. Inside of jibx-run.jar is

    Ok it looks like you have all your bases covered but the *one* thing that popped into my head was that you are using relative path references in your build file (which is good), so the only thing that would cause those not to be loaded and not found by the task is if your execution dir for the external script was being set to something other than the root of the project, so your lib/flerg.jar references are actually not getting resolved.

    Isn’t there an Ant task that will print out the current dir? I wonder if you could echo that to the console and see what it is or just double-check the external tools dialog to set the execution dir.

    #286753 Reply

    scsherwood
    Member

    Here is the full printout of the verbose output along with an echo task showing the basedir.

    Also, notice the line that says “Could not load definitions from resource org/apache/tools/ant/antlib.xml.” I still think I have some configuration wrong, but I can’t figure this out. It’s driving me crazy. Surely, myEclipse works on a Mac.

    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=1215185583758
    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.xml

    BUILD 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 more

    Total time: 500 milliseconds

    #286818 Reply

    Riyad Kalla
    Member

    Are you re-using a workspace that was copied from a Windows machine? If so it’s possible you picked up all the (invalid) paths from the Ant configuration. Try going to Window > Prefs > General > Ant > Runtime and hitting “Reset Defaults” then hitting OK and trying again.

    You are right, this really does look like a config problem just not sure where it lies.

    One last-ditch thing might be to create a new/clean workspace (File > Switch Workspace) and point it at a dir that doesn’t exist and hit OK, then try and run a super-basic, empty, 1-task Ant file and see if ti runs…

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: ANT script won’t run myEclipse Mac OS X (Runs in Windows)

You must be logged in to post in the forum log in