[zeromq-dev] Native error

Michael Scofield bayinamine at gmail.com
Wed Nov 6 06:57:41 CET 2013


On 2013?11?05? 21:01, Manuel Irribarra wrote:
> Hi everyone,
>
>     I wrote a simple web application:
>
> Context context = ZMQ.context(workers);
> Socket backend = context.socket(ZMQ.DEALER);
> backend.bind(Constants.SOCKET);
> Worker worker = null;
> for (int i = 0; i < workers; i++) {
>     worker = new Worker(i, context, contextConfig);
>     worker.start();
> }
>
>     Where workers is a int param read from file, and contextConfig is 
> a object containt information about configuration.
>
>     The class Worker is a thread, with run method (with line numbers):
>
> 87  public void run() {
> 88      final Socket reply = context.socket(ZMQ.REP);
> 89      reply.connect(Constants.SOCKET);
>         :
>         :
> 121 }
>
>     Now, when I deploy the application in Weblogic 10.3.4, I'm getting 
> error of this type (the Errno number can be 156384765 (0x9523dfd) too ):
>
> 05-11-2013 09:54:45 AM cl.altiuz.reports.zmq.controller.Worker run
> Exception in thread "Thread-11" org.zeromq.ZMQException: Errno 61(0x3d)
>     at org.zeromq.ZMQ$Socket.mayRaise(ZMQ.java:268)
>     at org.zeromq.ZMQ$Socket.connect(ZMQ.java:947)
>     at cl.altiuz.reports.zmq.controller.Worker.run(Worker.java:89)
>
> I'm using:
>
> Oracle Java JDK 1.6 update 45
> Oracle Weblogic Application Server 11gR1 (10.3.4)
> jeromq-0.3.0
>
> What's is wrong?
>
> Regards,
>
> -- 
> *Manuel A. Irribarra Frex*
> *Ingeniero de Desarrollo*
> Altiuz Soluciones Tecnológicas de Negocios Ltda.
> Av. Nueva Tajamar 555 Of. 802, Las Condes - CP 7550099
> +56 2 2335 2461
> mirribarra at altiuz.cl <mailto:mirribarra at altiuz.cl>
> http://www.altiuz.cl
> http://www.altiuzreports.com 	<https://www.facebook.com/altiuz> 
> <http://twitter.com/altiuz> <http://www.linkedin.com/company/altiuz>
>
> 	
>
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
Hi, I've just created a minimal test case(plz refer to the codes at the 
end of this mail), and everything works fine.

Errno 61 means ECONNREFUSED(ZMQ.java line64), so I guess the problem is 
caused by your malformed "Constants.SOCKET".


import org.zeromq.ZMQ;

public class Test {

     private static final String SOCKET = "inproc://test";

     public static class Worker extends Thread {

         private int id;

         private ZMQ.Context context;

         public Worker(int id, ZMQ.Context context) {
             this.id = id;
             this.context = context;
         }

         @Override
         public void run() {
             final ZMQ.Socket reply = context.socket(ZMQ.REP);
             reply.connect(SOCKET);
             System.out.println(id + " " + context);
         }
     }

     public static void main(String[] args) {
         int workers = 10;
         ZMQ.Context context = ZMQ.context(workers);
         ZMQ.Socket backend = context.socket(ZMQ.DEALER);
         backend.bind(SOCKET);
         Worker worker;
         for (int i = 0; i < workers; i++) {
             worker = new Worker(i, context);
             worker.start();
         }
     }
}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20131106/63c90618/attachment.html>


More information about the zeromq-dev mailing list