|
From: Chris A. <at...@nm...> - 2001-01-22 22:59:51
|
It appears that the problem was that the registry had
python.security.respectJavaAccessibility = true
When I commented this out of the registry file it worked.
Can you please explain the difference between:
The Java system properties: typically passed in on the command line as
options to the java interpreter.
Jython properties: Specified on the command
line as options to the jython class. See the -D option to the interpreter.
I believe the top one says if I place the -D parms before the class name on
the java statement as in:
java -Dpython.security.respectJavaAccessibility=0 org.python.util.jython
The second would be
java org.python.util.jython -Dpython.security.respectJavaAccessibility=0
I am embedding jython in my code. How would I pass the -D options to the
InteractiveConsole?
Chris Atkins
> -----Original Message-----
> From: Finn Bock [mailto:bc...@wo...]
> Sent: Monday, January 22, 2001 4:32 PM
> To: jyt...@li...
> Cc: at...@nm...
> Subject: Re: [Jython-users] Ignoring Java Access
>
>
> [Chris Atkins]
>
> >I am running jython 2.0 release on hpux 11 with jdk1.2.2.07.
> >
> >I run my jython interpretter
> >with -Dpython.security.respectJavaAccessibility= 0 and =false.
> >
> >In both cases, I am unable to access protected methods of a class.
> >
> >I just switched out my jar file from using jpython1.1 to
> jython2.0, and it
> >works under under jpython1.1
> >
> >My python code looks like the following:
> >
> >print foo.toPrintString(obja, string1, string2)
> >
> >I get the following error:
> >TypeError: toPrintString(): expected 0-2 args; got 3
>
> Well, it works for me. I made some small changes:
>
> abstract public class fooBase {
> public String toPrintString() {
> return "here1";
> }
> public String toPrintString(String initialIndent) {
> return "here2";
> }
> public String toPrintString(String initialIndent, String name) {
> return "here3";
> }
> abstract protected String toPrintString(java.lang.Object fooObj,
> String initialIndent, String name);
> }
>
>
> public class foo extends fooBase {
> protected String toPrintString(Object obj,
> String initialIndent, String name) {
> return "here4";
> }
> }
>
> jython -Dpython.security.respectJavaAccessibility=false
> Jython 2.0 on java1.3.0 (JIT: null)
> Type "copyright", "credits" or "license" for more information.
> >>> import foo
> >>> print foo().toPrintString(1, "string1", "string2")
> here4
> >>>
>
> regards,
> finn
>
|