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.

Print stream not initialized in DefaultUpdateHandler

See original GitHub issue

Hello @mordechaim - I’m encountering some kind of initialization problem that kicks of a NPE which prevents me from understanding why the update is failing.

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.io.PrintStream.println(String)" because "this.out" is null
        at org.update4j.service.DefaultUpdateHandler.clearln(DefaultUpdateHandler.java:153)
        at org.update4j.service.DefaultUpdateHandler.failed(DefaultUpdateHandler.java:74)
        at org.update4j.ConfigImpl.doUpdate(ConfigImpl.java:396)
        at org.update4j.Configuration.update(Configuration.java:915)
        at org.update4j.service.DefaultBootstrap.updateFirst(DefaultBootstrap.java:206)
        at org.update4j.service.DefaultBootstrap.main(DefaultBootstrap.java:147)
        at org.update4j.Bootstrap.start(Bootstrap.java:297)
        at org.update4j.Bootstrap.start(Bootstrap.java:280)
        at org.update4j.Bootstrap.start(Bootstrap.java:182)
        at org.update4j.Bootstrap.main(Bootstrap.java:113)

This is a fairly standard wrapper / business setup and I am inclined to believe that it could be a module-related problem, as it only happens when making an update using a custom jlinked JRE. The JRE is jlinked from Corretto and the release details are

JAVA_VERSION="17.0.0.35.1"
MODULES="java.base java.datatransfer java.xml java.prefs java.desktop java.logging java.management java.security.sasl java.naming java.net.http java.scripting java.transaction.xa java.sql jdk.crypto.ec jdk.jsobject jdk.unsupported jdk.unsupported.desktop jdk.xml.dom"

So what am I looking at? Is this a PBKAC? Am I missing a module that update4j requires but was afraid to ask? 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mordechaimcommented, Dec 2, 2021

This was fixed in #142 but I never got around to releasing it. Check out this conversation.

1reaction
mordechaimcommented, Dec 2, 2021

If you’re not using the archive update mechanism your shouldn’t have required the module I first place. Am I missing something?

I’m reopening this issue so I’ll remember to do a release when I get around.

Read more comments on GitHub >

github_iconTop Results From Across the Web

java.lang.NullPointerException: Cannot invoke "java.io ...
ConfigImpl line 396 "handler.failed(t)" internally calls the DefaultUpdateHandler.clearln. This printStream has not yet been initialized, ...
Read more >
java - A PrintStream that does nothing - Stack Overflow
The problem is in the initialisation order. Static fields are initialised in the order that you have declared them ("textual order"), ...
Read more >
PrintStream (Java Platform SE 7 ) - Oracle Help Center
Creates a new print stream. This stream will not flush automatically. Parameters: out - The output stream to which values and objects will...
Read more >
Java PrintStream Class - CodeGym
Today we'll talk about the Java PrintStream class and everything it can do. Actually, you are already familiar with two methods.
Read more >
java.io.PrintStream.<init> java code examples | Tabnine
Popular methods of PrintStream ... Put the line separator String onto the print stream. ensureOpen. Check to make sure that the stream has...
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