pipeacosta / traci4matlab

An implementation of the Traffic Control Interface for Matlab
BSD 2-Clause "Simplified" License
12 stars 15 forks source link

traci4matlab installation failed #4

Open shuowang572875852 opened 5 years ago

shuowang572875852 commented 5 years ago

After installing traci4matlab, running traci_test.m has the following error: 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); 错误使用 traci.Socket/connect (line 25) Java exception occurred: java.net.ConnectException: Connection refused: connect

at java.net.DualStackPlainSocketImpl.connect0(Native Method)

at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)

at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)

at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)

at java.net.Socket.connect(Socket.java:589)

at java.net.Socket.connect(Socket.java:538) 出错 matlab.internal.lang.fwdSubsref (line 4) [varargout{1:nargout}] = subsref(A,s);

出错 traci.init (line 65) connections(label).connect(host, port);

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init(); MATLAB:Java:GenericExceptionJava exception occurred: java.net.SocketException: Socket is not connected

at java.net.Socket.getInputStream(Socket.java:905) 结构体内容引用自非结构体数组对象。

出错 traci.sendExact (line 19) activeConnection.dos.writeInt(len);

出错 traci.getVersion (line 23) result = traci.sendExact();

出错 traci.init

出错 traci_test (line 24) [traciVersion,sumoVersion] = traci.init();

and the commandline display : Loading configuration... done. Starting server on port 8873 Error: tcpip::Socket::accept() Unable to create listening socket: Address already in use Quitting (on error).

D:\Program Files\matlab\R2017b\toolbox\traci4matlab\traci4matlab\examples>

During the installation process in Step 3"Adding the additional dependencies to the Matlab’s static Java path", my javaclasspath.txt is "D:\Program Files\matlab\R2017b\toolbox\traci4matlab\traci4matlab\traci4matlab.jar" and the "D:\Program Files\matlab\R2017b\toolbox\traci4matlab\traci4matlab" is the path to the root folder of TraCI4Matlab. How can i do for it?

mnour94 commented 4 years ago

did you happen to find a solution for this issue? I have the same problem.

kelly7707 commented 2 years ago

any solution? I also have the same problem. Thanks in advance.

Han21-yes commented 1 year ago

Try to restart Matlab to make the new static Java path takes effect.