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

Jar Bt #43

Closed
rafael-vieira-coelho opened this issue Nov 29, 2017 · 24 comments
Closed

Jar Bt #43

rafael-vieira-coelho opened this issue Nov 29, 2017 · 24 comments
Labels

Comments

@rafael-vieira-coelho
Copy link

Hi, where can i download the jar file to put in my project to use your library? Thanks.

@atomashpolskiy
Copy link
Owner

@rafael-vieira-coelho , you may download all jars from the central Maven repository

@rafael-vieira-coelho
Copy link
Author

rafael-vieira-coelho commented Nov 30, 2017 via email

@rafael-vieira-coelho
Copy link
Author

Hi, @atomashpolskiy.

I downloaded the jar files and tried the example in the main page of Bt GitHub, but keeps getting an error with Module class from Google's Guice. I even trieded to add Guice jar to the project but didn't work. Could you help me?

Att.

@atomashpolskiy
Copy link
Owner

You may find the dependencies for each jar in its' META-INF/MANIFEST.MF file.

E.g. for bt-core-1.6-SNAPSHOT:

Class-Path: bt-bencoding-1.6-SNAPSHOT.jar snakeyaml-1.17.jar slf4j-api
 -1.7.21.jar guice-4.1.0.jar javax.inject-1.jar aopalliance-1.0.jar gu
 ava-19.0.jar guice-multibindings-4.1.0.jar

But it's usually a lot easier to just use Maven or Gradle to manage the dependencies. Check out the Maven's starting guide, for instance: https://maven.apache.org/guides/getting-started/

@rafael-vieira-coelho
Copy link
Author

Now it worked the dependencies, but the example of creating a BtClient doesn't work. It's constructor only accepts storage. That example is deprecated?

BtClient client = Bt.client()
                    .config(config)
                    .storage(storage)
                    .magnet(magnet_uri)
                    .autoLoadModules()
                    .module(dhtModule)
                    .stopWhenDownloaded()
                    .build();

@atomashpolskiy
Copy link
Owner

Yeah, please use the code from the readme. I probably forgot to update the docs for this matter :)

@atomashpolskiy
Copy link
Owner

Disregard my previous comment, your piece of code should work. What does the compiler say?

@rafael-vieira-coelho
Copy link
Author

"method client in classe Bt cannot be applied to given type: required Storage, found no arguments"

@rafael-vieira-coelho
Copy link
Author

I used version 1.5 of Bt.

@atomashpolskiy
Copy link
Owner

This is weird, because the message is obviously wrong: https://github.com/atomashpolskiy/bt/blob/master/bt-core/src/main/java/bt/Bt.java. Would you mind elaborating more on your environment: JDK/javac version, IDE, etc.?

@rafael-vieira-coelho
Copy link
Author

Sure, i am using Netbeans with javac 9.0.1 (JDK Project is 8). I added bt-dht, bt-http-tracker-client, bt-core, bt-bencoding, bt-cli jars.

@rafael-vieira-coelho
Copy link
Author

JDK 1.8

@rafael-vieira-coelho
Copy link
Author

The class that appears to import for BtClient is from bt.runtime.BtClient. Shouldn't be from bt.BtClient?

@atomashpolskiy
Copy link
Owner

Remove bt-cli from the classpath, if you've downloaded it from Central. It's not published in binary form since 1.1, and the outdated version must be causing conflicts. It's not needed for Bt operation anyways, it's just a standalone app.

@rafael-vieira-coelho
Copy link
Author

Thanks, @atomashpolskiy. That's it!

@rafael-vieira-coelho
Copy link
Author

Just another doubt: in Bt there is a way to create a torrent file from files in the computer?

@atomashpolskiy
Copy link
Owner

Of course, there's a method in the client builder: torrent(URL)

@atomashpolskiy
Copy link
Owner

See this class: https://github.com/atomashpolskiy/bt/blob/master/bt-core/src/main/java/bt/TorrentClientBuilder.java . All methods are available in the object returned by Bt.client() invocation.

@rafael-vieira-coelho
Copy link
Author

rafael-vieira-coelho commented Dec 1, 2017 via email

@rafael-vieira-coelho
Copy link
Author

The method that receives an URL isn't for opening a torrent file? I was wondering if there is a method to create a torrent file from files in the computer.

@rafael-vieira-coelho
Copy link
Author

rafael-vieira-coelho commented Dec 2, 2017

Another thing, i got a warning: [bt.service.executor-thread-1] WARN bt.torrent.TrackerAnnouncer - Tracker URL protocol is not supported: http://tracker.trackerfix.com:80/announce. Do you know how could i fix that? That means that the torrent file uses another protocol?

@atomashpolskiy
Copy link
Owner

@rafael-vieira-coelho ,

The method that receives an URL isn't for opening a torrent file? I was wondering if there is a method to create a torrent file from files in the computer.

Yes, it's for opening a .torrent file. The latter is a feature that I'd really like to see in Bt, but it's not present at the moment.

Another thing, i got a warning: [bt.service.executor-thread-1] WARN bt.torrent.TrackerAnnouncer - Tracker URL protocol is not supported: http://tracker.trackerfix.com:80/announce. Do you know how could i fix that? That means that the torrent file uses another protocol?

Make sure that bt-http-tracker-client module is present in the runtime (either it's available on the classpath and auto-loading is turned on OR it's contributed manually in the runtime builder).

@rafael-vieira-coelho
Copy link
Author

I just get these messages from log:
[JavaFX Application Thread] INFO bt.runtime.BtRuntimeBuilder - Auto-loading module bt.peerexchange.PeerExchangeModule with default configuration
[JavaFX Application Thread] INFO bt.runtime.BtRuntimeBuilder - Auto-loading module bt.tracker.http.HttpTrackerModule with default configuration
[JavaFX Application Thread] INFO bt.runtime.BtRuntimeBuilder - Overriding auto-loaded module bt.dht.DHTModule
[bt.net.pool.incoming-acceptor] INFO bt.net.PeerConnectionPool - Opening server channel for incoming connections @ /127.0.0.1:6968

@atomashpolskiy
Copy link
Owner

Very strange, can you set a breakpoint in bt.tracker.TrackerService#isSupportedProtocol and check, if there is an entry for key http in trackerFactories map variable?

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

No branches or pull requests

2 participants