This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 10 - Pages: 1 - Last Post: 14-Feb-2020 01:13 Last Post By: ctwist Threads: [ Previous | Next ]
ctwist

Posts: 595
Registered: 27-Sep-2003
texts not initialized when opening jAlbum
Posted: 19-May-2018 22:37
 
  Click to reply to this thread Reply
Attachment texts.properties (6.4 KB)
Attachment SkinUI.java (27.9 KB)
When I start jAlbum, I sometimes get this error (maybe 20% of the time). My default skin is Mirage and it fails on the statement
isLangDocumented = (texts.getString("ui.tManualDownload").equalsIgnoreCase("true") ? true : false);
It seems that texts has not yet been initialised. If I then evaluate
texts.getString("ui.tManualDownload")
in system console, it correctly evaluates to false.

This problem started recently, probably in 15.3 or 15.4.
se.datadosen.util.ScriptException: bsh.TargetError: Sourced file: inline evaluation of: ``// Mirage skin - onload.bsh    if (MgUtil.fCompareVersion("10.4") == -1)  { engi . . . '' : Object constructor : at Line: 11 : in file: inline evaluation of: ``// Mirage skin - onload.bsh    if (MgUtil.fCompareVersion("10.4") == -1)  { engi . . . '' : new SkinUI ( engine ) 
 
Target exception: java.lang.NullPointerException
 in onload.bsh at line number 11
	at se.datadosen.util.ScriptException.of(ScriptException.java:59)
	at se.datadosen.jalbum.AlbumBean.processScript(AlbumBean.java:2424)
	at se.datadosen.jalbum.JAlbumFrame.executeScript(JAlbumFrame.java:1204)
	at se.datadosen.jalbum.JMainSettingsPanel$5$1.run(JMainSettingsPanel.java:310)
Caused by: javax.script.ScriptException: bsh.TargetError: Sourced file: inline evaluation of: ``// Mirage skin - onload.bsh    if (MgUtil.fCompareVersion("10.4") == -1)  { engi . . . '' : Object constructor : at Line: 11 : in file: inline evaluation of: ``// Mirage skin - onload.bsh    if (MgUtil.fCompareVersion("10.4") == -1)  { engi . . . '' : new SkinUI ( engine ) 
 
Target exception: java.lang.NullPointerException
 in inline evaluation of: ``// Mirage skin - onload.bsh    if (MgUtil.fCompareVersion("10.4") == -1)  { engi . . . '' at line number 11
	at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:90)
	at bsh.BshScriptEngine.eval(BshScriptEngine.java:57)
	at javax.script.AbstractScriptEngine.eval(Unknown Source)
	at se.datadosen.jalbum.AlbumBean.doProcessExpression(AlbumBean.java:2493)
	at se.datadosen.jalbum.AlbumBean.processExpression(AlbumBean.java:2468)
	at se.datadosen.jalbum.AlbumBean.processScript(AlbumBean.java:2422)
	... 2 more
Caused by: java.lang.NullPointerException
	at SkinUI.<init>(SkinUI.java:61)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at bsh.Reflect.constructObject(Reflect.java:574)
	at bsh.BSHAllocationExpression.constructObject(BSHAllocationExpression.java:125)
	at bsh.BSHAllocationExpression.objectAllocation(BSHAllocationExpression.java:114)
	at bsh.BSHAllocationExpression.eval(BSHAllocationExpression.java:62)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
	at bsh.BSHBlock.evalBlock(BSHBlock.java:130)
	at bsh.BSHBlock.eval(BSHBlock.java:80)
	at bsh.BSHBlock.eval(BSHBlock.java:46)
	at bsh.BSHIfStatement.eval(BSHIfStatement.java:51)
	at bsh.Interpreter.eval(Interpreter.java:672)
	at bsh.Interpreter.eval(Interpreter.java:766)
	at bsh.Interpreter.eval(Interpreter.java:755)
	at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:82)
	... 7 more


Edited by: ctwist on 23-May-2018 13:36
davidekholm

Posts: 3,702
Registered: 18-Oct-2002
Re: texts not initialized when opening jAlbum
Posted: 21-May-2018 09:29   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Weird. The failing line looks like this:
    isLangDocumented = (texts.getString("ui.tManualDownload").equalsIgnoreCase("true") ? true : false);
Please split it into several lines so we can conclude exactly what causes the nullpointer exception. As far as I can tell, the nullpointer exception could only be caused by a missing "texts" object, cause getting a missing text key should throw a MissingResource exception.

