You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-dev@jakarta.apache.org by "Rony G. Flatscher" <Ro...@wu-wien.ac.at> on 2003/02/11 17:14:43 UTC

Additional info (Re: Question on strange "java.lang.IllegalAccessException" in "EngineUtils.callBeanMethod(...)"

Hi there,

here is some more information on this strange problem:

Java version:
-------------------- cut here -----------------------
E:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\util>java -version
java version "1.3.1_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_06-b01)
Java HotSpot(TM) Client VM (build 1.3.1_06-b01, mixed mode)
-------------------- cut here -----------------------

As you can see,

1) the correct method is found (see signature),
2) the exception is raised by Method.invoke(), which is a native method.

-------------------- cut here -----------------------
        9/14: [hasMoreElements]
---
EngineUtils: 0000 //////////////// begin.
EngineUtils: 1111 //try ////////// begin.
EngineUtils: 1111 \try \\\\\ end.
EngineUtils: 0000 /// #2 ///////// begin. 
bean=[java.util.Hashtable$Enumerator@c23c12], 
args=[[Ljava.lang.Object;@c23de8], m=[public boolean 
java.util.Hashtable$Enumerator.hasMoreElements()]
EngineUtils: in last catch:
        e=java.lang.IllegalAccessException: java/util/Hashtable$Enumerator
EngineUtils: trace stack:
 - - - - - - - - - - - -
java.lang.IllegalAccessException: java/util/Hashtable$Enumerator
        at java.lang.reflect.Method.invoke(Native Method)
        at com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:160)
        at 
com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
- - - - - - - - - - - -
com.ibm.bsf.BSFException: method invocation failed: 
java.lang.IllegalAccessExcep
tion: java/util/Hashtable$Enumerator
        at com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:170)
        at 
com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
"invoke": got exception [method invocation failed: 
java.lang.IllegalAccessException: java/util/Hashtable$Enumerator].
Exception in thread "main" com.ibm.bsf.BSFException: "invoke": object 
'java.util.Hashtable$Enumerator@c23c12' - method [hasMoreElements], 
method not found!
        at 
com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1349)
   263 *-* call BSF "invoke", "java.util.Hashtable$Enumerator@c23c12", 
"HASMOREELEMENTS"
   263 *-* interpret code        -- execute this dynamically created 
Rexx string

     9 *-*   do while enum~hasMoreElements       -- loop over enumeration
Error 40 running 
e:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\engines\rexx\BSF.cls line 263:  
Incorrect call to routine
Error 40.1:  External routine "BSF" failed
-------------------- cut here -----------------------

The documentation of Method.invoke() states that: "If this Method object 
enforces Java language access control and the underlying method is 
inaccessible, the invocation throws an IllegalAccessException."

Now, I am clueless. How could I possibly circumvent this (for me totally 
unexpected) behaviour?

Is there a means available to me to have the method object *not* enforce 
"Java language access control" and if so, how?

Again, if you have ideas/hints which could help me circumvent this 
exception, then please let me know.

Regards & TIA,

---rony








Rony G. Flatscher wrote:

