Bug 26438 - Ant scripts don't run with a different ANT_HOME
Summary: Ant scripts don't run with a different ANT_HOME
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2002-11-14 19:16 EST by Matthew Conway CLA
Modified: 2002-11-18 11:05 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Conway CLA 2002-11-14 19:16:31 EST
If I use the External Tools -> Ant preferences to point to a different Ant home,
I get the following exception when I try and run an ant script.  I'm guessing
its because of classloader heirarchy issue - i.e. maybe AntProcessBuildLogger
inherits from a BuildLogger from a different classloader.


!MESSAGE org.eclipse.ui.externaltools.internal.ant.logger.AntProcessBuildLogger
which was specified to perform logging is not an instance of
org.apache.tools.ant.BuildLogger.
!STACK 0
org.eclipse.ui.externaltools.internal.ant.logger.AntProcessBuildLogger which was
specified to perform logging is not an instance of org.apache.tools.ant.BuildLogger.
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.createLogger(InternalAntRunner.java:606)
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.addBuildListeners(InternalAntRunner.java:183)
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:481)
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:331)
	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:324)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:312)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:380)
	at
org.eclipse.ui.externaltools.internal.ant.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:145)
	at java.lang.Thread.run(Thread.java:536)
Caused by: java.lang.ClassCastException
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.createLogger(InternalAntRunner.java:602)
	... 11 more
--- Nested Exception ---
java.lang.ClassCastException
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.createLogger(InternalAntRunner.java:602)
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.addBuildListeners(InternalAntRunner.java:183)
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:481)
	at
org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:331)
	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:324)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:312)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:380)
	at
org.eclipse.ui.externaltools.internal.ant.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:145)
	at java.lang.Thread.run(Thread.java:536)
Comment 1 Darin Wright CLA 2002-11-15 21:31:25 EST
Does this happen in your target workspace or the runtime Eclipse IDE?
If this is happenning in your target, you may just need to re-build the 
external tools jars. (i.e run the "buildExtraJAR" in the "scripts" folder of 
the external tools plug-in. This generates the jars you need at runtime from 
the development environment.
Comment 2 Darin Wright CLA 2002-11-15 21:31:53 EST
re-assigning as "new"
Comment 3 Matthew Conway CLA 2002-11-18 11:05:38 EST
Chalk this one up to user error - it was happening in my runtime workbench 
because I hadn't added/built ant.core to the workbench.

Strange thing was, even though I specifically told Window->Preferences->Plugin-
>Platfom to use the built in externaltools plugin, it still used the one in my 
workspace until I renamed the plugin.xml.  Is that desired behavior?  It did 
pop up a dialog warning me that it would use the one from the workbench, which 
I assumed meant the built in one.  If it really meant it would use the 
workspace one, then the dialog is confusing and should be re-worded.