You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Tobias Kämpf <to...@corporate-planning.com> on 2002/08/02 07:53:09 UTC

Problems with XPath and Java 1.4.0_01 ( Applet Context )

Hello,

I have found a Problem with Applets and the XPath.
I am using Java Version 1.4.0_01 and the latest src ( xalan-j_2_4_D1 ).

I have made an TestApplet, changing the FileInputStream in the Sample
ApplyXPath in an InputStream from a
URL. I done this because of the SecurityRestrictions.
Having my own Apache running on my Computer and accessing the Applet with a
Browser (IE6) over a 'localhost' URL there should be no Problems, but this
Exception raised :

java.security.AccessControlException: access denied
(java.util.PropertyPermission user.dir read)
 at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:270)
 at
java.security.AccessController.checkPermission(AccessController.java:401)
 at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
 at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291)
 at java.lang.System.getProperty(System.java:572)
 at org.apache.xml.utils.TreeWalker.<init>(TreeWalker.java:149)
 at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.<init>(DOM2DTM.java:1608)
 at
org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:189)
 at
org.apache.xml.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefa
ult.java:438)
 at
org.apache.xpath.XPathContext.getDTMHandleFromNode(XPathContext.java:195)
 at org.apache.xpath.XPathAPI.eval(XPathAPI.java:274)
 at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:163)
 at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:143)
 at ApplyXPath.doMain(ApplyXPath.java:131)
 at TApplet.start(TApplet.java:43)
 at sun.applet.AppletPanel.run(AppletPanel.java:355)
 at java.lang.Thread.run(Thread.java:536)

The Problem occures in the Class : org.apache.xml.utils.TreeWalker while
calling an Constructer.
But as I looked in the Source the SecurityExcpetion is caught by a try catch
block.
Changes that I made at the source, for debugging purposes, are ignored
totally.
I inserted some System.out, also System.err Lines to get some outputs. But
nothing happens.
Do anybody else had this Exception also ? And what can I do against it ?
Is it possible that the Xalan Implementation in the rt.jar of the
jre1.4.0_01 is taken instead of the xalan.jar specified in the Applet tag ?

Best regards from Germany
Tobias Kämpf


Re: Problems with XPath and Java 1.4.0_01 ( Applet Context )

Posted by John Gentilin <ge...@eyecatching.com>.
>From my experience this document works fine under Linux/Unix but fails
to work under Windows 2K SP2, I have not tried the 4.1 beta although
I am interested in the results.

Regards
John G

Tom Amiro wrote:

> Tobias,
>
> Have you tried to override the version of Xalan built into 1.4.x
> with the Endorsed Standards Override Mechansim? See
>
>    http://java.sun.com/j2se/1.4/docs/guide/standards/
>
> Tom
>
> Tobias Kämpf wrote:
> >
> > Hello,
> >
> > I have found a Problem with Applets and the XPath.
> > I am using Java Version 1.4.0_01 and the latest src ( xalan-j_2_4_D1 ).
> >
> > I have made an TestApplet, changing the FileInputStream in the Sample
> > ApplyXPath in an InputStream from a
> > URL. I done this because of the SecurityRestrictions.
> > Having my own Apache running on my Computer and accessing the Applet with a
> > Browser (IE6) over a 'localhost' URL there should be no Problems, but this
> > Exception raised :
> >
> > java.security.AccessControlException: access denied
> > (java.util.PropertyPermission user.dir read)
> >  at
> > java.security.AccessControlContext.checkPermission(AccessControlContext.java
> > :270)
> >  at
> > java.security.AccessController.checkPermission(AccessController.java:401)
> >  at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
> >  at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291)
> >  at java.lang.System.getProperty(System.java:572)
> >  at org.apache.xml.utils.TreeWalker.<init>(TreeWalker.java:149)
> >  at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.<init>(DOM2DTM.java:1608)
> >  at
> > org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:189)
> >  at
> > org.apache.xml.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefa
> > ult.java:438)
> >  at
> > org.apache.xpath.XPathContext.getDTMHandleFromNode(XPathContext.java:195)
> >  at org.apache.xpath.XPathAPI.eval(XPathAPI.java:274)
> >  at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:163)
> >  at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:143)
> >  at ApplyXPath.doMain(ApplyXPath.java:131)
> >  at TApplet.start(TApplet.java:43)
> >  at sun.applet.AppletPanel.run(AppletPanel.java:355)
> >  at java.lang.Thread.run(Thread.java:536)
> >
> > The Problem occures in the Class : org.apache.xml.utils.TreeWalker while
> > calling an Constructer.
> > But as I looked in the Source the SecurityExcpetion is caught by a try catch
> > block.
> > Changes that I made at the source, for debugging purposes, are ignored
> > totally.
> > I inserted some System.out, also System.err Lines to get some outputs. But
> > nothing happens.
> > Do anybody else had this Exception also ? And what can I do against it ?
> > Is it possible that the Xalan Implementation in the rt.jar of the
> > jre1.4.0_01 is taken instead of the xalan.jar specified in the Applet tag ?
> >
> > Best regards from Germany
> > Tobias Kämpf






