You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by JD Daniels <jd...@datatrio.com> on 2004/09/26 07:05:04 UTC

[Fwd: Help I can't get xpatch to work :(]

I can't seem to get the xpatch to work for me :(
When I call the target from the command line, I do not get any errors, 
but calling it with antfarm inside jedit  spits:

Class javax.xml.transform.TransformerFactory loaded from parent loader
BUILD FAILED

java.lang.ExceptionInInitializerError

   at XConfToolTask.execute(Unknown Source)

   at org.apache.tools.ant.Task.perform(Task.java:341)

   at org.apache.tools.ant.Target.execute(Target.java:309)

   at org.apache.tools.ant.Target.performTasks(Target.java:336)

   at org.apache.tools.ant.Project.executeTarget(Project.java:1339)

   at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:397)

   at org.apache.tools.ant.Task.perform(Task.java:341)

   at org.apache.tools.ant.Target.execute(Target.java:309)

   at org.apache.tools.ant.Target.performTasks(Target.java:336)

   at org.apache.tools.ant.Project.executeTarget(Project.java:1339)

   at antfarm.TargetRunner.runAntTarget(Unknown Source)

   at antfarm.TargetRunner.run(Unknown Source)

Caused by: java.lang.ClassCastException

   at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)

   at DocumentCache.<clinit>(Unknown Source)

   ... 12 more

I am adding the task to my own project in my build file with:
<taskdef name="xpatch" classname="XConfToolTask" 
classpath="${cocoon.dev.dir}/tools/anttasks"/>

here is my patch file:
<?xml version="1.0"?>
<xconf xpath="cocoon">
   <component role="com.blah.PersistenceFactory" 
class="com.blah.HibernateFactory"/>
</xconf>

This is what ant spits out at debug level on the command line:

Class org.apache.tools.ant.types.XMLCatalog loaded from parent loader 
(parentFirst)
Class java.io.File loaded from parent loader (parentFirst)
Class java.lang.Boolean loaded from parent loader (parentFirst)
Finding class DocumentCache
Loaded from D:\cocoon-2.1.5.1\tools\anttasks DocumentCache.class
Class DocumentCache loaded from ant loader (parentFirst)
Class javax.xml.transform.Source loaded from parent loader (parentFirst)
Class javax.xml.transform.Result loaded from parent loader (parentFirst)
Class java.lang.Exception loaded from parent loader (parentFirst)
Class java.io.Reader loaded from parent loader (parentFirst)
Class java.io.StringReader loaded from parent loader (parentFirst)
Class javax.xml.parsers.ParserConfigurationException loaded from parent 
loader (parentFirst)
Class java.util.Map loaded from parent loader (parentFirst)
Class java.util.HashMap loaded from parent loader (parentFirst)
Class javax.xml.parsers.DocumentBuilderFactory loaded from parent loader 
(parentFirst)
Class javax.xml.transform.TransformerFactory loaded from parent loader 
(parentFirst)
Class java.net.URL loaded from parent loader (parentFirst)
Class java.lang.StringBuffer loaded from parent loader (parentFirst)
  [xpatch] Reading: file:/E:/blah/build/ROOT/WEB-INF/cocoon.xconf
Class javax.xml.parsers.DocumentBuilder loaded from parent loader 
(parentFirst)
Could not load a dependent class 
(com/sun/media/jai/codec/FileSeekableStream) for type image
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type sshexec
Could not load a dependent class (com/jcraft/jsch/UserInfo) for type scp
Could not load class (org.apache.tools.ant.tasksdefs.cvslib.CvsVersion) 
for type cvsversion
Could not load a dependent class (jdepend/xmlui/JDepend) for type jdepend
Could not load a dependent class (junit/framework/Test) for type junit
fileset: Setup scanner in dir E:\blah with patternSet{ includes: 
[E:/blah/conf/blah.xconf] excludes: [] }
Class org.apache.tools.ant.DirectoryScanner loaded from parent loader 
(parentFirst)
Class java.util.ArrayList loaded from parent loader (parentFirst)
  [xpatch] No Changes: E:\blah\build\ROOT\WEB-INF\cocoon.xconf
  [xpatch] Storing file in cache: E:\blah\build\ROOT\WEB-INF\cocoon.xconf
     [ant] Exiting E:\blah\build.xml.

BUILD SUCCESSFUL

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org





