javamatlabsocketszeromqjeromq

Error running mvn package for jeromq: "Bind Cannot assign requested address: connect"


I want to send and receive data from Matlab and MetaTrader 5 on Windows 10. According to this post, JeroMQ is the easiest route to go:

 [ERROR] Failures:
 [ERROR] TestEvents.testEventConnectRetried:85 No event was received
 [ERROR] Errors:
 [ERROR] PollTest.testPollUdp:100 » Bind Cannot assign requested address: 
 connect
 [INFO]
 [ERROR] Tests run: 588, Failures: 1, Errors: 1, Skipped: 17
 [INFO]
 [INFO] ------------------------------------------------------------------------
 [INFO] BUILD FAILURE
 [INFO] ------------------------------------------------------------------------
 [INFO] Total time: 04:48 min
 [INFO] Finished at: 2019-09-12T18:51:01+02:00
 [INFO] ------------------------------------------------------------------------
 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project jeromq: There are test failures.    

I tried to fix this by setting the IP configuration for the localhost to 127.0.0.1 according to these posts:

which did not fix the problem (same error message).

I think it is related to some IP settings, but I am new to socket communication. I have no experience in Java programming/debugging. Please help me to fix this, so the .jar file is built successfully and I can add it to my javaclasspath in Matlab.

Otherwise: Is there an (easy) alternative way to establish Matlab socket communication with other programs (e.g. via ZeroMQ)?


Solution

  • I had the same problem, to bypass the tests, you need to add some code to the pom.xml file which is at the main folder jeromq-masters.

    So the part that I changed is below. You can compare with your own pom and change it according to it. Since a couple of days passed, I dont exactly remember the part that I added,but starting with "includes" must be the part that I added.

    <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.1</version>
        <configuration>
          <useSystemClassLoader>false</useSystemClassLoader>
          <includes>
            <include>TestFail.java</include>
          </includes>
          <testFailureIgnore>true</testFailureIgnore>
        </configuration>
    

    Then you need to recompile it with mvn package command.

    This allowed me to compile the JAR file.