Re: Problems with XPath and Java 1.4.0_01 ( Applet Context )

Posted by Tom Amiro <To...@Sun.COM>.
Tobias,

Have you tried to override the version of Xalan built into 1.4.x
with the Endorsed Standards Override Mechansim? See

   http://java.sun.com/j2se/1.4/docs/guide/standards/

Tom


Tobias Kämpf wrote:
> 
> Hello,
> 
> I have found a Problem with Applets and the XPath.
> I am using Java Version 1.4.0_01 and the latest src ( xalan-j_2_4_D1 ).
> 
> I have made an TestApplet, changing the FileInputStream in the Sample
> ApplyXPath in an InputStream from a
> URL. I done this because of the SecurityRestrictions.
> Having my own Apache running on my Computer and accessing the Applet with a
> Browser (IE6) over a 'localhost' URL there should be no Problems, but this
> Exception raised :
> 
> java.security.AccessControlException: access denied
> (java.util.PropertyPermission user.dir read)
>  at
> java.security.AccessControlContext.checkPermission(AccessControlContext.java
> :270)
>  at
> java.security.AccessController.checkPermission(AccessController.java:401)
>  at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
>  at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1291)
>  at java.lang.System.getProperty(System.java:572)
>  at org.apache.xml.utils.TreeWalker.<init>(TreeWalker.java:149)
>  at org.apache.xml.dtm.ref.dom2dtm.DOM2DTM.<init>(DOM2DTM.java:1608)
>  at
> org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.java:189)
>  at
> org.apache.xml.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefa
> ult.java:438)
>  at
> org.apache.xpath.XPathContext.getDTMHandleFromNode(XPathContext.java:195)
>  at org.apache.xpath.XPathAPI.eval(XPathAPI.java:274)
>  at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:163)
>  at org.apache.xpath.XPathAPI.selectNodeIterator(XPathAPI.java:143)
>  at ApplyXPath.doMain(ApplyXPath.java:131)
>  at TApplet.start(TApplet.java:43)
>  at sun.applet.AppletPanel.run(AppletPanel.java:355)
>  at java.lang.Thread.run(Thread.java:536)
> 
> The Problem occures in the Class : org.apache.xml.utils.TreeWalker while
> calling an Constructer.
> But as I looked in the Source the SecurityExcpetion is caught by a try catch
> block.
> Changes that I made at the source, for debugging purposes, are ignored
> totally.
> I inserted some System.out, also System.err Lines to get some outputs. But
> nothing happens.
> Do anybody else had this Exception also ? And what can I do against it ?
> Is it possible that the Xalan Implementation in the rt.jar of the
> jre1.4.0_01 is taken instead of the xalan.jar specified in the Applet tag ?
> 
> Best regards from Germany
> Tobias Kämpf