Bug 3934 - the classpath of style task not used
Summary: the classpath of style task not used
Status: RESOLVED DUPLICATE of bug 6606
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.4
Hardware: PC All
: P3 minor with 1 vote (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-02 22:22 UTC by Mike Fagan
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Fagan 2001-10-02 22:22:50 UTC
<style> does not appear to use the classpath attribute for locating
xalan classes. 

my ant tag:
  <target name="trans-source" depends="init">
    <style basedir="${src.dir}/msg"
           in="${src.dir}/msg/request/LoginRequest.xml" 
           out="${src.dir}/com/converging/Beans/LoginRequestBean.java"
           style="${src.dir}/msg/msgBean.xsl"
           processor="xalan">
	<classpath>
	  <pathelement location="lib/xalan.jar" /> 
	  <pathelement location="lib/xerces.jar" />
	  <pathelement location="lib/xalanj1compat.jar" />
	  <pathelement location="src/msg" />
        </classpath>
    </style>

######my output:
trans-source:
Class org.apache.tools.ant.taskdefs.optional.XalanLiaison loaded from parent loa
der

BUILD FAILED

java.lang.NoClassDefFoundError: org/apache/xalan/xslt/XSLTProcessorFactory
        at org.apache.tools.ant.taskdefs.optional.XalanLiaison.<init>(XalanLiais
on.java:82)
        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:237)
        at org.apache.tools.ant.taskdefs.XSLTProcess.resolveProcessor(XSLTProces
s.java:278)
        at org.apache.tools.ant.taskdefs.XSLTProcess.getLiaison(XSLTProcess.java
:394)
        at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:14
1)
        at org.apache.tools.ant.Task.perform(Task.java:217)
        at org.apache.tools.ant.Target.execute(Target.java:164)
        at org.apache.tools.ant.Target.performTasks(Target.java:182)
        at org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at org.apache.tools.ant.Main.runBuild(Main.java:454)
        at org.apache.tools.ant.Main.start(Main.java:153)
        at org.apache.tools.ant.Main.main(Main.java:176)

Total time: 4 seconds
org/apache/xalan/xslt/XSLTProcessorFactory

#####But from the same directory:

javap -classpath lib\xalanj1compat.jar 
org.apache.xalan.xslt.XSLTProcessorFactory
Compiled from XSLTProcessorFactory.java
public class org.apache.xalan.xslt.XSLTProcessorFactory extends java.lang.Object
 {
    public org.apache.xalan.xslt.XSLTProcessorFactory();
    public static org.apache.xalan.xslt.XSLTProcessor getProcessor() throws org.
xml.sax.SAXException;
    public static org.apache.xalan.xslt.XSLTProcessor getProcessor(org.apache.xa
lan.xpath.xml.XMLParserLiaison);
    public static org.apache.xalan.xslt.XSLTProcessor getProcessor(org.apache.xa
lan.xpath.xml.XMLParserLiaison, org.apache.xpath.XPathFactory);
    public static org.apache.xalan.xslt.XSLTProcessor getProcessorUsingLiaisonNa
me(java.lang.String) throws org.xml.sax.SAXException;
}
Comment 1 Stefan Bodewig 2001-10-19 01:04:09 UTC
The problem is that optional.jar is in the system classpath, thus XalanLiaison
will be loaded from the system classloader, which doesn't know anything about
the classpath you have specified.

The only solution for you is to remove optional.jar from ANT_HOME/lib and add
an entry for it to the classpath of your <style> task.

I'm afraid this cannot be fixed (at least not in the context of Ant 1.x).
Comment 2 Stefan Bodewig 2002-02-21 10:35:44 UTC
reopen to mark as duplicate of new META BUG
Comment 3 Stefan Bodewig 2002-02-21 10:36:12 UTC

*** This bug has been marked as a duplicate of 6606 ***