Hi Gary,

Here's the error output in my Log4J file:
ERROR [earthtrip]: XSLT Transformation failed: java.util.MissingResourceException: Can't find bundle for base name clients.earthtrip.i18n, locale en_US 2002-02-28 16:37:51,259


JDK 1.3.1 on  Mac OS X
Xalan 2.2.0

I'm not executing from the command line. Just programmatically from within my code. Here's the code that loads the stylesheet and does the transform (I'm using JDOM 1.0b7 for XML). The reason I'm assuming this is a Xalan problem is because it only happens from within the stylesheet extension.

try {
Transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(stylesheet));
StreamResult out = new StreamResult(new StringWriter());
transformer.transform(new JDOMSource(this.doc), out);
StringWriter writer = (StringWriter) out.getWriter();
return writer.getBuffer();
}
catch (Exception e) {
throw new JDOMException("XSLT Transformation failed", e);
}



Also I'm not getting a JDOMException but a java.util.MissingResourceException
I have the classpath set in the application launcher to point to the directory that contains the "client" directory so the rest of my code can call it fine.


Thanks for your help.

Mike


On Friday, March 1, 2002, at 04:21 PM, Gary L Peskin wrote:

Hi, Mike --

What version of XalanJ are you using?  What is your JDK version?  Can
you include the full stack trace of the MissingResourceException, please
(you may need to include the -edump command line switch).

Also, if you're executing XalanJ from the command line, can you please
type

  java org.apache.xalan.xslt.EnvironmentCheck

and include the output?

Thanks,
Gary

-----Original Message-----
From: Michael Engelhart [mailto:[EMAIL PROTECTED]
Sent: Friday, March 01, 2002 1:16 PM
To: [EMAIL PROTECTED]
Subject: xalan extensions classpath


Hi,

I have a stylesheet with the following in it:

<xsl:variable name="language" select="/Document/@Language" />
<xsl:variable name="country" select="/Document/@Country" />
<xsl:variable name="locale"
select="java:java.util.Locale.new($language,
$country)" />
<xsl:variable name="i18nBundle"
select="java:java.util.ResourceBundle.getBundle('clients.somec
lient.i18n',
$locale)" />


This standalone application has the directory that contains "clients/someclient" in the classpath and I can easily call: ResourceBundle bundle = ResourceBundle.getBundle("clients.someclient.i18n"); without throwing a MissingResourceException from anywhere in my java class files. I can also do transforms with Xalan as well but when I include the above XSL extension code I get a MissingResourceException thrown.

So my question is how come Xalan isn't using the applications
classpath
in it's extension mechanism?   Also I tried jarring up that clients
directory and sticking it my Java Extensions directory (which
on Mac OS
X gets added to the classpath automatically) and it found the file
fine.    But I want these properties files to be editable and not
wrapped up in a jar.   The clients directory is to sit in the
applications top level directory.

Any help/advice would be apprectiated.

Thanks
Mike




Reply via email to