Glenn, I don't understand your description: is there something for the recv() 
call to return, or is there not? Is there another 0mq socket that's connected 
and is sending stuff?

Are you trying to run your own program, or are these the stock tests 
distributed with jzmq? You should first focus on running the tests, according 
to the documentation; once that is known to work, you should move onto your own 
code.

You could also show us the full source of your tests (if indeed they are your 
own code).

--
Gonzalo Diethelm
DCV Chile

From: [email protected] 
[mailto:[email protected]] On Behalf Of Glenn LeMoine
Sent: Thursday, January 19, 2012 9:08 AM
To: ZeroMQ development list
Subject: Re: [zeromq-dev] Fwd: FW: Java Binding


I've reinstalled the DLLs and have checked that the versioning coincides. The 
application successfully opens the socket (see attached). Now, however; the 
socket.recv() method blocks as if there is nothing there. I stop the thread 
prior to the zmq_recv()  invocation to insure that there in fact activity on 
the socket. I understand that this is the desired behaviour as per the 
specification:

If there are no messages available on the specified socket the zmq_recv() 
function shall block until the request can be satisfied.
    Is there anything else i'm missing here? I'd really like to move beyond 
this seeming triviality and get to work.

    Thanks,  G




On Wed, Jan 18, 2012 at 2:07 PM, gonzalo diethelm 
<[email protected]<mailto:[email protected]>> wrote:
Make sure you don't have old versions of the DLL and JAR files lying around. 
Then, put your DLL file in the System32 directory, put your JAR file in the 
same directory where your main program is, adjust CLASSPATH accordingly and try 
running your program. If it works, you can start slowly unwinding this setup 
until you have everywhere placed wherever you want to.

HTH and best regards.

--
Gonzalo Diethelm
DCV Chile

From: 
[email protected]<mailto:[email protected]> 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Glenn LeMoine
Sent: Wednesday, January 18, 2012 2:52 PM
To: [email protected]<mailto:[email protected]>
Subject: [zeromq-dev] Fwd: FW: Java Binding



Guys,

I've successfully downloaded and compiled libzmq.dll as well as jzmq.dll in 
VS2008 on Windows XP 32bit. I've xcopied the libraries as well as the jars to 
C:\zmq\bin and C:\zmq\java respectively. I've added 
java.library.path=.;C:\zmq\java to my system variables. I've added ;C:\zmq\java 
to my classpath and I've added C:\zmq\bin to my Path. After several iterations 
on the command line, it seems that the zmq.jar cannot locate jzmq.dll as i get 
the following exception:

C:\Devel\zmq\zeromq-jzmq-4bdf011\perf>java local_lat 
tcp://127.0.0.1:5555<http://127.0.0.1:5555> 1 100
Exception in thread "main" java.lang.NoClassDefFoundError: org/zeromq/ZMQ
        at local_lat.main(local_lat.java:36)
Caused by: java.lang.ClassNotFoundException: org.zeromq.ZMQ
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)

I then tried copying the .dlls (libzmq,jzmq) into the C:\Windows\System32 
directory as well as to the C:\Devel\zmq\zeromq-jzmq-4bdf011\perf directory to 
no avail. On the latest attempt I opened up the project in eclipse and added 
the .dll as a native library. On this iteration, the zmq.jar successfully found 
the jzmq.dll as evidenced by successfully creating a context:


ZMQ.Context ctx = ZMQ.context (1);
ZMQ.Socket s = ctx.socket (ZMQ.REP);

        //  Add your socket options here.
        //  For example ZMQ_RATE, ZMQ_RECOVERY_IVL and ZMQ_MCAST_LOOP for PGM.
s.bind (bindTo);

Unfortunately, the thread dies when it reaches
for (int i = 0; i != roundtripCount; i++) {
            byte [] data = s.recv (0);

on ZMQ.context.recieve with no exception.

I'd appreciate help with the following two problems
1) Correctly declaring system and environment variables to run jzmq from the 
command line.
2) Diagnosing why the thread is dying when it reaches s.recv(0) (I haven't 
looked as of yet, but my hunch is that s.recv calls into libzmq.dll and i 
currently have it configured incorrectly.
Many Thanks

G

________________________________
Declaración de confidencialidad: Este Mensaje esta destinado para el uso de la 
o las personas o entidades a quien ha sido dirigido y puede contener 
información reservada y confidencial que no puede ser divulgada, difundida, ni 
aprovechada en forma alguna. El uso no autorizado de la información contenida 
en este correo podrá ser sancionado de conformidad con la ley chilena. Si usted 
ha recibido este correo electrónico por error, le pedimos eliminarlo junto con 
los archivos adjuntos y avisar inmediatamente al remitente, respondiendo este 
mensaje. Disclosure: This Message is to be used by the individual, individuals 
or entities that it is addressed to and may include private and confidential 
information that may not be disclosed, made public nor used in any way at all. 
Unauthorized use of the information in this electronic mail message may be 
subject to the penalties set forth by Chilean law. If you have received this 
electronic mail message in error, we ask you to destroy the message and its 
attached file(s) and to immediately notify the sender by answering this message.

_______________________________________________
zeromq-dev mailing list
[email protected]<mailto:[email protected]>
http://lists.zeromq.org/mailman/listinfo/zeromq-dev




----------------------------------------- 
Declaración de confidencialidad: Este Mensaje esta destinado para
el uso de la o las personas o entidades a quien ha sido dirigido y
puede contener información reservada y confidencial que no puede
ser divulgada, difundida, ni aprovechada en forma alguna. El uso no
autorizado de la información contenida en este correo podrá ser
sancionado de conformidad con la ley chilena. 
Si usted ha recibido este correo electrónico por error, le pedimos
eliminarlo junto con los archivos adjuntos y avisar inmediatamente
al remitente, respondiendo este mensaje. 

"Before printing this e-mail think if is really necesary".
Disclosure: This Message is to be used by the individual,
individuals or entities that it is addressed to and may include
private and confidential information that may not be disclosed,
made public nor used in any way at all. Unauthorized use of the
information in this electronic mail message may be subject to the
penalties set forth by Chilean law. 
If you have received this electronic mail message in error, we ask
you to destroy the message and its attached file(s) and to
immediately notify the sender by answering this message. 
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to