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
The scaffolding tutorial fails with java.lang.UnsatisfiedLinkError: Can't obtain static newInstance method for class com.sun.jna.Structure at com.sun.jna.Native.initIDs #131
Comments
Sounds like some sort of JNA problem, but I haven't seen this before so I'm not sure. Perhaps your system java doesn't use that libjna? |
It does sound like that indeed; but I thought JNA is a self-containing .jar? Do I need any special dance for openjdk to use JNA? (I'll google for sure and will report if/when solved, it's just if you happen to know, that'd be great) |
One more question... at https://github.com/aphyr/jepsen, you say that one needs to install |
JNA itself seems to be fine: alexey@instance-1:~/jna-test$ cat HelloWorld.java
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.Platform;
/** Simple example of JNA interface mapping and usage. */
public class HelloWorld {
// This is the standard, stable way of mapping, which supports extensive
// customization and mapping of Java to native types.
public interface CLibrary extends Library {
CLibrary INSTANCE = (CLibrary)
Native.loadLibrary((Platform.isWindows() ? "msvcrt" : "c"),
CLibrary.class);
void printf(String format, Object... args);
}
public static void main(String[] args) {
CLibrary.INSTANCE.printf("Hello, World\n");
for (int i=0;i < args.length;i++) {
CLibrary.INSTANCE.printf("Argument %d: %s\n", i, args[i]);
}
}
}
alexey@instance-1:~/jna-test$ javac -classpath /usr/share/java/jna.jar HelloWorld.java
alexey@instance-1:~/jna-test$ java -classpath /usr/share/java/jna.jar:. HelloWorld
Hello, World
alexey@instance-1:~/jna-test$ |
The JNA in the maven repo isn't:
It seems that it might make sense to upgrade JNA in jepsen dependencies... |
Changing the project file to (defproject jepsen.hazelcast "0.1.0-SNAPSHOT"
:description "Jepsen: Hazelcast"
:url "http://www.kamchatkaltd.co.uk/jepsen-hazelcast"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[jepsen "0.0.9" :exclude net.java.dev.jna/jna]
[avout "0.5.4"]
[net.java.dev.jna/jna "4.1.0"]]) seems to do the trick. |
Yep, it does... @aphyr, will it make any sense to adjust the tutorial and/or the dependencies? I solved the problem for myself by overriding the dependency, but am happy to dig further, e.g. finding a compatible version of jsch. |
Looks like this jna dep is required by com.jcraft/jsch.agentproxy.usocket-jna, which is pulled in by clj-ssh 0.5.14, so if you're having compatibility problems with that jna package, perhaps it's worth filing a ticket on jsch? Since this has (so far) worked for other users, I'm hesitant to add a dep exclusion that could break that support--but I also don't understand JNA that well so I could be wrong. |
java.lang.ExceptionInInitializerError How to solution this error |
java.lang.ExceptionInInitializerError how to solution of this error ??? rep me |
Sounds like your JVM doesn't have JNA set up? |
Trying to follow https://github.com/aphyr/jepsen/blob/master/doc/scaffolding.md, got the following problem at the step "Next, we'll replace the example test that lein generated (test/jepsen/zookeeper_test.clj) with one that calls the zk-test function, runs the test that function returns, looks at the results, and ensures that the :valid? key is true."
The stack trace is as follows:
(I did call the test
jepsen.hazelcast
, but otherwise it's the same dummy test)The system is as follows:
The text was updated successfully, but these errors were encountered: