fw: Jpython problem

sdossett at metaphoria.net sdossett at metaphoria.net
Tue Dec 14 15:43:57 EST 1999


Anybody got an answer for this one???


> ** Original Subject: fw: Jpython problem
> ** Original Sender: Michael Christian <michaelc at metaphoria.net>
> ** Original Date: Tue, 14 Dec 1999 15:38:09 -0500

> ** Original Message follows... 

>Hi,
> 
>     I'm having a problem when I try to import certain Java packages. I'm
> using Jpython 1.1 Beta 2 and I've subclassed PythonInterpreter and am
> trying to execute the following code:
> 
> 
> import sys
> from java.lang import String
> from java import lang
> from java import util
> from java import io
> from net.metaphoria.toolkit.html import HtmlGenerator
> from net.metaphoria.toolkit import net
> from net.metaphoria.toolkit.access import DataAccessor
> from net.metaphoria.toolkit.access import DataAccessFactory
> from net.metaphoria.toolkit.access import ReadableResponse
> from net.metaphoria.toolkit.util import WrapException
> from net.metaphoria.toolkit.io import StreamStringer
> from net.metaphoria.toolkit.net import URI
> from net.metaphoria.toolkit import service
> sys.add_package('net.metaphoria.test.rdl')
> sys.add_package('net.metaphoria.test.rdl.set')
> from net.metaphoria.dts.respond import ResponderManager
> from net.metaphoria.test.rdl.encapsulators import TestEncapsulator;
> from net.metaphoria.test.rdl.responders import TestResponder;



> I previously had this code working under Jpython 1.0, calling classes
> from Java 1.1.8, but I've
> added classes which rely on Java 1.2 and consequently now am using jdk
> 1.2.2. The imports of Sun-supplied classes appear to work. The custom
> imports up until line 18 also appear to work.
> These are all supplied in a jar file that I've included in my classpath.
> The custom import on line 18
> appears to cause the problem. It is not included in a jar file, but the
> root path to it is specified in my
> classpath. I originally tried this without the two sys.add_package
> statements, but thought I would
> add it just to see if this resolved anything, which it did not.
>     Following is the exception stack trace that was produced. Thanks in
> advance for any help you
> can give.
> 
> [Tue Dec 14 12:36:06 EST 1999] [OperationThread for: RDLTest2] Caught
> PyException: Traceback (innermost last):
>   File "<string>", line 18, in ?
> java.security.AccessControlException: access denied
> (java.io.FilePermission C:\JavaWebServer2.0\classes\net read)
> 
>  at
> java.security.AccessControlContext.checkPermission(AccessControlContext.java,
> Compiled Code)
>  at
> java.security.AccessController.checkPermission(AccessController.java,
> Compiled Code)
>  at java.lang.SecurityManager.checkPermission(SecurityManager.java,
> Compiled Code)
>  at java.lang.SecurityManager.checkRead(SecurityManager.java, Compiled
> Code)
>  at java.io.File.isDirectory(File.java:566)
>  at org.python.core.PyJavaDirPackage.__findattr__(PyJavaDirPackage.java,
> Compiled Code)
>  at org.python.core.PyJavaPackage.getDirPackage(PyJavaPackage.java:152)
>  at org.python.core.PyJavaPackage.getDirPackage(PyJavaPackage.java:140)
>  at org.python.core.PyJavaPackage.getDirPackage(PyJavaPackage.java:140)
>  at org.python.core.PyJavaPackage.getDirPackage(PyJavaPackage.java:140)
>  at org.python.core.PyJavaPackage.__findattr__(PyJavaPackage.java,
> Compiled Code)
>  at org.python.core.PyObject.__getattr__(PyObject.java, Compiled Code)
>  at org.python.core.imp.importName(imp.java, Compiled Code)
>  at org.python.core.imp.importName(imp.java:435)
>  at org.python.core.imp.importFrom(imp.java, Compiled Code)
>  at org.python.pycode._pyx0.f$0(<string>)
>  at org.python.pycode._pyx0.call_function(<string>)
>  at org.python.core.PyTableCode.call(PyTableCode.java:75)
>  at org.python.core.Py.runCode(Py.java:935)
>  at org.python.core.Py.exec(Py.java:949)
>  at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:112)
>  at
> net.metaphoria.test.rdl.RDLMetaRepository.generate(RDLMetaRepository.java:232)
> 
>  at
> 
net.metaphoria.dts.repository.RepositoryGenerator.perform(RepositoryGenerator.java:119)
> 
>  at
> 
net.metaphoria.dts.repository.RepositoryOperation.performOperation(RepositoryOperation.j
ava:358)
> 
>  at
> net.metaphoria.dts.repository.OperationThread.run(MetaRepository.java,
> Compiled Code)
> 
> java.security.AccessControlException:
> java.security.AccessControlException: access denied
> (java.io.FilePermission C:\JavaWebServer2.0\classes\net read)
> 



The Christian ideal has not been tried and found wanting. It has been found difficult; and left untried. 
- G. K. Chesterton



Download NeoPlanet at http://www.neoplanet.com





More information about the Python-list mailing list