joeferner / node-java

Bridge API to connect with existing Java APIs.
MIT License
1.88k stars 282 forks source link

Reentry from proxy sometimes fails #177

Open mhfrantz opened 9 years ago

mhfrantz commented 9 years ago

I've demonstrated a stable failure when attempting to reenter the JVM from a proxy. I added a unit test to demonstrate:

https://github.com/mhfrantz/node-java/commit/3678f6bf7284e863d1d5bdb6aa7e20092210464f

On my system, the iterator.equalsSync call succeeds, while the iterator.hasNextSync call fails like so:

java.lang.IllegalAccessException: Class node.NodeDynamicProxyClass can not access a member of class java.util.ArrayList$Itr with modifiers "public"

(I also added a non-reentrant unit test, java-ArrayList-test.js, to show that my code ought to work.)

Any idea whether reentry has known limitations?

bayareagreg commented 9 years ago

Matt did you ever find the answer to your question? I am running into the same issue

mhfrantz commented 9 years ago

I just rebased to the latest master, but still get the same failure. My unit test is now here:

https://github.com/joeferner/node-java/commit/ecd54bf35d68c1bb268309e6971d4cfc7777fca1