This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 34295 - Fix #28260 prevent Ant XSLT Extentions from working
Summary: Fix #28260 prevent Ant XSLT Extentions from working
Status: CLOSED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on: 20211 28260
Blocks:
  Show dependency tree
 
Reported: 2003-06-11 10:02 UTC by herkrath
Modified: 2008-12-23 08:36 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description herkrath 2003-06-11 10:02:09 UTC
I'm using the Ant-task xslt with Xalan custom
extentions (via <lxslt:component ... />). This
loads custom java-classes located in
<nbhome>/modules/patches/org-apache-tools-ant-module
and executes them from Xalan.
It works fine with NB 3.4, NB 3.4.1 and outside NB
(JDK 1.4.1_02). After installing NB 3.5 I got the
following Exception:

java.lang.NoClassDefFoundError:
org/apache/xalan/extensions/XSLProcessorContext
        at
java.lang.Class.getDeclaredMethods0(Native Method)
        at
java.lang.Class.privateGetDeclaredMethods(Class.java:1627)
        at
java.lang.Class.privateGetPublicMethods(Class.java:1655)
        at java.lang.Class.getMethods(Class.java:815)
        at
org.apache.xalan.extensions.MethodResolver.getElementMethod(MethodResolver.java:346)
        at
org.apache.xalan.extensions.ExtensionHandlerJavaClass.processElement(ExtensionHandlerJavaClass.java:396)
        at
org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:307)
        at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:423)
        at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:226)
        at
org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:423)
        at
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:226)
        at
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2182)
        at
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2008)
        at
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1171)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:638)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1088)
        at
org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1066)
        at
org.apache.tools.ant.taskdefs.optional.TraXLiaison.transform(TraXLiaison.java:188)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.process(XSLTProcess.java:506)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:220)
        at
org.apache.tools.ant.Task.perform(Task.java:319)
        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:1306)
        at
org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:371)
        at
org.apache.tools.ant.Task.perform(Task.java:319)
        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:1306)
        at
org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at
org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:331)
        at
org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:118)

After putting the xalan.jar from NB or directly
from apache.org to the
.../org-apache-tools-ant-module dir, it got even
more strange:
A NoSuchMethodExeption
<myMethod>(org.apache.xalan.extensions.XSLProcessorContext,
org.apache.xalan.templates.ElemExtensionCall).
I guess the VM compares the origins of the two
XSLProcessorContext classes (one from NB and one
from .../org-apache-tools-ant-module) and
declaring my method as different.

I agree that this is a very special case but I
think that similar problems could occur in many
other cases as well.

Thanks, Mark.
Comment 1 Jesse Glick 2003-06-26 21:57:06 UTC
Probably you will need to put such Xalan extensions into your JRE's
lib/ext directory (or perhaps NetBeans's classpath using -cp/a) since
they are intended to link against Xalan impl classes. Please try that
and reopen if it does not work.

A possible fix would be to unmask org/apache/xalan/extensions/ from
the portion of the JRE visible to modules. I am not sure this is a
great idea however.

Issue #20211 would provide a more general fix to this category of
problems, for example by loading Ant and any libraries marked by the
user as being part of it from a dedicated URLClassLoader unrelated to
the NetBeans module system.
Comment 2 herkrath 2003-06-27 10:25:25 UTC
Putting the extension to <jdkhome>/lib/ext worked.

Thanks, Mark.
Comment 3 Marian Mirilovic 2003-07-28 16:45:14 UTC
verifying, closing.