> Hi there,
>
> for a non-Java  based scripting language (Rexx) I have been extending 
> the functionality on the BSF 2.2 version with the intent to add that 
> functionality to BSF 2.3 ASAP.
>
> Being in the final testing stages, I have run into a problem for which 
> I request some help/hints in this group of experts: while trying to 
> invoke the method "hasMoreElements" (has no arguments) on an object of 
> a class which implements the "Enumerator" interface I ran into the 
> following exception (in "EngineUtils.callBeanMethod()"):
>
> -------------------- cut here -----------------------
> bean=[java.util.Hashtable$Enumerator@63cb94], class=[class 
> java.util.Hashtable$Enumerator], iterating over methods:
>        0/14: [getClass]
>        1/14: [hashCode]
>        2/14: [equals]
>        3/14: [toString]
>        4/14: [notify]
>        5/14: [notifyAll]
>        6/14: [wait]
>        7/14: [wait]
>        8/14: [wait]
>        9/14: [hasMoreElements]
> ---
> com.ibm.bsf.BSFException: method invocation failed: 
> java.lang.IllegalAccessException: java/util/Hashtable$Enumerator
>        at 
> com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:159)
>        at 
> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
> -------------------- cut here -----------------------
>
> The above contains the printout of debug information showing the 
> methods of the Enumeration. The method found and to be executed via 
> "callBeanMethod" is "hasMoreElements".
>
> Now, needless to say, being able to use the methods defined by 
> interfaces is essential, hence I am very eager to solve this problem. 
> If anyone can provide some hints/tips/insights or ideas for 
> workarounds, I would *really*, *really* appreciate it a *lot*!
>
> TIA,
>
> ---rony
>
> P.S.:  The given line-number in EngineUtils.java should be 157, not 
> 159. The reason: I am using the patched version of EngineUtils which 
> therefore is able to deal with arguments of type "Character". In this 
> particular case no arguments are given for the Enumerator method 
> "hasMoreElements()".
>
> P.P.S.: I am trying to enumerate all the keys of the Properties object 
> received via the System class. Here's the Object Rexx code (building 
> on the procedural Rexx interface):
>
> -------------------- cut here -----------------------
> /* Object Rexx (message operator is the tilde: ~) */
>
> system=.bsf.cls~Class.JC~forName("string", "java.lang.System")  -- get 
> the class object for "System", o.k.
>
> properties = system~getProperties     -- get the System properties, o.k.
> enum = properties~propertyNames       -- get an enumeration of the 
> property names, o.k.
>
> do while enum~hasMoreElements         -- loop over enumeration: BOMBS!
>   key = enum~nextElement             -- get next element
>   say "key:" key "value:" properties~getProperty("String", key)
> end
>
> ::requires "BSF.cls"                  -- get the Object Rexx support 
> for "bsf4rexx"
> -------------------- cut here -----------------------
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bsf-dev-help@jakarta.apache.org
>




