JBoss and Xalan problem ...

E

Elpecek

Hello,
I'm developping web application with reporting capability. A report is
generated from XML through XSLT stylesheet. The XSLT file, which I
prepared, is correct and works fine in XML Spy and under JBoss on JDK
1.4.1.

But a few weeks ago we decided to change JDK to 1.4.2_06 and
everything collapsed.
I collected "prefix must resolve to a namespace:" exception.
After my personal investigation it appeared that Xalan included in
this version of JDK has a problem with xsl:number element (to be more
specific: it crashes when it finds xsl:number in the stylesheet).

I tried to replace Xalan through $JDK$/jre/lib/endorsed directory
mechanism, and it helped to my report, but JBOSS (3.1.5) started to
crash (it can't read it's own configuration files). I also tried to
put there (endorsed dir) older versions of Xalan, but it didn't bring
any positive effect.

Is there any other way to cope with this problem?

Thanks in advance,
Tomek
 
J

John C. Bollinger

Elpecek said:
Hello,
I'm developping web application with reporting capability. A report is
generated from XML through XSLT stylesheet. The XSLT file, which I
prepared, is correct and works fine in XML Spy and under JBoss on JDK
1.4.1.

But a few weeks ago we decided to change JDK to 1.4.2_06 and
everything collapsed.
I collected "prefix must resolve to a namespace:" exception.
After my personal investigation it appeared that Xalan included in
this version of JDK has a problem with xsl:number element (to be more
specific: it crashes when it finds xsl:number in the stylesheet).

I tried to replace Xalan through $JDK$/jre/lib/endorsed directory
mechanism, and it helped to my report, but JBOSS (3.1.5) started to
crash (it can't read it's own configuration files). I also tried to
put there (endorsed dir) older versions of Xalan, but it didn't bring
any positive effect.

Is there any other way to cope with this problem?

Have you considered fixing your broken stylesheet? It apparently does
not declare the "xsl" namespace prefix before using it. The fact that
some XML / XSLT systems may handle it without reporting an error does
not necessarily mean that it isn't, in fact, in error.

See section 2.1 of the XSLT 1.0 spec for more detail:

http://www.w3.org/TR/xslt#xslt-namespace

In particular, note that use of XML namespaces to recognize XSLT
elements is *mandatory*, and that use of "xsl" as a namespace prefix for
XSLT elements is only a common convention, not a part of the specification.


John Bollinger
(e-mail address removed)
 
E

Elpecek

Have you considered fixing your broken stylesheet? It apparently does
not declare the "xsl" namespace prefix before using it. The fact that
some XML / XSLT systems may handle it without reporting an error does
not necessarily mean that it isn't, in fact, in error.

This is the header from my stylesheet:
-----=8---------------

<?xml version="1.0" encoding="ISO-8859-2"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

-----=8---------------
The exception which I get concerns default namespace (without prefix).
Moreover, the stylesheet works under JDK 1.4.2 after removal of all
"xsl:number" commands. But it's not the solution :-(

I guess the point is to force JBoss to use different xalan instances
for every application context (loaded through different class
loaders). AFAIK JBoss uses flat loading model by default.
Unfortunately I'm total newbie in configuration topics....

Thanks,
Tomek
 
J

John C. Bollinger

Elpecek said:
in message



This is the header from my stylesheet:
-----=8---------------

<?xml version="1.0" encoding="ISO-8859-2"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

-----=8---------------
The exception which I get concerns default namespace (without prefix).
Moreover, the stylesheet works under JDK 1.4.2 after removal of all
"xsl:number" commands. But it's not the solution :-(

It seems I missed a bit on my earlier guess (sorry), but I'll stand by
my position that your stylesheet is more likely buggy than is any
particular Xalan or J2SDK release. If you want real help, though, then
you'll need to show some code. In this case, a complete XSLT document
that causes the problem you have observed would probably be a good
start. The full exception message and stack trace would be helpful too.
I guess the point is to force JBoss to use different xalan instances
for every application context (loaded through different class
loaders). AFAIK JBoss uses flat loading model by default.
Unfortunately I'm total newbie in configuration topics....

I reiterate: the solution is to fix the stylesheet. I require *much*
more evidence before I'll believe that the XSLT implementation in J2SDK
1.4.2_06 is buggy, but I have no trouble believing that it might be
*pickier* than the one in 1.4.1.


John Bollinger
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top