plasma-umass / doppio

Breaks the browser language barrier (includes a plugin-free JVM).
http://plasma-umass.github.io/doppio-demo
MIT License
2.16k stars 174 forks source link

Native method getUptime not implemented #506

Closed amahdy closed 6 years ago

amahdy commented 6 years ago

Trying to run some code on doppiojvm and getting this exception:

Exception in thread "main" java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at doppio.JarLauncher.main(JarLauncher.java:34)
Caused by: java.lang.UnsatisfiedLinkError: Native method 'sun.management.VMManagementImpl.getUptime0()J' not implemented.
Please fix or file a bug at https://github.com/plasma-umass/doppio/issues
    at sun.management.VMManagementImpl.getUptime0(Native Method)
    at sun.management.VMManagementImpl.getUptime(VMManagementImpl.java:183)
    at sun.management.RuntimeImpl.getUptime(RuntimeImpl.java:113)
    at org.eclipse.jetty.util.log.Log.initialized(Log.java:170)
    at org.eclipse.jetty.util.log.Log.getLogger(Log.java:290)
    at org.eclipse.jetty.util.log.Log.getLogger(Log.java:280)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.<clinit>(AbstractLifeCycle.java:35)
    ... 5 more
jvilk commented 6 years ago

Why not issue a pull request to implement this? There's a tutorial on how to write native methods. You could either stub it to return a Long 0, or actually return the amount of time the user has been on the webpage / doppio has been running.