Please update your lib/jalbum-core.jar with this one: http://jalbum.net/download/beta/jalbum-core.jar
Now set Debug level under Preferences to FINE and load your skins a couple of times. Watch out for error prints to the system console now, especially any MissingResourceException.
ctwist

Posts: 595
Registered: 27-Sep-2003
Re: texts not initialized when opening jAlbum
Posted: 21-May-2018 17:15   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Attachment log.txt (3.8 KB)
An updated SkinUI.java is attached.

The console log is attached.
davidekholm

Posts: 3,702
Registered: 18-Oct-2002
Re: texts not initialized when opening jAlbum
Posted: 21-May-2018 22:37   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
Still missing the updated SkinUI.java file
ctwist

Posts: 595
Registered: 27-Sep-2003
Re: texts not initialized when opening jAlbum
Posted: 21-May-2018 23:30   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
I attached it to the first message in the thread.
davidekholm

Posts: 3,702
Registered: 18-Oct-2002
Re: texts not initialized when opening jAlbum
Posted: 22-May-2018 13:40   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
I attached it to the first message in the thread.

I couldn't know that you updated that one. Well, it seems like "texts" is missing, not that it isn't initialized. This should trigger the word MissingResourceException to be printed to the system console, but I see no such log. Did you update lib/jalbum-core.jar with the latest beta and set logging level to FINE?

Also, please change your SkinUI.java code so it extends CompiledBase instead of the now deprecated CompiledScript
ctwist

Posts: 595
Registered: 27-Sep-2003
Re: texts not initialized when opening jAlbum
Posted: 22-May-2018 17:36   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Well, it seems like "texts" is missing, not that it isn't initialized.
texts does exist. Refer to my first message; I successfully evaluated texts.getString().
Did you update lib/jalbum-core.jar with the latest beta and set logging level to FINE?
Yes
Also, please change your SkinUI.java code so it extends CompiledBase instead of the now deprecated CompiledScript.
It's on my todo list, but it won't happen for a while.

This error only occurs when I open jAlbum. If I then open a Mirage project, it opens without errors.
davidekholm

Posts: 3,702
Registered: 18-Oct-2002
Re: texts not initialized when opening jAlbum
Posted: 23-May-2018 10:22   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
ctwist wrote:
davidekholm wrote:
Well, it seems like "texts" is missing, not that it isn't initialized.
texts does exist. Refer to my first message; I successfully evaluated texts.getString().

According to the log it fails on line 62 with a nullpointer exception:
Caused by: java.lang.NullPointerException
	at SkinUI.<init>(SkinUI.java:62)
Inspecting line 62, it reads:
		Set vKeys = texts.getKeys();
Perhaps it behaves differently from the system console? Anyway, a null texts object could be the only cause really.

Did you update lib/jalbum-core.jar with the latest beta and set logging level to FINE?
Yes

Then please copy and paste the logging from the system console again cause there should now really be a MissingResourceException printed somewhere. That's (as far as I can see) the only thing that could cause a null texts object.

Also, please change your SkinUI.java code so it extends CompiledBase instead of the now deprecated CompiledScript.
It's on my todo list, but it won't happen for a while.

It's should be a 1-minute operation

This error only occurs when I open jAlbum. If I then open a Mirage project, it opens without errors.

Do you mean you have Mirage as the default skin and it only happens when jAlbum+Mirage opened at the same time?
ctwist

Posts: 595
Registered: 27-Sep-2003
Re: texts not initialized when opening jAlbum
Posted: 23-May-2018 19:47   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
Attachment log.txt (3.8 KB)
davidekholm wrote:
Then please copy and paste the logging from the system console again cause there should now really be a MissingResourceException printed somewhere. That's (as far as I can see) the only thing that could cause a null texts object.
Done. The log is the same as the previous log.
Also, please change your SkinUI.java code so it extends CompiledBase instead of the now deprecated CompiledScript.
It's should be a 1-minute operation
Done.
It took a lot longer than 1 minute and now the skin fails to make an album. Anyway, SkinUI.java is re-attached.
Do you mean you have Mirage as the default skin and it only happens when jAlbum+Mirage opened at the same time?
Yes.
davidekholm

Posts: 3,702
Registered: 18-Oct-2002
Re: texts not initialized when opening jAlbum
Posted: 23-May-2018 20:02   in response to: ctwist in response to: ctwist
 
  Click to reply to this thread Reply
A total mystery. I installed Mirage from the skin repo and made it the default skin, then restarted jAlbum at least 10 times. Works every time :-(
ctwist

Posts: 595
Registered: 27-Sep-2003
Re: texts not initialized when opening jAlbum
Posted: 14-Feb-2020 01:13   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
I haven't seen this error for a loooooooong time.

Closed.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums