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 33280 - Cannot do XSLT transformation of results when tests are run by IDE's ant module
Summary: Cannot do XSLT transformation of results when tests are run by IDE's ant module
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: xtest (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: issues@obsolete
URL:
Keywords: JDK_SPECIFIC
Depends on:
Blocks:
 
Reported: 2003-04-28 15:39 UTC by Jesse Glick
Modified: 2011-06-09 09:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Log of running xtest (34.12 KB, text/plain)
2003-04-28 15:41 UTC, Jesse Glick
Details
Stack trace transforming openidex/looks{aspect_33268} unit test results (9.27 KB, text/plain)
2003-04-28 15:59 UTC, Jesse Glick
Details
The exception trace. (31.77 KB, patch)
2003-05-13 15:40 UTC, Ondrej Rypacek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-04-28 15:39:22 UTC
I am using Ant 1.5.2 and JDK 1.4.2 beta.
Processing of stylesheets fails after tests are
run. See sample command log.

Only appears to be a problem when running tests in
a single module from the command line, not when
running xtest/instance/build.xml, but I am not
sure about that.

Same result using Ant 1.4. But it works with JDK
1.3, presumably since xtest's xalan.jar is used in
place of the JRE's.
Comment 1 Jesse Glick 2003-04-28 15:41:38 UTC
Created attachment 10177 [details]
Log of running xtest
Comment 2 Jesse Glick 2003-04-28 15:58:10 UTC
Got another, possibly unrelated, exception transforming results from a
different test suite (using JDK 1.3). Will attach.
Comment 3 Jesse Glick 2003-04-28 15:59:36 UTC
Created attachment 10178 [details]
Stack trace transforming openidex/looks{aspect_33268} unit test results
Comment 4 Martin Brehovsky 2003-04-29 11:17:40 UTC
Can you give me more information about the version of 1.4.2? The guys
are still making some changes to their xalan integration, so every
time we fix it (it was already fixed two times), the same bug will
appear with 1-2 months.

Also what version of XTeat are you using?
Comment 5 Jesse Glick 2003-04-29 12:45:35 UTC
1.4.2 b19, the general beta. They bundle Xalan 2.4.1.

XTest is from trunk sources; I think I updated them yesterday to be sure:

cd xtest
cvs up
ant clean
ant
Comment 6 Martin Brehovsky 2003-04-29 14:01:09 UTC
OK, I'm working on the issue.

Concerning the 1.3 problems - this is rather some bug in xalan itself.
The reason why it does not appear on 1.4 is that on 1.4 we use the
xalan bundled with 1.4 (which is a newer version). 

Anyway I don't think I'm able to do anything with the 1.3 problem (the
only thing I'm aware of is to upgrade Xalan to a newer version - which
is a long run thing (because of legal approvals and stuff)) - maybe I
could rather spend some time on making XTest able to use a different
version of JDK for runtime and testing time - this would let users use
let's say 1.4.0 for running xtest and 1.3.1 od 1.4.2 (1.5) for running
the tests in XTest - it is already filed as a bug #33234.
Comment 7 Jesse Glick 2003-04-29 18:50:01 UTC
I think you got it backwards - it works fine under JDK 1.3, but it
does not work under JDK 1.4.2.

ant -f java/test/build.xml -Dxtest.attribs=stable -Dxtest.testtype=unit

fails if java -version says 1.4.2 beta.

However 1.4.1 seems to work. So there is a problem with your code in
the *newer* Xalan (2.4.1), though it presumably works with the older
2.3 you bundle.
Comment 8 Martin Brehovsky 2003-04-30 15:19:25 UTC
The problem basically is, that when you have 2 different versions of
Xalan on classpath (the one from rt.jar and the one from xtest), they
collide in some settings, therefore the transformation is not
possible. I fixed the problem by removing xalan supplied by xtest from
classpath on JDK >= 1.4 and use xalan only from rt.jar.

Unfortunately the fix introduces a new problem - when tests are run
via IDE's Ant module, the transformation does not work (currently in
all JDKs). But since this this has a workaround (you can run the build
script via command line), I'm lowering priority to P3 and changin the
title, but I'll try to work on it more.
Comment 9 Jesse Glick 2003-05-09 19:43:12 UTC
Does not work on the command line using Ant 1.5.1 or later with JDK
1.4.2 beta.

file:/space/src/nb_all/xtest/lib/module_harness.xml:541:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerConfigurationException:
javax.xml.transform.TransformerException: org.xml.sax.SAXException:
javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.SAXParserFactoryImpl not found

with detail in e.g. openide_unit.log:

org.xml.sax.SAXException: javax.xml.parsers.FactoryConfigurationError:
Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
at
org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:947)
at
org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:788)
at
org.netbeans.xtest.util.XMLFactoryUtil.newTransformer(XMLFactoryUtil.java:103)

