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

settings -Dreactor.trace.operatorStacktrace=true obtain NullPointerException #985

Closed
kevin70 opened this issue Dec 14, 2017 · 2 comments
Closed
Labels
type/bug A general bug
Milestone

Comments

@kevin70
Copy link

kevin70 commented Dec 14, 2017

Expected behavior

Success

Actual behavior

Caused by: java.lang.NullPointerException
	at reactor.core.publisher.Hooks.onEachOperator(Hooks.java:100)
	at reactor.core.publisher.Hooks.onEachOperator(Hooks.java:69)
	at reactor.core.publisher.Hooks.<clinit>(Hooks.java:476)

Steps to reproduce

  1. Mono.just("hello").subscribe()
  2. settings -Dreactor.trace.operatorStacktrace=true
  3. Running programs

Reactor Core version

reactor-core:3.1.2.RELEASE

JVM version (e.g. java -version)

jdk1.8.0_121

OS version (e.g. uname -a)

Windows

Initialization of variable order problems
Hooks.java#L471

Hooks.java#L516

Initialization globalTrace log The instance has not been created yet, cause NullPointerException

@simonbasle
Copy link
Member

Issue in Chinese, yeah sure 🤔
Can you translate that in full into English please @kevin70? Otherwise I will close.

@kevin70
Copy link
Author

kevin70 commented Dec 14, 2017

@simonbasle ok

@kevin70 kevin70 changed the title 设置 -Dreactor.trace.operatorStacktrace=true 得到 NullPointerException settings -Dreactor.trace.operatorStacktrace=true obtain NullPointerException Dec 14, 2017
@smaldini smaldini added this to the 3.1.3.RELEASE milestone Dec 14, 2017
@smaldini smaldini added the type/bug A general bug label Dec 14, 2017
simonbasle added a commit that referenced this issue Dec 15, 2017
This commit fixes an NPE and subsequent initialization error when the
debug mode is activated through the `reactor.trace.operatorStacktrace`
System property, by correctly reordering the static fields and blocks.

Additionally, the debug mode via command line also uses the correct
hook key, so that activating via System property then deactivating via
Hooks method would work.

Finally, this behavior is tested as an additional test task in Gradle,
ensuring the property is set and no previous classloading of Hooks has
been done by other tests.
simonbasle added a commit that referenced this issue Dec 18, 2017
This commit fixes an NPE and subsequent initialization error when the
debug mode is activated through the `reactor.trace.operatorStacktrace`
System property, by correctly reordering the static fields and blocks.

Additionally, the debug mode via command line also uses the correct
hook key, so that activating via System property then deactivating via
Hooks method would work.

Finally, this behavior is tested as an additional test task in Gradle,
ensuring the property is set and no previous classloading of Hooks has
been done by other tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants