This turns out to be caused by the fact that the
HttpSessionFacade class wasn't declared public.  This
will be fixed in the Tomcat 3.3.1 release.

Cheers,
Larry

> -----Original Message-----
> From: Wout Neirynck [mailto:[EMAIL PROTECTED]] 
> Sent: Wednesday, March 20, 2002 9:45 AM
> To: [EMAIL PROTECTED]
> Subject: IllegalAccessException when using Java in XSLT
> 
> 
> Hi all,
> 
> I've written a servlet that generates HTML using XML/XSLT.  
> The XSL pages 
> are using extra parameters that are passed on by the servlet 
> (the http 
> request, the http response and the session).  But when I want 
> to access 
> these objects from within the XSL file using the Java extension stuff 
> provided by Xalan, Tomcat always gives me an "IllegalAccessException".
> 
> The whole web-app works perfecly fine using the commercial 
> web-container 
> JRun, so I don't think the problem lies with the Java code.  
> It can't be a 
> problem of the classes or their members not being public, 
> since they're 
> standard servlet classes, and they're perfectly accessible 
> from within the 
> servlet itself.
> 
> Some version numbers:
> - Java JDK 1.3.1
> - Tomcat 3.3a
> - Xalan 2.1.0
> - Windows NT 4.0
> 
> Here's a sample of the XSLT I'm using to access the session:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <xsl:stylesheet version="1.0"
>       xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>       xmlns:xalan="http://xml.apache.org/xslt";
>       xmlns:java="http://xml.apache.org/xslt/java";
>       exclude-result-prefixes="java">
> 
> <xsl:output method="html" omit-xml-declaration="yes"/>
> 
> <!-- The session, passed on by the servlet -->
> <xsl:param name="session"/>
> 
> <xsl:template match="/">
>       <!-- Set the "userId" attribute in the session -->
>       <xsl:value-of 
> select="java:setAttribute($session,'userId','some value')"/>
> </xsl:template>
> 
> </xsl:stylesheet>
> 
> And a piece of the stack trace:
> java.lang.IllegalAccessException
>       at java.lang.reflect.Method.invoke(Native Method)
>       at 
> org.apache.xalan.extensions.ExtensionHandlerJavaPackage.callFu
> nction(ExtensionHandlerJavaPackage.java:375)
>       at 
> org.apache.xalan.extensions.ExtensionsTable.extFunction(Extens
> ionsTable.java:253)
>       at 
> org.apache.xpath.functions.FuncExtFunction.execute(FuncExtFunc
> tion.java:141)
>       at org.apache.xpath.XPath.execute(XPath.java:260)
>       at 
> org.apache.xalan.templates.ElemValueOf.execute(ElemValueOf.java:251)
>       at 
> org.apache.xalan.transformer.TransformerImpl.executeChildTempl
> ates(TransformerImpl.java:2251)
>       at 
> org.apache.xalan.transformer.TransformerImpl.applyTemplateToNo
> de(TransformerImpl.java:2134)
>       at 
> org.apache.xalan.transformer.TransformerImpl.transformNode(Tra
> nsformerImpl.java:1246)
>       at 
> org.apache.xalan.transformer.TransformerImpl.transform(Transfo
> rmerImpl.java:504)
>       at 
> org.apache.xalan.transformer.TransformerImpl.transform(Transfo
> rmerImpl.java:1174)
> 
> 
> Once again, the whole app works perfectly using JRun (same Java, same 
> Xalan, etc...), so I don't think it's got to do with the XSLT or my 
> servlet.  If anyone knows how to solve this problem, I'd 
> appreciate it if 
> they'd help me out!
> 
> Thanks in advance,
> Wout Neirynck
> 
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to