JAXP ought to just work out of the box under JDK 1.4 with no special
hacks; is there any architectural reason why XTest needs to be doing
all this? E.g. here setting the context class loader to a strange
value (namely, rt.jar's bootstrap loader) is breaking things.

I am currently unable to run XTest on trunk sources as part of
nbbuild/misc/full-build-linux.sh, which I consider a P1 problem. My
nbbuild/misc/build-site-local.sh includes:

# This is 1.4.1 with no $CLASSPATH libs.
ant=/space/src/nbextra/nbbuild/bin/ant
# Xalan etc. needed under JDK 1.3 to build Javadoc, sigh:
nbclasspath=/space/src/nb_all/libs/external/xalan-2.3.1.jar:/space/src/nb_all/core/external/xml-apis-1.0b2.jar:/space/src/nb_all/core/external/xerces-2.0.2.jar:/space/ant14/lib/optional.jar
# 1.3.1:
nbjdk=/space/jdk1.3
# 1.4.2 beta:
nbtestjdk=/space/jdk1.4
Comment 10 Martin Brehovsky 2003-05-12 10:48:59 UTC
Definitely not P1, because ant 1.5.1 is not officially supported by
build masters, so it is also not officially supported by XTest. Anyway
I'll look at it and try to fix it ASAP.

Also in the mean time, you can run XTest in another JDK (e.g. 1.4.1 or
1.3) and run tests in 1.4.2 by setting ant property jdkhome to you
1.4.2 home.
Comment 11 Jesse Glick 2003-05-12 14:50:09 UTC
One of the reasons buildmasters have been slow to adopt Ant 1.5.x is
that XTest reportedly has problems with it... anyway as I say, the
problem is reproducible using Ant 1.4.1, i.e. it is dependent only on
the XML tools present in the classpath, not on Ant per se.

JDK 1.3.1 does not work well on Linux with a nested X server in my
experience (I get bad opcodes which kill the ide-mode tests randomly)
so only JDK 1.4.1 really works at the moment.
Comment 12 Martin Brehovsky 2003-05-12 17:05:13 UTC
Jesse, can you give me some more information on XTest's problems with
1.5.1 and higher? I would like to know more about it, because AFAIK
XTest does not have any 1.5.1 or higher related issue in issuezilla
(well, I'm aware of only just this one), therefore I don't know about
any problems, hence I cannot fix them.

Anyway the jdkhome property should help you in the mean time, because
when set, both code as well as ide tests will be run in specified JVM
version.



Comment 13 Jesse Glick 2003-05-12 17:50:41 UTC
"Jesse, can you give me some more information on XTest's problems with
1.5.1 and higher?" - just what I heard. If you say it works OK with
e.g. Ant 1.5.3, then fine.

I will not bother with jdkhome for now since we are about to require
JDK 1.4 anyway, and it is probably enough to use 1.4.1 throughout,
until this problem is fixed.
Comment 14 Martin Brehovsky 2003-05-12 18:10:03 UTC
OK, I'll spend more time with this tomorrow. The reason why the
xerces/xalan libraries are loaded via this strange way is mostly a
historical one. I inherited NbMultiTaskDef from previous owners of
XTest and instead of major change in the way how xtest's classes are
loaded I just made some nasty fixes to get it working in all supported
JDK versions as well as to be able to run xtest's scripts via command
line or in IDE, so it is more than clear it needs a major revision.
Also I would like to get rid of xerces dependency (now I depend on
xerces's ability to write DOM to file in a nice text format), so in
the end XTest will not contain neither xerces nor xalan.

Comment 15 Martin Brehovsky 2003-05-13 12:03:28 UTC
I have a viable solution, which will allow me to close this bug
completely. The only drawback with it is, that it runs only on JDK 1.4
and higher. So I posted a message about dropping support for 1.3 in
XTest to nbdev and if nobody will object against it, XTest will switch
to 1.4 and and this bug will be fixed.
Comment 16 Ondrej Rypacek 2003-05-13 15:39:51 UTC
I have another exception that appears after the test are finished. 
I'm attaching the trace.

I downloaded xtest from CVS and tried the MyModule example - from
command line. It also fails on my own module, or web (didn't test
anything more).
I use JDK 1.4.1, ANT 1.5.2.
Comment 17 Ondrej Rypacek 2003-05-13 15:40:32 UTC
Created attachment 10284 [details]
The exception trace.
Comment 18 Martin Brehovsky 2003-05-13 15:43:41 UTC
Which is exactly the same excetption as described by Jesse in comment
from 2003-05-09 11:43 PDT. And the same solution applies to it. Use
Ant 1.4.1 as buildmasters do.
Comment 19 Martin Brehovsky 2003-05-15 10:10:22 UTC
This issue is now fixed. XTest has dropped support for 1.3, so I could
remove xalan from it and I now exclusively use xalan from rt.jar. I
tested it on JDKs 1.4.0, 1.4.1, 1.4.2 and on Ants 1.4 and 1.5.1.
Comment 20 Marian Mirilovic 2011-06-09 09:51:09 UTC
v/c