Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reflection invoke fails with System.MissingMethodException #647

Open
martinwebrant opened this issue Jan 8, 2025 · 0 comments
Open

Reflection invoke fails with System.MissingMethodException #647

martinwebrant opened this issue Jan 8, 2025 · 0 comments

Comments

@martinwebrant
Copy link

Reflection does not work as expected. This is a minimal repro based on a bug found in a project that used the java based Rhino JavaScript engine.

    public static void testToString() throws Exception {
      String test = "test";
      test.getClass().getMethod("toString").invoke(test);
    }
Unhandled Exception: System.MissingMethodException: Method not found: '?'.
   at __<FastMethodAccessor>__java_lang_String__toString(Object , Object[] , CallerID )
   at IKVM.Java.Externs.sun.reflect.ReflectionFactory.FastMethodAccessorImpl.invoke(Object obj, Object[] args, CallerID callerID)
   at java.lang.reflect.Method.invoke(Object obj, Object[] args, CallerID )
   at testikvm.Main.testToString() in Main.java:line 10
   at Program.Main(String[] args) in d:\opensource\testikvm\ConsoleApp1\Program.cs:line 7

Here is a test project:
testikvm.zip
Use

dotnet build
ConsoleApp1\bin\Debug\net472\ConsoleApp1.exe

Reproduced with latest version 8.11.0-pre.2 - this works with winward and older jeroen versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant