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

NullPointerException in AbstractResourceBuilder #223

Open
kevinsdooapp opened this issue Apr 13, 2017 · 5 comments

Comments

@kevinsdooapp
Copy link
Contributor

commented Apr 13, 2017

Hi,

Sometimes a NullPointerException is thrown during application launch. This exception break the application startup.

java.lang.NullPointerException: null at org.jrebirth.af.core.resource.builder.AbstractResourceBuilder.get(AbstractResourceBuilder.java:91) ~[dsdk-launcher.jar:na] at org.jrebirth.af.core.resource.builder.AbstractResourceBuilder.get(AbstractResourceBuilder.java:41) ~[dsdk-launcher.jar:na] at org.jrebirth.af.core.resource.i18n.MessageItemReal.get(MessageItemReal.java:96) ~[dsdk-launcher.jar:na] at org.jrebirth.af.core.resource.i18n.MessageItemBase.getText(MessageItemBase.java:53) ~[dsdk-launcher.jar:na] at org.jrebirth.af.core.application.AbstractApplication.initializeExceptionHandler(AbstractApplication.java:609) ~[dsdk-launcher.jar:na] at org.jrebirth.af.core.application.AbstractApplication.init(AbstractApplication.java:180) ~[dsdk-launcher.jar:na] at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841) [jfxrt.jar:na] at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182) [jfxrt.jar:na] at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_92]

@sbordes sbordes self-assigned this Apr 14, 2017
@sbordes sbordes added the bug label Apr 14, 2017
@sbordes sbordes added this to the 8.6.0 milestone Apr 14, 2017
@sbordes

This comment has been minimized.

Copy link
Member

commented Apr 14, 2017

With which version does it break ? What is the occurence (I've never experience it)

Did you use a FRench locale ?

Can you provide the full log ? You can filter org.jrebirth.af in your logback.xml.

@kevinsdooapp

This comment has been minimized.

Copy link
Contributor Author

commented Apr 21, 2017

The version used is 8.0.5. It do not use yet the last version because there is api change in it.
Anyway we had a look at the source code and it looks that the problem can also occur in last version.

The problem appear sometimes during launching. Yes, we use a french locale.

I'll add full log next time the problem appear ;)

@sbordes

This comment has been minimized.

Copy link
Member

commented Apr 21, 2017

OK I'll wait full log to investigate why this resource file cannot be loaded correctly.

Even I fix the potential NPE, it will not resolve the real trouble, the resource file is required to have right logs.

Does the problem appear only when app is launched from IDE ? or also in packaged way ?

@sbordes sbordes added the onhold label Jul 7, 2017
@sbordes sbordes modified the milestones: Undefined, 8.6.0 Jul 7, 2017
@amischler

This comment has been minimized.

Copy link

commented Jan 22, 2018

The issue appears randomly and relatively rarely with the packaged version of the application. Below another log extract :

[31m[WARN]	2018-01-12 09:21:07,924 c.d.i.c.ClasspathInitializer[0;39m [36m{JavaFX-Launcher}[0;39m - no  in java.library.path 
[39m[DEBUG]	2018-01-12 09:21:12,718 o.j.a.c.u.ClasspathUtility[0;39m [36m{JavaFX-Launcher}[0;39m - <jrebirth.util.useDefaultClassLoader> 
[34m[INFO]	2018-01-12 09:21:12,973 o.j.a.c.r.i.MessageBuilder[0;39m [36m{JavaFX-Launcher}[0;39m - 1 Messages file found. 
[34m[INFO]	2018-01-12 09:21:12,973 o.j.a.c.r.i.MessageBuilder[0;39m [36m{JavaFX-Launcher}[0;39m - Store ResourceBundle : Messages_rb  
[39m[DEBUG]	2018-01-12 09:21:12,974 o.j.a.c.u.ClasspathUtility[0;39m [36m{JavaFX-Launcher}[0;39m - <jrebirth.util.useDefaultClassLoader> 
[34m[INFO]	2018-01-12 09:21:13,482 o.j.a.c.r.p.ParameterBuilder[0;39m [36m{JavaFX-Launcher}[0;39m - 2 configuration files found. 
[34m[INFO]	2018-01-12 09:21:13,483 o.j.a.c.r.p.ParameterBuilder[0;39m [36m{JavaFX-Launcher}[0;39m - Read configuration file : jrebirth-config-prod.properties  
[34m[INFO]	2018-01-12 09:21:13,484 o.j.a.c.r.p.ParameterBuilder[0;39m [36m{JavaFX-Launcher}[0;39m - Read configuration file : jrebirth-config-prod.properties  
[39m[TRACE]	2018-01-12 09:21:13,575 o.j.a.c.c.AbstractJrbRunnable[0;39m [36m{JavaFX Application Thread}[0;39m - Run> Attach JAT Uncaught Exception Handler 
[1;31m[ERROR]	2018-01-12 09:21:13,578 o.j.a.c.a.AbstractApplication[0;39m [36m{JavaFX-Launcher}[0;39m - Error while initializing the application DsdkLauncher :  
java.lang.NullPointerException: null
	at org.jrebirth.af.core.resource.builder.AbstractResourceBuilder.get(AbstractResourceBuilder.java:91) ~[dsdk-launcher.jar:na]
	at org.jrebirth.af.core.resource.builder.AbstractResourceBuilder.get(AbstractResourceBuilder.java:41) ~[dsdk-launcher.jar:na]
	at org.jrebirth.af.core.resource.i18n.MessageItemReal.get(MessageItemReal.java:96) ~[dsdk-launcher.jar:na]
	at org.jrebirth.af.core.resource.i18n.MessageItemBase.getText(MessageItemBase.java:53) ~[dsdk-launcher.jar:na]
	at org.jrebirth.af.core.application.AbstractApplication.initializeExceptionHandler(AbstractApplication.java:609) ~[dsdk-launcher.jar:na]
	at org.jrebirth.af.core.application.AbstractApplication.init(AbstractApplication.java:180) ~[dsdk-launcher.jar:na]
	at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841) [jfxrt.jar:na]
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182) [jfxrt.jar:na]
	at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_141]

It looks like the issue happens when attaching the JAT Uncaught Exception Handler.

Does it help understanding what could be causing this issue ? Is it necessary a ressource loading issue or might it be a soft reference issue / threading issue in the AbstractResourceBuilder ?

@sbordes

This comment has been minimized.

Copy link
Member

commented Jan 22, 2018

It's probably linked to WeakHashMap behavior, on which kind of hardware does it occur ?
Perhaps switching paramsMap to basic HashMap will resolve the stuff but I've had to check that it won't break the auto releasable feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.