JBoss and Xalan problem ...

Discussion in 'Java' started by Elpecek, Nov 2, 2004.

  1. Elpecek

    Elpecek Guest

    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
     
    Elpecek, Nov 2, 2004
    #1
    1. Advertising

  2. Elpecek wrote:

    > 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
     
    John C. Bollinger, Nov 2, 2004
    #2
    1. Advertising

  3. Elpecek

    Elpecek Guest

    "John C. Bollinger" wrote in message
    > 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
     
    Elpecek, Nov 3, 2004
    #3
  4. Elpecek wrote:

    > "John C. Bollinger" wrote in message
    >
    >>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 :-(


    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
     
    John C. Bollinger, Nov 3, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. satish mn via JavaKB.com
    Replies:
    0
    Views:
    416
    satish mn via JavaKB.com
    Nov 25, 2004
  2. bigbinc
    Replies:
    0
    Views:
    437
    bigbinc
    Nov 11, 2003
  3. cvissy
    Replies:
    0
    Views:
    609
    cvissy
    Nov 16, 2004
  4. han
    Replies:
    0
    Views:
    481
  5. Jubz
    Replies:
    0
    Views:
    2,293
Loading...

Share This Page