This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Xalan Errors and Classpaths


I saw many similar issues trying to get chunking to work with Xalan -- I
believe a bug was finally submitted to the Xalan folks, but I finally just
switched to Saxon.  As far as your second question, JDK 1.4 comes bundled
with Xalan -- if you want to change the Xalan version used, you will need to
use the "Endorsed Standards Override Mechanism", which involves copying the
appropriate jar files into the jre/lib/endorsed directory.  This basically
does for the bootclasspath what the jre/lib/ext directory does for your
"normal" classpath.  See the following for more detailed explanation:

http://xml.apache.org/~edwingo/jaxp-faq.html#JDK14

http://xml.apache.org/~edwingo/jaxp-faq.html#override

Eric

-----Original Message-----
From: David Molloy [mailto:molloyda@eeng.dcu.ie]
Sent: Friday, July 05, 2002 1:08 PM
To: docbook-apps@lists.oasis-open.org
Subject: DOCBOOK-APPS: Xalan Errors and Classpaths


Hi,
   I started this post on the primary docbook list and after a few
correspondences with Bob Stayton he recommended that I move it to this list.
Put simply I'm trying to use Xalan/Docbook to publish notes.  I can use it
with docbook.xsl and it works perfectly generating up one large html file.
However I wish to use chunk.xsl but I get the following error:

D:\Java\jdk1.3.1\bin\java -cp
D:\Masters\docbook\xalan\bin\xalan.jar;D:\Masters\docbook\xalan\bin\xercesIm
pl.jar;D:\Masters\docbook\xalan\bin\runtime.jar;D:\Masters\docbook\xalan\bin
\xsltc.jar;D:\Masters\docbook\xalan\bin\xml-apis.jar
org.apache.xalan.xslt.Process -IN D:\EE557\notes\EE557.xml -XSL
D:\Masters\docbook\dbookxsl\html\chunk.xsl -OUT D:\EE557\notes\index.html

(Location of error unknown)XSLT Error
(javax.xml.transform.TransformerConfigurationException):
 java.xml.transform.TransformerException:
java.lang.ArrayIndexOutOfBoundsException

Note: if I was to swap chunk.xsl with docbook.xsl it would work fine!

I have printed an environment check below and also a copy of the previous
thread with Bob.
Would anyone have any suggestions as to what could be causing the troubles
please?  Anything at all would be great!

As a bonus question, as I've been trying to solve these problems I was
previously using jdk1.4.01 and I discovered that regardless of what I
provided as my classpath it seemed to be using a mystical Java 2.2.D11,
which it seemed to get from nowhere!
Does Java 1.4 have a built in older version of Xalan and does it
automatically override your classpath settings?  The only way I could get
the environment check to pick up 2.4D1 was to explicitly use jdk1.3.1
instead of 1.4.  I'm puzzled about this one too.

Anyway, thanks in advance for any help you might have!

Kind regards,
David Molloy


----- BEGIN ENVIRONMENT CHECK -------