Re: [Fwd: Help I can't get xpatch to work :(]

Posted by JD Daniels <jd...@datatrio.com>.
oddly enough, digging through the wiki and copy/pasting samples got it 
to work (although I do not understand why)

I changed my buildfile to this:

    <target name="patch">
        <echo>Patching ${cocoon.patch.target} ...</echo>
        <xpatch file="${cocoon.patch.target}" 
srcdir="${project.patch.dir}/conf" includes="**/*.${patch.src-extension}"/>
    </target>

    <target name="conf" depends="dist">
        <antcall target="patch">
            <param name="cocoon.patch.target" 
value="${site.build.dir}/ROOT/WEB-INF/cocoon.xconf" />
            <param name="patch.src-extension" value="xconf" />
        </antcall>
    </target>

Before on the commandline, it would not throw an error, but niether 
would it patch the file
Ant farm inside jedit still throws the classcast exception

I'm very confused :/

Geoff Howard wrote:

>Besides not reporting an error, does running from the command line
>actually work as expected?  Either way, I'd guess this has to do with
>"endorsed libs" and outdated/mismatched versions of the xml libraries.
> I don't know enough of the ant/jEdit plugin or the mechanics of jEdit
>classloading to help you track it down but that's the first place I'd
>look.
>
>Geoff
>
>On Sat, 25 Sep 2004 21:05:04 -0800, JD Daniels <jd...@datatrio.com> wrote:
>  
>
>>I can't seem to get the xpatch to work for me :(
>>When I call the target from the command line, I do not get any errors,
>>but calling it with antfarm inside jedit  spits:
>>
>>Class javax.xml.transform.TransformerFactory loaded from parent loader
>>BUILD FAILED
>>
>>java.lang.ExceptionInInitializerError
>>
>>  at XConfToolTask.execute(Unknown Source)
>>    
>>
>
>...
> 
>  
>
>>Caused by: java.lang.ClassCastException
>>
>>  at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
>>
>>  at DocumentCache.<clinit>(Unknown Source)
>>    
>>
>
>...
>
>  
>
>>I am adding the task to my own project in my build file with:
>><taskdef name="xpatch" classname="XConfToolTask"
>>classpath="${cocoon.dev.dir}/tools/anttasks"/>
>>
>>here is my patch file:
>><?xml version="1.0"?>
>><xconf xpath="cocoon">
>>  <component role="com.blah.PersistenceFactory"
>>class="com.blah.HibernateFactory"/>
>></xconf>
>>
>>This is what ant spits out at debug level on the command line:
>>
>>Class org.apache.tools.ant.types.XMLCatalog loaded from parent loader
>>(parentFirst)
>>    
>>
>
>
>  
>


Re: [Fwd: Help I can't get xpatch to work :(]

Posted by Geoff Howard <ge...@gmail.com>.
Besides not reporting an error, does running from the command line
actually work as expected?  Either way, I'd guess this has to do with
"endorsed libs" and outdated/mismatched versions of the xml libraries.
 I don't know enough of the ant/jEdit plugin or the mechanics of jEdit
classloading to help you track it down but that's the first place I'd
look.

Geoff

On Sat, 25 Sep 2004 21:05:04 -0800, JD Daniels <jd...@datatrio.com> wrote:
> 
> I can't seem to get the xpatch to work for me :(
> When I call the target from the command line, I do not get any errors,
> but calling it with antfarm inside jedit  spits:
> 
> Class javax.xml.transform.TransformerFactory loaded from parent loader
> BUILD FAILED
> 
> java.lang.ExceptionInInitializerError
> 
>   at XConfToolTask.execute(Unknown Source)

...
 
> Caused by: java.lang.ClassCastException
> 
>   at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
> 
>   at DocumentCache.<clinit>(Unknown Source)

...

> I am adding the task to my own project in my build file with:
> <taskdef name="xpatch" classname="XConfToolTask"
> classpath="${cocoon.dev.dir}/tools/anttasks"/>
> 
> here is my patch file:
> <?xml version="1.0"?>
> <xconf xpath="cocoon">
>   <component role="com.blah.PersistenceFactory"
> class="com.blah.HibernateFactory"/>
> </xconf>
> 
> This is what ant spits out at debug level on the command line:
> 
> Class org.apache.tools.ant.types.XMLCatalog loaded from parent loader
> (parentFirst)