Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

traci4matlab installation failed #4

Open
shuowang572875852 opened this issue Feb 21, 2019 · 3 comments
Open

traci4matlab installation failed #4

shuowang572875852 opened this issue Feb 21, 2019 · 3 comments

Comments

@shuowang572875852
Copy link

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
Copy link

mnour94 commented Mar 28, 2020

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

@kelly7707
Copy link

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

@Han21-yes
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants