Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 891169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:50:54+00:00 2026-05-15T13:50:54+00:00

Here’s a very simple example of what I see: jrunscript -f – js> var

  • 0

Here’s a very simple example of what I see:

jrunscript -f -
js> var d = new java.util.Date();
js> var m = d.getClass().getMethods();
js> println(m[0].getClass().getName());
java.lang.reflect.Method
js> var name = m[0].getName();
script error: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.lang.UnsupportedOperationException: invocation not supported (<STDIN>#1) in <STDIN> at line number 1
js> var time = d.getTime();
js> println(time);
1278421741768
js> 

The variable “d” is a Java “Date” instance, and “m” is the array of Java “Method” objects for the “Date” class. When I try to call getName() on one of the “Method” instances, however, it doesn’t work. Note that calling getTime() on the “Date” instance works fine, as do pretty much all other calls to Java objects. (Well, I haven’t run an exhaustive exploration of course, but it generally works and that’s why “Method” seems weird.)

If I write (on the Java side) a class that basically wraps “Method” and delegates, that works fine. So it’s not like there’s some intrinsic barrier between the Javascript domain and the stuff that “Method” supplies. (Indeed, I imagine that the script layer itself has to do reflection to provide the basic facility in the first place.)

I recall having encountered and hacked around this problem the last time I was fooling around with Rhino via the JDK 6 script framework. I don’t recall whether I figured out why it happens or not. Does anybody know?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T13:50:54+00:00Added an answer on May 15, 2026 at 1:50 pm

    IIRC, it’s because a number of methods use the immediate caller for certain security checks. If you use Method.invoke to call these methods, then the caller of invoke is taken as the immediate caller. These methods are listed in section 6 of the current Java Secure Coding Guidelines.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is an example. foreach (var doc in documents) { var processor = this.factory.Create();
Here is the code in a function I'm trying to revise. This example works
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here is an example: I write html code inside of textarea, then I swap
Here's a piece of code I copied from http://www.schillmania.com/content/projects/javascript-animation-1/demo/ Very simple JS animation: function
Here is the code I'm using inside my AsyncTask DefaultHttpClient httpClient = new DefaultHttpClient();
Here is my persistence.xml : <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd version=1.0>
Here is my HTML. Just a simple form: <form> Username: <input type=text id=username/> <br/>
Here is my problem. Our tech. writer or customer service will often create new
Here's the code require_once 'functions.php'; require_once 'cfg.php'; $mysqli = new mysqli($dbhost, $dbuser, $dbpass, $db);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.