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

Add SBT uber-jar creation info #127

Open
AlexDBlack opened this issue Aug 28, 2018 · 3 comments
Open

Add SBT uber-jar creation info #127

AlexDBlack opened this issue Aug 28, 2018 · 3 comments

Comments

@AlexDBlack
Copy link
Contributor

Something that some SBT users run into is uber-jars that give a Nd4jBackend.NoAvailableBackendException, due to incorrect packaging with plugins like sbt-assembly plugin (for example, missing or not adding java service loader files under /META-INF/services/

Having something we can point users to for this would be useful.

Due Date

To be completed by: YYYY-MM-DD

Description

Write a short description of what needs to be done.

Assignees

Please ensure you have assigned at least one person to this issue. Include any authors and reviewers required.

@AlexDBlack
Copy link
Contributor Author

From gitter: Cause for one user was discard merge strategy removing all of the service loader files:

assemblyMergeStrategy in assembly := {
    case PathList("META-INF", xs @ _*) => MergeStrategy.discard
    case x => MergeStrategy.first
}   

Fixed by:

assemblyMergeStrategy in assembly := {
    case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
    case x => MergeStrategy.first
}

(Note that this discards the manifest file, which is probably OK in most cases, but not all)

tomlue added a commit to tomlue/dl4j_scala_troubleshoot that referenced this issue Aug 28, 2018
@crockpotveggies
Copy link
Contributor

@AlexDBlack where are you thinking we should put this? In this page? https://deeplearning4j.org/docs/latest/deeplearning4j-config-buildtools

@barrybecker4
Copy link

Thanks. The above fix worked for me. I was struggling with this for quite a while.
I saw it using sbt 1.3.8, sbt-assembly 0.14.10, and nd4j 1.0.0-beta3 and 1.0.0-beta6

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

3 participants