question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException with specific depedency

See original GitHub issue

Hello!

The following exception is thrown when I add metasoarous/oz in deps.edn and trying to build an uberjar:

Exception in thread "main" java.lang.NullPointerException
	at clojure.tools.deps.alpha.util.maven$make_session.invokeStatic(maven.clj:141)
	at clojure.tools.deps.alpha.util.maven$make_session.invoke(maven.clj:138)
	at clojure.tools.deps.alpha.extensions.maven$eval709$fn__711.invoke(maven.clj:76)
	at clojure.lang.MultiFn.invoke(MultiFn.java:244)
	at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:179)
	at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:161)
	at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:224)
	at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:206)
	at mach.pack.alpha.impl.tools_deps$parse_deps_map.invokeStatic(tools_deps.clj:77)
	at mach.pack.alpha.impl.tools_deps$parse_deps_map.invoke(tools_deps.clj:71)
	at mach.pack.alpha.capsule$_main.invokeStatic(capsule.clj:125)
	at mach.pack.alpha.capsule$_main.doInvoke(capsule.clj:101)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.core$apply.invokeStatic(core.clj:665)
	at clojure.main$main_opt.invokeStatic(main.clj:491)
	at clojure.main$main_opt.invoke(main.clj:487)
	at clojure.main$main.invokeStatic(main.clj:598)
	at clojure.main$main.doInvoke(main.clj:561)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:37)

Bellow is a minimal deps.edn that reproduces the issue:

{:deps {metasoarous/oz {:mvn/version "1.6.0-alpha5"}}
 :aliases {:pack {:extra-deps {pack/pack.alpha {:git/url "https://github.com/juxt/pack.alpha.git"
                                                :sha "81b9e47d992b17aa3e3af1a47aed1f0287ebe9b8"}}
                  :main-opts  ["-m"
                               "mach.pack.alpha.capsule"
                               "app.jar"
                               "-e" "target"
                               "--application-id" "app"
                               "--application-version" "\"1.0.0\""]}}}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:18

github_iconTop GitHub Comments

2reactions
SevereOverfl0wcommented, Oct 4, 2019

Great 😃 I’ve mentioned this upstream to t.d.a as well. I don’t think there’s anything they can do.

As a note, I’m not certain oz will work with that exclusion, you may wish to add that version of the oz dependency to the pack alias. That should mean it’s only excluded when building with pack, and is still included in your application.

here’s what I mean by example:

{:deps {metasoarous/oz {:mvn/version "1.6.0-alpha5"}}
 :aliases {:pack {:extra-deps {pack/pack.alpha {…}
                               metasoarous/oz {:mvn/version "1.6.0-alpha5"
                                               :exclusions [org.apache.maven/maven-aether-provider]}}}}}
2reactions
SevereOverfl0wcommented, Oct 4, 2019

Got it. Use this for oz instead:

metasoarous/oz {:mvn/version "1.6.0-alpha5"
                  :exclusions [org.apache.maven/maven-aether-provider]}
Read more comments on GitHub >

github_iconTop Results From Across the Web

versions:use-releases throws nullpointer exception for special ...
If we call versions:use-releases on a pom, where a dependencyManagement entry has no version tag (e.g. because it only sets scopes or ...
Read more >
PM71935: NULLPOINTEREXCEPTION DURING SERVER ...
During server startup the following NullPointerException is encountered when ... DURING SERVER STARTUP WHEN USING CONTEXT AND DEPENDENCY INJECTION (CDI) ...
Read more >
How to Handle NullPointerException in Java - freeCodeCamp
If you know for certain that a particular variable can never be null , then you can avoid adding the null check. This...
Read more >
1.12 fails with NullPointerException on missing dependency
Starting from 1.12 Gradle fails with NullPointerException as a reason on missing dependency: * What went wrong: Could not resolve all ...
Read more >
How to catch and fix a Guice dependency injection issue ...
RunTime Exceptions from Incorrect Dependency Injection Wiring. The code below fails at runtime with a NullPointerException. ‍. injector = Guice.createInjector( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found