Installing and running ZeroMQ

Home / Uncategorized / Installing and running ZeroMQ

Question:
I am trying to install ZeroMQ on my pc but i can not make my program run without crashing. The installation:1) install Visual Studio 2017.

2) clone from git jzmq and libzmq

3) install ZMQ version 4.0.4 for windows.

4) run the script build in: libzmqbuildsmsvcbuildbuild.bat

5) open in Visual Studio 2017: libzmqbuildsmsvcvs2017libzmq.sln and jzmqjzmq-jnibuildsmsvcmsvc.sln.

6) rebuild in the Visual Studio 2017 the sln files:
+ libzmq.sln : in the properties: configuration: Active(DebugDLL) platform: Active(x64)

+ msvc.sln : in the properties: configuration:Release platform: Active(x64)
label VC++ Directories: update the include directories and Library directories,
label Linker -> Input: update the Additional Dependencies with – C:git-repolibzmqbinx64Debugv141dynamiclibzmq.lib;%(AdditionalDependencies)

7) put the libzmq.dll and the jzmq.dll in the system32 folder.

After i finished with the installation I try to run simple Java example to see if everything is working: the java code: import org.zeromq.ZMQ;
import java.nio.charset.Charset;

public class TestMainClass {

public static void main(String[] args){
try {
ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket replier = context.socket(ZMQ.REP);
replier.bind("tcp://*:5559");

while (true) {

String gwSource = replier.recvStr(Charset.defaultCharset());

replier.send("OK");

System.out.println(gwSource);
}
}catch (Throwable e) {
System.out.println(e);
}
}

}
import org.zeromq.ZMQ;

public class Requester {

public static void main(String[] args){
ZMQ.Context context = ZMQ.context(1);
ZMQ.Socket replier = context.socket(ZMQ.REQ);
replier.connect("tcp://localhost:5559");

while (true) {

replier.send("public");

System.out.println(new String(replier.recv()));

}
}

}

4.0.0

com.test.hagar
hagarTestRealTick
current-SNAPSHOT



org.zeromq
jzmq
3.1.0

the consul output:
for TestMainClass :"C:Program FilesJavajdk1.8.0_121binjava" -Xcheck:jni -verbose:jni "-javaagent:C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2017.2.1libidea_rt.jar=57531:C:Program FilesJetBrainsIntelliJ IDEA Community Edition 2017.2.1bin" -Dfile.encoding=UTF-8 -classpath "C:Program FilesJavajdk1.8.0_121jrelibcharsets.jar;C:Program FilesJavajdk1.8.0_121jrelibdeploy.jar;C:Program FilesJavajdk1.8.0_121jrelibextaccess-bridge-64.jar;C:Program Fil
WARNING in native method: JNI call made without checking exceptions when required to from CallLongMethodV
at org.zeromq.ZMQ$Socket.construct(Native Method)
at org.zeromq.ZMQ$Socket.(ZMQ.java:1719)
at org.zeromq.ZMQ$Context.socket(ZMQ.java:451)
at TestMainClass.main(TestMainClass.java:11)

[Dynamic-linking native method org.zeromq.ZMQ$Socket.bind … JNI] [Dynamic-linking native method org.zeromq.ZMQ$Socket.recv … JNI]
Process finished with exit code -1073740791 (0xC0000409)

for Requester :
[Registering JNI native method java.lang.System.arraycopy]
[Dynamic-linking native method java.lang.Thread.registerNatives … JNI]
[Registering JNI native method java.lang.Thread.start0]
WARNING in native method: JNI call made without checking exceptions when required to from CallLongMethodV
at org.zeromq.ZMQ$Socket.construct(Native Method)
at org.zeromq.ZMQ$Socket.(ZMQ.java:1719)
at org.zeromq.ZMQ$Context.socket(ZMQ.java:451)
at Requester.main(Requester.java:8)
[Dynamic-linking native method org.zeromq.ZMQ$Socket.connect … JNI]
[Dynamic-linking native method org.zeromq.ZMQ$Socket.send … JNI]
[Dynamic-linking native method org.zeromq.ZMQ$Socket.recv … JNI]

the program crash after the TestMainClass try to receive a response and print: Process finished with exit code -1073740791 (0xC0000409)

I think something i wrong in the installation that causes the fail but i can not find the problem.


Answer:

Read more

Leave a Reply

Your email address will not be published. Required fields are marked *