D:\EE557\notes>D:\Java\jdk1.3.1\bin\java -cp
D:\Masters\docbook\xalan\bin\xalan.jar;D:\Masters\docbook\xalan\bin\xercesIm
pl.jar;D:\Masters\docbook\xalan\bin\runtime.jar;D:\Masters\docbook\xalan\bin
\xsltc.jar;D:\Masters\docbook\xalan\bin\xml-apis.jar
org.apache.xalan.xslt.EnvironmentCheck
#---- BEGIN writeEnvironmentReport($Revision: 1.12 $): Useful stuff
found: ----
version.DOM.draftlevel=2.0fd
java.class.path=D:\Masters\docbook\xalan\bin\xalan.jar;D:\Masters\docbook\xa
lan\bin\xercesImpl.jar;D:\Masters\docbook\xalan\bin\runtime.jar;D:\Masters\d
ocbook\xalan\bin\xsltc.jar;D:\Masters\docbook\xalan\bin\xml-apis.jar
version.JAXP=1.1
java.ext.dirs=D:\Java\jdk1.3.1\jre\lib\ext
version.xerces2=Xerces-J 2.0.1
version.xerces1=not-present
version.xalan2_2=Xalan Java 2.4.D1
version.xalan1=not-present
version.ant=not-present
java.version=1.3.1_03
version.DOM=2.0
version.crimson=not-present
sun.boot.class.path=D:\Java\jdk1.3.1\jre\lib\rt.jar;D:\Java\jdk1.3.1\jre\lib
\i18n.jar;D:\Java\jdk1.3.1\jre\lib\sunrsasign.jar;D:\Java\jdk1.3.1\jre\class
es
#---- BEGIN Listing XML-related jars in: foundclasses.java.class.path ----
xalan.jar-apparent.version=xalan.jar WARNING.present-unknown-version
xalan.jar-path=D:\Masters\docbook\xalan\bin\xalan.jar
xercesImpl.jar-apparent.version=xercesImpl.jar from xalan-j_2_4_D1 from
xerces-2_0_1
xercesImpl.jar-path=D:\Masters\docbook\xalan\bin\xercesImpl.jar
xsltc.jar-apparent.version=xsltc.jar from xalan-j_2_4_D1
xsltc.jar-path=D:\Masters\docbook\xalan\bin\xsltc.jar
xml-apis.jar-apparent.version=xml-apis.jar from xalan-j_2_3_0,2_4_D1 from
xml-commons-1.0.b2
xml-apis.jar-path=D:\Masters\docbook\xalan\bin\xml-apis.jar
#----- END Listing XML-related jars in: foundclasses.java.class.path -----
version.SAX=2.0
version.xalan2x=Xalan Java 2.4.D1
#----- END writeEnvironmentReport: Useful properties found: -----
# YAHOO! Your environment seems to be OK.



---------- BEGIN PREVIOUS THREAD ARCHIVE - READ FROM BOTTOM -------

I think you had better post this one to DOCBOOK-APPS (not
to DOCBOOK, which is for DTD questions).  It does indeed
sound like Xalan is bundled with JDK 1.4. I think this is very strange.
It will make using Xalan more complicated.

bobs

