logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Issue with running target twice: msg#00004

java.ant.xmltask

Subject: Re: Issue with running target twice

No particular thoughts spring to mind. Can you forward me a minimal copy of the build.xml and log4j.xml that exhibits the problem so I can run here and look at what's happening ?

You should be able to do the copy/attr step in one <xmltask> invocation, using a buffer, btw (you can't do it using properties for reasons you'll have discovered already).

Once I get a copy of the files I can investigate further. Which Ant/JDK are you using, btw ?

Brian

Rob Moore wrote:
I'm trying to run 'ant build build' where build is a target that performs an xmltask modification of a file. The first time the target is invoked it performs fine. The second time it occurs it fails with an exception:

[xmltask] Applying AttrReplace(value=/home/rmoore/Development/workspace/foo/logs/foo.log, remove=no) to log4j:configuration/appender[@name='file']/param[@name='File']
[xmltask] javax.xml.transform.TransformerException: Prefix must resolve to a namespace: log4j
[xmltask] at com.sun.org.apache.xpath.internal.compiler.XPathParser.error(XPathParser.java:602)
[xmltask] at com.sun.org.apache.xpath.internal.compiler.Lexer.mapNSTokens(Lexer.java:638)
[xmltask] at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:265)
[xmltask] at com.sun.org.apache.xpath.internal.compiler.Lexer.tokenize(Lexer.java:96)
[xmltask] at com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(XPathParser.java:108)
[xmltask] at com.sun.org.apache.xpath.internal.XPath.<init>(XPath.java:162)
[xmltask] at com.sun.org.apache.xpath.internal.XPathAPI.eval(XPathAPI.java:233)
[xmltask] at com.sun.org.apache.xpath.internal.XPathAPI.eval(XPathAPI.java:190)
[xmltask] at com.oopsconsultancy.xmltask.jdk15.XPathAnalyser15.analyse(XPathAnalyser15.java:28)
[xmltask] at com.oopsconsultancy.xmltask.XmlReplace.apply(XmlReplace.java:67)
[xmltask] at com.oopsconsultancy.xmltask.XmlReplacement.apply(XmlReplacement.java:60)
[xmltask] at com.oopsconsultancy.xmltask.ant.XmlTask.processDoc(XmlTask.java:679)
[xmltask] at com.oopsconsultancy.xmltask.ant.XmlTask.execute(XmlTask.java:648)
[xmltask] at org.apache.tools.ant.Task.perform(Task.java:364)
[xmltask] at org.apache.tools.ant.Target.execute(Target.java:341)
[xmltask] at org.apache.tools.ant.Target.performTasks(Target.java:369)
[xmltask] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
[xmltask] at org.apache.tools.ant.Project.executeTarget(Project.java:1185) [xmltask] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
[xmltask] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
[xmltask] at org.apache.tools.ant.Main.runBuild(Main.java:668)
[xmltask] at org.apache.tools.ant.Main.startAnt(Main.java:187)
[xmltask] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
[xmltask] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
[xmltask] Indenting resultant document

The file that is being parse is a static file and is not modified by the task -- rather the source file is used to create the target file like so:

<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpathref="master-classpath"/>
<xmltask source="${src.dir}/log4j.xml">
<xmlcatalog refid="dtds"/>
<copy path="log4j:configuration/appender[@name='file']/param[@name='File']/@value" attrValue="true" property="log.path.relative"/>
</xmltask>
<xmltask source="${src.dir}/log4j.xml" dest="${build.dir}/log4j.xml" system="log4j.dtd">
<xmlcatalog refid="dtds"/>
<attr path="log4j:configuration/appender[@name='file']/param[@name='File']" attr="value" value="${basedir}/${log.path.relative}" />
</xmltask>

I cannot figure out why the second time it fails so I thought I'd ping the list to see if anybody has a clue.

Thanks,

Rob




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Xmltask-users mailing list
Xmltask-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@xxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xmltask-users

--
Brian Agnew http://www.oopsconsultancy.com
OOPS Consultancy Ltd brian @ oopsconsultancy.com
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation