0

freeBSD サーバーで Java ファイルを起動したいと考えています。そして、これは彼が私に言うことです:

    ossnode2# java Telnet_MSS_Sub
    java.net.SocketException: Invalid argument
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:316)
    at                   java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:177)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:164)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:354)
    at java.net.Socket.connect(Socket.java:574)
    at java.net.Socket.connect(Socket.java:524)
    at java.net.Socket.<init>(Socket.java:421)
    at java.net.Socket.<init>(Socket.java:204)
    at  org.apache.commons.net.DefaultSocketFactory.createSocket(DefaultSocketFactory.java:53)
    at org.apache.commons.net.SocketClient.connect(SocketClient.java:162)
    at Telnet_MSS_Sub.<init>(Telnet_MSS_Sub.java:32)
    at Telnet_MSS_Sub.main(Telnet_MSS_Sub.java:221)
       End of telnet
      java.lang.NullPointerException
    at org.apache.commons.net.telnet.TelnetClient.disconnect(TelnetClient.java:125)
    at Telnet_MSS_Sub.disconnect(Telnet_MSS_Sub.java:200)
    at Telnet_MSS_Sub.main(Telnet_MSS_Sub.java:223)
     com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

     ** BEGIN NESTED EXCEPTION **

     java.net.SocketException
      MESSAGE: Invalid argument

     STACKTRACE:

     java.net.SocketException: Invalid argument
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:316)
    at              java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:177)
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:164)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:354)
    at java.net.Socket.connect(Socket.java:574)
    at java.net.Socket.connect(Socket.java:524)
    at java.net.Socket.<init>(Socket.java:421)
    at java.net.Socket.<init>(Socket.java:237)
    at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
    at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:271)
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:2771)
    at com.mysql.jdbc.Connection.<init>(Connection.java:1555)
    at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:285)
    at java.sql.DriverManager.getConnection(DriverManager.java:620)
    at java.sql.DriverManager.getConnection(DriverManager.java:200)
    at Telnet_MSS_Sub.main(Telnet_MSS_Sub.java:293)


    ** END NESTED EXCEPTION **



        Last packet sent to the server was 4 ms ago.

freeBSD で実行する前にコンパイルします。JVMは正常にインストールされたと思います。同じファイルが Windows で実行されます。誰でも助けることができますか?

4

1 に答える 1

2
java -Djava.net.preferIPv4Stack=true Telnet_MSS_Sub
于 2012-09-14T09:56:51.903 に答える