Re: Results of further investigations and a possible solution for Java 1.2, 1.3 and 1.4 (but not for 1.1 as of yet!) ... (Re: Problem on all Java versions (Re: Additional info (Re: Question on strange "java.lang.IllegalAccessException" in "EngineUtils.callBeanMethod(...)"

Posted by Igor Bukanov <ig...@icesoft.no>.
Rony G. Flatscher wrote:
 > (In order to do that in a safe way, it is also
> necessary to determine whether the code is running under version 1.1, in 
> which case "AccessibleObject" is not available. To do so, at present I 
> am using an anonymous static block in "EngineUtils" in which the System 
> properties are used to determine the version of the JVM. )

You should not check against Java version to check for AccessibleObject 
  methods, use the reflection instead to check if a particular class or 
method is available as various PJava and libraries like 
www.classpath.org may have a method implementation even if the version 
string mention 1.1.




RE: Results of further investigations and a possible solution for Java 1.2, 1.3 and 1.4 (but not for 1.1 as of yet!) ... (Re: Problem on all Java versions (Re: Additional info (Re: Question on strange "java.lang.IllegalAccessException" in "EngineUtils.cal

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Does anyone know, how one can file a bug report with Sun?

 1. Official: Bug parade
 2. Unofficial, and far more effect:
      Find a Sun developer who cares:
 3. Unofficial, and possible effective:
      Find an IBM developer who cares, and will
      submit it to Sun along with IBM's patch.

However, you might want to check with Sun to see if it really is a bug.

	--- Noel

Results of further investigations and a possible solution for Java 1.2, 1.3 and 1.4 (but not for 1.1 as of yet!) ... (Re: Problem on all Java versions (Re: Additional info (Re: Question on strange "java.lang.IllegalAccessException" in "EngineUtils.callBeanMethod(...)"

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Hi there,

not being satisfied with an unexpected behaviour (raising an 
IllegalAccessException) in "Method.invoke(...)" , I went after all of 
the docs, went thru the Java specification PDF from Sun and created a 
little pure-Java testcase to check the assumptions I arrived at.

Here's the quintessence: it seems that "Method.invoke(...)" behaves 
differently to the compiler if invoking public methods of inner classes! 
I regard this to be a bug which occurs for all of the tested Windows 
Java versions of Sun (from Java version 1.1 through 1.4). (Does anyone 
know, how one can file a bug report with Sun?)

Anyway, I found a solution which unfortunately does not work with Java 
1.1: starting with 1.2 the class "Method" is a subclass of 
"AccessibleObject", which allows for setting the inocation such, that no 
access rights are checked. At the moment I am using that functionality 
in "EngineUtils" everytime I can determine that a method possesses the 
Modifier "public". (In order to do that in a safe way, it is also 
necessary to determine whether the code is running under version 1.1, in 
which case "AccessibleObject" is not available. To do so, at present I 
am using an anonymous static block in "EngineUtils" in which the System 
properties are used to determine the version of the JVM. If someone 
knows of a field or function in the BSF package where the Java version 
is already available, please let me know.)

So far testing that code with BSF 2.2 under Sun's Windows jdk1.2.2, 
jdk1.3.1_06, j2sdk1.4.1_01 allows the Rexx programs to flawlessly access 
public methods of inner classes. If someone has an idea, how I could 
achieve the same functionality if BSF is running under a JVM 1.1, I 
really would appreciate such hints!

Regards,

---rony




Problem on all Java versions (Re: Additional info (Re: Question on strange "java.lang.IllegalAccessException" in "EngineUtils.callBeanMethod(...)"

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Hi there,

did test the following Java versions for Windows, downloaded from Sun:

    jdk1.1.8
    jdk1.2.2
    jdk1.3.1_06
    j2sdk1.4.1_01

The reported exception "java.lang.IllegalAccessException" occurs on all 
of them, when trying to invoke the public method "hasMoreElements()".

As I am still clueless as to why this exception is raised, I still am 
seeking for an explanation and/or hints/tips on this problem.

TIA,

---rony


Rony G. Flatscher wrote:

> Hi there,
>
> A very last piece of info: according to the 
> "Modifier.toString(m.getModifiers())", the method "[public boolean 
> java.util.Hashtable$Enumerator.hasMoreElements()]" is indeed "public". 
> Therefore, how could the exception "IllegalAccessException" possibly 
> occur?
> Would it help to switch the Java version (if this was a Java error)?
>
> Regards,
>
> ---rony
>
>
> Rony G. Flatscher wrote:
>
>> Hi there,
>>
>> here is some more information on this strange problem:
>>
>> Java version:
>> -------------------- cut here -----------------------
>> E:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\util>java -version
>> java version "1.3.1_06"
>> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_06-b01)
>> Java HotSpot(TM) Client VM (build 1.3.1_06-b01, mixed mode)
>> -------------------- cut here -----------------------
>>
>> As you can see,
>>
>> 1) the correct method is found (see signature),
>> 2) the exception is raised by Method.invoke(), which is a native method.
>>
>> -------------------- cut here -----------------------
>>        9/14: [hasMoreElements]
>> ---
>> EngineUtils: 0000 //////////////// begin.
>> EngineUtils: 1111 //try ////////// begin.
>> EngineUtils: 1111 \try \\\\\ end.
>> EngineUtils: 0000 /// #2 ///////// begin. 
>> bean=[java.util.Hashtable$Enumerator@c23c12], 
>> args=[[Ljava.lang.Object;@c23de8], m=[public boolean 
>> java.util.Hashtable$Enumerator.hasMoreElements()]
>> EngineUtils: in last catch:
>>        e=java.lang.IllegalAccessException: 
>> java/util/Hashtable$Enumerator
>> EngineUtils: trace stack:
>> - - - - - - - - - - - -
>> java.lang.IllegalAccessException: java/util/Hashtable$Enumerator
>>        at java.lang.reflect.Method.invoke(Native Method)
>>        at 
>> com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:160)
>>        at 
>> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
>> - - - - - - - - - - - -
>> com.ibm.bsf.BSFException: method invocation failed: 
>> java.lang.IllegalAccessExcep
>> tion: java/util/Hashtable$Enumerator
>>        at 
>> com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:170)
>>        at 
>> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
>> "invoke": got exception [method invocation failed: 
>> java.lang.IllegalAccessException: java/util/Hashtable$Enumerator].
>> Exception in thread "main" com.ibm.bsf.BSFException: "invoke": object 
>> 'java.util.Hashtable$Enumerator@c23c12' - method [hasMoreElements], 
>> method not found!
>>        at 
>> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1349)
>>   263 *-* call BSF "invoke", "java.util.Hashtable$Enumerator@c23c12", 
>> "HASMOREELEMENTS"
>>   263 *-* interpret code        -- execute this dynamically created 
>> Rexx string
>>
>>     9 *-*   do while enum~hasMoreElements       -- loop over enumeration
>> Error 40 running 
>> e:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\engines\rexx\BSF.cls line 
>> 263:  Incorrect call to routine
>> Error 40.1:  External routine "BSF" failed
>> -------------------- cut here -----------------------
>>
>> The documentation of Method.invoke() states that: "If this Method 
>> object enforces Java language access control and the underlying 
>> method is inaccessible, the invocation throws an 
>> IllegalAccessException."
>>
>> Now, I am clueless. How could I possibly circumvent this (for me 
>> totally unexpected) behaviour?
>>
>> Is there a means available to me to have the method object *not* 
>> enforce "Java language access control" and if so, how?
>>
>> Again, if you have ideas/hints which could help me circumvent this 
>> exception, then please let me know.
>>
>> Regards & TIA,
>>
>> ---rony
>>
>>
>>
>>
>>
>>
>>
>>
>> Rony G. Flatscher wrote:
>>
>>> Hi there,
>>>
>>> for a non-Java  based scripting language (Rexx) I have been 
>>> extending the functionality on the BSF 2.2 version with the intent 
>>> to add that functionality to BSF 2.3 ASAP.
>>>
>>> Being in the final testing stages, I have run into a problem for 
>>> which I request some help/hints in this group of experts: while 
>>> trying to invoke the method "hasMoreElements" (has no arguments) on 
>>> an object of a class which implements the "Enumerator" interface I 
>>> ran into the following exception (in "EngineUtils.callBeanMethod()"):
>>>
>>> -------------------- cut here -----------------------
>>> bean=[java.util.Hashtable$Enumerator@63cb94], class=[class 
>>> java.util.Hashtable$Enumerator], iterating over methods:
>>>        0/14: [getClass]
>>>        1/14: [hashCode]
>>>        2/14: [equals]
>>>        3/14: [toString]
>>>        4/14: [notify]
>>>        5/14: [notifyAll]
>>>        6/14: [wait]
>>>        7/14: [wait]
>>>        8/14: [wait]
>>>        9/14: [hasMoreElements]
>>> ---
>>> com.ibm.bsf.BSFException: method invocation failed: 
>>> java.lang.IllegalAccessException: java/util/Hashtable$Enumerator
>>>        at 
>>> com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:159)
>>>        at 
>>> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
>>> -------------------- cut here -----------------------
>>>
>>> The above contains the printout of debug information showing the 
>>> methods of the Enumeration. The method found and to be executed via 
>>> "callBeanMethod" is "hasMoreElements".
>>>
>>> Now, needless to say, being able to use the methods defined by 
>>> interfaces is essential, hence I am very eager to solve this 
>>> problem. If anyone can provide some hints/tips/insights or ideas for 
>>> workarounds, I would *really*, *really* appreciate it a *lot*!
>>>
>>> TIA,
>>>
>>> ---rony
>>>
>>> P.S.:  The given line-number in EngineUtils.java should be 157, not 
>>> 159. The reason: I am using the patched version of EngineUtils which 
>>> therefore is able to deal with arguments of type "Character". In 
>>> this particular case no arguments are given for the Enumerator 
>>> method "hasMoreElements()".
>>>
>>> P.P.S.: I am trying to enumerate all the keys of the Properties 
>>> object received via the System class. Here's the Object Rexx code 
>>> (building on the procedural Rexx interface):
>>>
>>> -------------------- cut here -----------------------
>>> /* Object Rexx (message operator is the tilde: ~) */
>>>
>>> system=.bsf.cls~Class.JC~forName("string", "java.lang.System")  -- 
>>> get the class object for "System", o.k.
>>>
>>> properties = system~getProperties     -- get the System properties, 
>>> o.k.
>>> enum = properties~propertyNames       -- get an enumeration of the 
>>> property names, o.k.
>>>
>>> do while enum~hasMoreElements         -- loop over enumeration: BOMBS!
>>>   key = enum~nextElement             -- get next element
>>>   say "key:" key "value:" properties~getProperty("String", key)
>>> end
>>>
>>> ::requires "BSF.cls"                  -- get the Object Rexx support 
>>> for "bsf4rexx"
>>> -------------------- cut here -----------------------
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: bsf-dev-help@jakarta.apache.org
>>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: bsf-dev-help@jakarta.apache.org
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bsf-dev-help@jakarta.apache.org
>




Re: Additional info (Re: Question on strange "java.lang.IllegalAccessException" in "EngineUtils.callBeanMethod(...)"

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Hi there,

A very last piece of info: according to the 
"Modifier.toString(m.getModifiers())", the method "[public boolean 
java.util.Hashtable$Enumerator.hasMoreElements()]" is indeed "public". 
Therefore, how could the exception "IllegalAccessException" possibly occur?
Would it help to switch the Java version (if this was a Java error)?

Regards,

---rony


Rony G. Flatscher wrote:

> Hi there,
>
> here is some more information on this strange problem:
>
> Java version:
> -------------------- cut here -----------------------
> E:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\util>java -version
> java version "1.3.1_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_06-b01)
> Java HotSpot(TM) Client VM (build 1.3.1_06-b01, mixed mode)
> -------------------- cut here -----------------------
>
> As you can see,
>
> 1) the correct method is found (see signature),
> 2) the exception is raised by Method.invoke(), which is a native method.
>
> -------------------- cut here -----------------------
>        9/14: [hasMoreElements]
> ---
> EngineUtils: 0000 //////////////// begin.
> EngineUtils: 1111 //try ////////// begin.
> EngineUtils: 1111 \try \\\\\ end.
> EngineUtils: 0000 /// #2 ///////// begin. 
> bean=[java.util.Hashtable$Enumerator@c23c12], 
> args=[[Ljava.lang.Object;@c23de8], m=[public boolean 
> java.util.Hashtable$Enumerator.hasMoreElements()]
> EngineUtils: in last catch:
>        e=java.lang.IllegalAccessException: java/util/Hashtable$Enumerator
> EngineUtils: trace stack:
> - - - - - - - - - - - -
> java.lang.IllegalAccessException: java/util/Hashtable$Enumerator
>        at java.lang.reflect.Method.invoke(Native Method)
>        at 
> com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:160)
>        at 
> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
> - - - - - - - - - - - -
> com.ibm.bsf.BSFException: method invocation failed: 
> java.lang.IllegalAccessExcep
> tion: java/util/Hashtable$Enumerator
>        at 
> com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:170)
>        at 
> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
> "invoke": got exception [method invocation failed: 
> java.lang.IllegalAccessException: java/util/Hashtable$Enumerator].
> Exception in thread "main" com.ibm.bsf.BSFException: "invoke": object 
> 'java.util.Hashtable$Enumerator@c23c12' - method [hasMoreElements], 
> method not found!
>        at 
> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1349)
>   263 *-* call BSF "invoke", "java.util.Hashtable$Enumerator@c23c12", 
> "HASMOREELEMENTS"
>   263 *-* interpret code        -- execute this dynamically created 
> Rexx string
>
>     9 *-*   do while enum~hasMoreElements       -- loop over enumeration
> Error 40 running 
> e:\rony\dev\bsf\bsf-2_2\lib\com\ibm\bsf\engines\rexx\BSF.cls line 
> 263:  Incorrect call to routine
> Error 40.1:  External routine "BSF" failed
> -------------------- cut here -----------------------
>
> The documentation of Method.invoke() states that: "If this Method 
> object enforces Java language access control and the underlying method 
> is inaccessible, the invocation throws an IllegalAccessException."
>
> Now, I am clueless. How could I possibly circumvent this (for me 
> totally unexpected) behaviour?
>
> Is there a means available to me to have the method object *not* 
> enforce "Java language access control" and if so, how?
>
> Again, if you have ideas/hints which could help me circumvent this 
> exception, then please let me know.
>
> Regards & TIA,
>
> ---rony
>
>
>
>
>
>
>
>
> Rony G. Flatscher wrote:
>
>> Hi there,
>>
>> for a non-Java  based scripting language (Rexx) I have been extending 
>> the functionality on the BSF 2.2 version with the intent to add that 
>> functionality to BSF 2.3 ASAP.
>>
>> Being in the final testing stages, I have run into a problem for 
>> which I request some help/hints in this group of experts: while 
>> trying to invoke the method "hasMoreElements" (has no arguments) on 
>> an object of a class which implements the "Enumerator" interface I 
>> ran into the following exception (in "EngineUtils.callBeanMethod()"):
>>
>> -------------------- cut here -----------------------
>> bean=[java.util.Hashtable$Enumerator@63cb94], class=[class 
>> java.util.Hashtable$Enumerator], iterating over methods:
>>        0/14: [getClass]
>>        1/14: [hashCode]
>>        2/14: [equals]
>>        3/14: [toString]
>>        4/14: [notify]
>>        5/14: [notifyAll]
>>        6/14: [wait]
>>        7/14: [wait]
>>        8/14: [wait]
>>        9/14: [hasMoreElements]
>> ---
>> com.ibm.bsf.BSFException: method invocation failed: 
>> java.lang.IllegalAccessException: java/util/Hashtable$Enumerator
>>        at 
>> com.ibm.bsf.util.EngineUtils.callBeanMethod(EngineUtils.java:159)
>>        at 
>> com.ibm.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:1339)
>> -------------------- cut here -----------------------
>>
>> The above contains the printout of debug information showing the 
>> methods of the Enumeration. The method found and to be executed via 
>> "callBeanMethod" is "hasMoreElements".
>>
>> Now, needless to say, being able to use the methods defined by 
>> interfaces is essential, hence I am very eager to solve this problem. 
>> If anyone can provide some hints/tips/insights or ideas for 
>> workarounds, I would *really*, *really* appreciate it a *lot*!
>>
>> TIA,
>>
>> ---rony
>>
>> P.S.:  The given line-number in EngineUtils.java should be 157, not 
>> 159. The reason: I am using the patched version of EngineUtils which 
>> therefore is able to deal with arguments of type "Character". In this 
>> particular case no arguments are given for the Enumerator method 
>> "hasMoreElements()".
>>
>> P.P.S.: I am trying to enumerate all the keys of the Properties 
>> object received via the System class. Here's the Object Rexx code 
>> (building on the procedural Rexx interface):
>>
>> -------------------- cut here -----------------------
>> /* Object Rexx (message operator is the tilde: ~) */
>>
>> system=.bsf.cls~Class.JC~forName("string", "java.lang.System")  -- 
>> get the class object for "System", o.k.
>>
>> properties = system~getProperties     -- get the System properties, o.k.
>> enum = properties~propertyNames       -- get an enumeration of the 
>> property names, o.k.
>>
>> do while enum~hasMoreElements         -- loop over enumeration: BOMBS!
>>   key = enum~nextElement             -- get next element
>>   say "key:" key "value:" properties~getProperty("String", key)
>> end
>>
>> ::requires "BSF.cls"                  -- get the Object Rexx support 
>> for "bsf4rexx"
>> -------------------- cut here -----------------------
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: bsf-dev-help@jakarta.apache.org
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: bsf-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: bsf-dev-help@jakarta.apache.org
>