the8472 / mldht

Bittorrent Mainline DHT implementation in java
Mozilla Public License 2.0
147 stars 45 forks source link

mldht doesn't seem to run, no errors but client can't connect #21

Closed ghost closed 6 years ago

ghost commented 6 years ago
voltagex@devbox:~/src/mldht/src$ java -Xdebug -Xrunjdwp:transport=dt_socket,address=127.0.0.1:10044,server=y,suspend=n  -cp "../target/*:../target/dependency/*" the8
472.mldht.Launcher
Listening for transport dt_socket at address: 10044

(in another tmux tab)

voltagex@devbox:~/src/mldht/src$ java -Xdebug -cp ./lib/*:$DIR/../target/* the8472.mldht.cli.Client "$@"
Exception in thread "main" java.net.ConnectException: Connection refused
        at java.base/sun.nio.ch.Net.connect0(Native Method)
        at java.base/sun.nio.ch.Net.connect(Net.java:454)
        at java.base/sun.nio.ch.Net.connect(Net.java:446)
        at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648)
        at java.base/java.nio.channels.SocketChannel.open(SocketChannel.java:194)
        at the8472.mldht.cli.Client.<init>(Client.java:31)
        at the8472.mldht.cli.Client.main(Client.java:92)
the8472 commented 6 years ago

if you want to use the CLI you need to enable that component

https://github.com/the8472/mldht#optional-components

ghost commented 6 years ago

@the8472 apologies for my inability to read there.

I've uncommented it in the config but I still get errors running the command.

the8472 commented 6 years ago

Check if it's listening on port 33348

ghost commented 6 years ago

I did a git clean -fdx, rebuilt with maven, then re-ran the server after uncommenting the components in config.xml

voltagex@devbox:~/src/mldht/work$ java -cp "../target/*:../target/dependency/*" the8472.mldht.Launcher

voltagex@devbox:~/src/mldht/work$ sudo netstat -lp | grep java
udp6       0      0 fd10:41ad:2767:0::49001 [::]:*                              1926/java
udp6       0      0 2001-44b8-31aa-db:49001 [::]:*                              1926/java
voltagex@devbox:~/src/mldht/work$ java -Xdebug -cp ./lib/*:$DIR/../target/* the8472.mldht.cli.Client "$@"
Error: Could not find or load main class the8472.mldht.cli.Client
Caused by: java.lang.ClassNotFoundException: the8472.mldht.cli.Client
the8472 commented 6 years ago

then re-ran the server after uncommenting the components in config.xml

did you restart the server after changing the .xml? only some config options are picked up on file changes

not listening on that port

check logs/exceptions.log. although it should print to stderr if it tries to load the component but fails to bind the port for some reason, so it's more likely that it's not even trying to load it.

Caused by: java.lang.ClassNotFoundException: the8472.mldht.cli.Client

different error than previously. you now seem to be specifying the classpath incorrectly.

the8472 commented 6 years ago

closing due to inactivity