ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42482] ant and subant improperly passes references to macrodefs and scriptdefs to the child script
Date Mon, 31 Jan 2011 12:45:13 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=42482

--- Comment #5 from rich@steelezone.net 2011-01-31 07:45:09 EST ---
(In reply to comment #4)
> Still trying to create a simple test case without any luck.  Can you give me
> some ideas of what could cause ScriptDefBase.getScript() to throw the "Script
> repository not found" exception?  That might help me narrow down a simple
> example.

OK, narrowed it down just a bit, but not enough to attach as a simple example. 
The antlib containing the macrodef and scriptdef is bundled in a jar file, from
which I can specify as the classpath in the taskdef.  This works fine in a
normal build, but it breaks when I run it from antunit with this stack trace:

C:\dev\projects\ant-shared-build\src\main\resources\com\example\ant\sharedbuild\antlib.xml:40:
Script repository not found for antlib:com.example.ant.sharedbuild:import
        at
org.apache.tools.ant.taskdefs.optional.script.ScriptDefBase.getScript(ScriptDefBase.java:58)
        at
org.apache.tools.ant.taskdefs.optional.script.ScriptDefBase.setDynamicAttribute(ScriptDefBase.java:92)
        at
org.apache.tools.ant.IntrospectionHelper.setAttribute(IntrospectionHelper.java:394)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:388)
        at
org.apache.tools.ant.RuntimeConfigurable.maybeConfigure(RuntimeConfigurable.java:344)
        at org.apache.tools.ant.Task.maybeConfigure(Task.java:202)
        at
org.apache.tools.ant.UnknownElement.configure(UnknownElement.java:196)
        at
org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163)
        at org.apache.tools.ant.Task.perform(Task.java:347)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at
org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:82)
        at
org.apache.ant.antunit.AntUnit.createProjectForFile(AntUnit.java:483)
        at org.apache.ant.antunit.AntUnit.doFile(AntUnit.java:231)
        at
org.apache.ant.antunit.AntUnit.doResourceCollection(AntUnit.java:216)
        at org.apache.ant.antunit.AntUnit.execute(AntUnit.java:187)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

However, if instead of using the jar file as the taskdef classpath I use an
exploded directory, then the tests run fine.

So, is there some interaction in classloading from a jar file and antlibs
containing macrodefs and scriptdefs?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Mime
View raw message