VMware Cloud Community
StefanSchnell
Enthusiast
Enthusiast

Access to Java class adapter1 is prohibited

With the JavaScript engine Rhino it is possible to implement Java interfaces. Here an example how to that with the java.util.Enumeration interface from the Rhino enum.js example:

var array = [0, 1, 2];

var elements = java.util.Enumeration({
  index: 0,
  elements: array,
  hasMoreElements: function() {
    return (this.index < this.elements.length);
  },
  nextElement: function() {
    return this.elements[this.index++];
  }
});

while (elements.hasMoreElements()) {
  System.log(elements.nextElement());
}

This example works in the Rhino environment without any problems but in an Aria Automation action it delivers the message: error instantiating (Access to Java class "adapter1" is prohibited. ... class java.util.Enumeration is interface or abstract ...

StefanSchnell_0-1700238185795.png

Does anyone know a way to handle this?

Thanks for hints and tips.
Best regards
Stefan


More interesting information at blog.stschnell.de

Labels (2)
Reply
0 Kudos
0 Replies