On Fri, Jul 05, 2002 at 05:25:39PM +0100, David Molloy wrote:
> Hi Bob,
>    This is a strange one - I was just about to write back to you
> on this one.  I started using jdk1.3.1 instead so I used the
> command line: ( I got really verbose doing this!)
>
> D:\Java\jdk1.3.1\bin\java -cp
>
D:\Masters\docbook\xalan\bin\xalan.jar;D:\Masters\docbook\xalan\bin\xercesIm
>
pl.jar;D:\Masters\docbook\xalan\bin\runtime.jar;D:\Masters\docbook\xalan\bin
> \xsltc.jar;D:\Masters\docbook\xalan\bin\xml-apis.jar
> org.apache.xalan.xslt.EnvironmentCheck
>
> Now I get back the following:
>
> #---- BEGIN writeEnvironmentReport($Revision: 1.12 $): Useful stuff
> found: ----
> version.DOM.draftlevel=2.0fd
>
java.class.path=D:\Masters\docbook\xalan\bin\xalan.jar;D:\Masters\docbook\xa
>
lan\bin\xercesImpl.jar;D:\Masters\docbook\xalan\bin\runtime.jar;D:\Masters\d
> ocbook\xalan\bin\xsltc.jar;D:\Masters\docbook\xalan\bin\xml-apis.jar
> version.JAXP=1.1
> java.ext.dirs=D:\Java\jdk1.3.1\jre\lib\ext
> version.xerces2=Xerces-J 2.0.1
> version.xerces1=not-present
> version.xalan2_2=Xalan Java 2.4.D1
> version.xalan1=not-present
> version.ant=not-present
> java.version=1.3.1_03
> version.DOM=2.0
> version.crimson=not-present
>
sun.boot.class.path=D:\Java\jdk1.3.1\jre\lib\rt.jar;D:\Java\jdk1.3.1\jre\lib
>
\i18n.jar;D:\Java\jdk1.3.1\jre\lib\sunrsasign.jar;D:\Java\jdk1.3.1\jre\class
> es
> #---- BEGIN Listing XML-related jars in: foundclasses.java.class.path ----
> xalan.jar-apparent.version=xalan.jar WARNING.present-unknown-version
> xalan.jar-path=D:\Masters\docbook\xalan\bin\xalan.jar
> xercesImpl.jar-apparent.version=xercesImpl.jar from xalan-j_2_4_D1 from
> xerces-2_0_1
> xercesImpl.jar-path=D:\Masters\docbook\xalan\bin\xercesImpl.jar
> xsltc.jar-apparent.version=xsltc.jar from xalan-j_2_4_D1
> xsltc.jar-path=D:\Masters\docbook\xalan\bin\xsltc.jar
> xml-apis.jar-apparent.version=xml-apis.jar from xalan-j_2_3_0,2_4_D1 from
> xml-commons-1.0.b2
> xml-apis.jar-path=D:\Masters\docbook\xalan\bin\xml-apis.jar
> #----- END Listing XML-related jars in: foundclasses.java.class.path -----
> version.SAX=2.0
> version.xalan2x=Xalan Java 2.4.D1
> #----- END writeEnvironmentReport: Useful properties found: -----
> # YAHOO! Your environment seems to be OK.
>
>
> Pretty bizzare eh!  It seems to be finding the correct Xalan now!  Indeed
if
> I don't include
> the xalan.jar (the one I download... ie. 2.4.D1) then I get a
> ClassNotFoundException for
> org.apache.xalan.xsltc.EnvironmentCheck!  So it seems to me as though
jdk1.4
> is using a
> bundled version which isn't getting overridden by the classpath settings!!
> ARGH!
>
> I got pretty excited when I saw the Xalan Java 2.4.D1 and I tried to run
> Xalan on my
> xml file using:
> D:\Java\jdk1.3.1\bin\java -cp
>
D:\Masters\docbook\xalan\bin\xalan.jar;D:\Masters\docbook\xalan\bin\xercesIm
>
pl.jar;D:\Masters\docbook\xalan\bin\runtime.jar;D:\Masters\docbook\xalan\bin
> \xsltc.jar;D:\Masters\docbook\xalan\bin\xml-apis.jar
> org.apache.xalan.xslt.Process -IN D:\EE557\notes\EE557.xml -XSL
> D:\Masters\docbook\dbookxsl\html\chunk.xsl -OUT D:\EE557\notes\index.html
>
> However, now using the latest Xalan I still get:
> (Location of error unknown)XSLT Error
> (javax.xml.transform.TransformerConfigurationException):
> java.xml.transform.TransformerException:
> java.lang.ArrayIndexOutOfBoundsException
>
> Would you have any other suggestions on what might be going wrong here or
> some direction
> to head towards finding it out!?
>
> Thanks again for your quick responses!
>
> Dave
>
>
>
> -----Original Message-----
> From: bobs@caldera.com [mailto:bobs@caldera.com]
> Sent: 05 July 2002 17:09
> To: molloyda@eeng.dcu.ie
> Subject: Re: DOCBOOK: docbook.xsl VS chunk.xsl (xalan problems!)
>
>
> Well, I guess Xalan has a stuck version number.
> I just ran the Environment check on a system that has
> only ever had Xalan 2.4D1 and no earlier version, and it
> reports:
> version.xalan2=Xalan;Java;Xalan Java 2.2.D11;
>
> bobs
>
> On Fri, Jul 05, 2002 at 03:46:33PM +0100, David Molloy wrote:
> > Hi Bob,
> >    I managed to find some more time to work on this today - thanks
> > again for your help.  I have one quickie question I've been trying
> > to sort out:
> >
> > I brought down a new version of Xalan 2.4D1 and replaced the old
> > one.  But it's only now that I'm realising that regardless of what
> > classpath setting I set it seems to just find a 2.2D11 version.
> > I have done a search for xalan.jar and there are no other ones
> > in the classpath.  If I completely rename/remove from classpath
> > the Xalans I downloaded I get the following slightly different
> > output for the Environment check:
> >
> > #---- BEGIN writeEnvironmentReport($Revision: 1.7 $): Useful properties
> > found: ----
> > java.version=1.4.0_01
> > #---- BEGIN Listing XML-related jars in:
foundclasses.java.class.path ----
> > xalan.jar-apparent.version=not-present
> > xalan.jar-path=WARNING. Classpath entry: bin/xalan.jar does not exist
> > xsltc.jar-apparent.version=not-present
> > xsltc.jar-path=WARNING. Classpath entry: bin/xsltc.jar does not exist
> > #----- END Listing XML-related jars in:
foundclasses.java.class.path -----
> > version.JAXP=1.1
> > java.ext.dirs=C:\Program Files\Java\j2re1.4.0_01\lib\ext
> > version.crimson=not-present
> > version.SAX=2.0
> >
>
java.class.path=bin/xalan.jar;bin/xercesImpl.jar;bin/runtime.jar;bin/xsltc.j
> > ar;bin/xml-apis.jar
> > version.xerces=not-present
> > sun.boot.class.path=C:\Program
> Files\Java\j2re1.4.0_01\lib\rt.jar;C:\Program
> > Files\Java\j2re1.4.0_01\lib\i18n.jar;C:\Program
> > Files\Java\j2re1.4.0_01\lib\sunrsasign.jar;C:\Program
> > Files\Java\j2re1.4.0_01\lib\jsse.jar;C:\Program
> > Files\Java\j2re1.4.0_01\lib\jce.jar;C:\Program
> > Files\Java\j2re1.4.0_01\lib\charsets.jar;C:\Program
> > Files\Java\j2re1.4.0_01\classes
> > version.DOM.draftlevel=2.0fd
> > version.xalan2=Xalan;Java;Xalan Java 2.2.D11;
> > version.DOM=2.0
> > version.xalan1=not-present
> > #----- END writeEnvironmentReport: Useful properties found: -----
> > # YAHOO! Your environment seems to be OK.
> >
> >
> >
> > You can see here that it's not finding xalan.jar anymore but it is still
> > coming up
> > with a version of xalan2.  So basically my question is:
> > - Is this a version from the jre that is being found and run?
> > - How do I override this if note with command line classpath config?
> >
> > Sorry about my beginner questions - I find a lot of this still quite
> > confusing!
> >
> > Thanks,
> > Dave
> >
> >
> >
> > -----Original Message-----
> > From: bobs@caldera.com [mailto:bobs@caldera.com]
> > Sent: 04 July 2002 19:30
> > To: molloyda@eeng.dcu.ie
> > Subject: Re: DOCBOOK: docbook.xsl VS chunk.xsl (xalan problems!)
> >
> >
> > On Thu, Jul 04, 2002 at 07:01:41PM +0100, David Molloy wrote:
> > > Hi Bob,
> > >    Thanks for the quick response - Here is the output from:
> > > java org.apache.xalan.xslt.EnvironmentCheck [-out outFile]
> > >
> > > #---- BEGIN writeEnvironmentReport($Revision: 1.7 $): Useful
properties
> > > found: ----
> > > java.version=1.4.0_01
> > > version.JAXP=1.1
> > > java.ext.dirs=C:\Program Files\Java\j2re1.4.0_01\lib\ext
> > > version.crimson=not-present
> > > version.SAX=2.0
> > > java.class.path=.
> > > version.xerces=not-present
> > > sun.boot.class.path=C:\Program
> > Files\Java\j2re1.4.0_01\lib\rt.jar;C:\Program
> > > Files\Java\j2re1.4.0_01\lib\i18n.jar;C:\Program
> > > Files\Java\j2re1.4.0_01\lib\sunrsasign.jar;C:\Program
> > > Files\Java\j2re1.4.0_01\lib\jsse.jar;C:\Program
> > > Files\Java\j2re1.4.0_01\lib\jce.jar;C:\Program
> > > Files\Java\j2re1.4.0_01\lib\charsets.jar;C:\Program
> > > Files\Java\j2re1.4.0_01\classes
> > > version.DOM.draftlevel=2.0fd
> > > version.xalan2=Xalan;Java;Xalan Java 2.2.D11;
> > > version.DOM=2.0
> > > version.xalan1=not-present
> > > #----- END writeEnvironmentReport: Useful properties found: -----
> > > # YAHOO! Your environment seems to be OK.
> > >
> > > Also I read somewhere in the documentation that in order to use XSLT
> > > extensions you need
> > > to use bsf.jar   - is this needed or do you think it just has to do
with
> > > versions of
> > > Xalan?
> > >
> > > Thanks again for your help,
> > > David
> > >
> >
> > So it looks like you are using XalanJ 2.2D11.
> > I think it is probably a version problem, as some Xalan
> > versions were not working completely with DocBook XSL.
> >
> > I tried Xalan 2.4D1 with and
> > without bsf.jar and it worked for chunking.
> > The bsf.jar file (Bean Scripting Framework) is used to
> > support XSLT extensions written in languages other than
> > Java.  Since Norm wrote his DocBook extensions for xalan
> > in Java, you don't need bsf.jar for DocBook.
> >
> > But since you are turning on the 'xalan.extensions' parameter,
> > you will want to add the 'extensions/xalan2.jar' file from
> > the DocBook XSL distribution to your CLASSPATH.
> > Otherwise the extension functions won't be found.
> >
> > --
> >
> > Bob Stayton                                 400 Encinal Street
> > Publications Architect                      Santa Cruz, CA  95060
> > Technical Publications                      voice: (831) 427-7796
> > Caldera International, Inc.                 fax:   (831) 429-1887
> >                                             email: bobs@caldera.com
> >
> > > -----Original Message-----
> > >
> > > On Thu, Jul 04, 2002 at 05:53:24PM +0100, David Molloy wrote:
> > > > Hi,
> > > >    I've been using docbook lately for writing some notes and
> > > > I really want to get them into multiple files rather than one
> > > > single cumbersome file.  Anyway, I tried using chunk.xsl
> > > > instead of docbook.xsl (which was working fine!) by entering
> > > > the xalan directory and typing:
> > > >
> > > > java -cp
> > > >
> > >
> >
>
bin/xalan.jar;bin/xercesImpl.jar;bin/runtime.jar;bin/xsltc.jar;bin/xml-apis.
> > > > jar org.apache.xalan.xslt.Process -IN
D:\EE557\notes\EE557.xml -PARAM
> > > > xalan.extensions 1 -XSL ../dbookxsl/html/chunk.xsl -OUT
> > > > D:\EE557\notes\index.html
> > > >
> > > > However, using chunk.xsl I now get back:
> > > > (Location of error unknown)XSLT Error
> > > > (javax.xml.transform.TransformerConfigurationException):
> > > > java.xml.transform.TransformerException:
> > > > java.lang.ArrayIndexOutOfBoundsException
> > > >
> > > > Could anyone please clarify to me what is going on please?  And if
> > > possible
> > > > a suggestion as to how to fix it please!
> > > > Thanks in advance,
> > > >
> > > > David Molloy
> > > >
> > > >
> > > > More details:
> > > > JDK - tried jdk1.4.0, jdk1.3.1, jdk1.2.2 - identical problem for
each
> > > > Xalan_Java 2
> > > > Windows 2k
> > >
> > > What specific version of XalanJ 2 are you using?
> > > I just ran XalanJ 2.4D1 (latest) with java 1.4.0_01
> > > on Windows XP with your CLASSPATH using
> > > the DocBook 1.51.1 chunk.xsl, and
> > > it worked ok.
> > >
> > > --
> > >
> > > Bob Stayton                                 400 Encinal Street
> > > Publications Architect                      Santa Cruz, CA  95060
> > > Technical Publications                      voice: (831) 427-7796
> > > Caldera International, Inc.                 fax:   (831) 429-1887
> > >                                             email: bobs@caldera.com
> > >
> >
>
> --
>
> Bob Stayton                                 400 Encinal Street
> Publications Architect                      Santa Cruz, CA  95060
> Technical Publications                      voice: (831) 427-7796
> Caldera International, Inc.                 fax:   (831) 429-1887
>                                             email: bobs@caldera.com
>

--

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
Caldera International, Inc.                 fax:   (831) 429-1887
 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]