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


Permlink Replies: 5 - Pages: 1 - Last Post: 04-Jan-2015 22:06 Last Post By: CLOSED_USER
CLOSED_USER

Posts: 121
Registered: 19-Mar-2008
Curious exception when making albums
Posted: 04-Jan-2015 01:08
 
  Click to reply to this thread Reply
I did not make a new album for a while, so my system has changed a bit. But I think the only major change is updating to Yosemite. However, I am no longer able to make an album using BananAlbum, I get this error:

Stack trace for jAlbum 12.3.9 using skin BananAlbum_v6 :
javax.script.ScriptException: bsh.TargetError: Sourced file: inline evaluation of:
``                 template = new File(skinDirectory, "menu.htt");                 . . . '' :
Method Invocation engine.processTemplateFile : at Line: 4 : in file: inline evaluation of:
``                 template = new File(skinDirectory, "menu.htt");                 . . . '' :
engine .processTemplateFile ( template , outp ) 
 
Target exception: javax.script.ScriptException: bsh.ParseException:
Parse error at line 59, column 21.  Encountered: } in inline evaluation of:
``    import java.text.CharacterIterator;  import java.text.StringCharacterIterato . . . ''
at line number 59 in inline evaluation of:
``                 template = new File(skinDirectory, "menu.htt");                 . . . ''
at line number 4
	at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:97)
	at bsh.BshScriptEngine.eval(BshScriptEngine.java:61)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at se.datadosen.jalbum.AlbumBean.doProcessExpression(AlbumBean.java:2090)
	at se.datadosen.jalbum.TemplateParser.eval(TemplateParser.java:720)
	at se.datadosen.jalbum.TemplateParser.handleScriptlet(TemplateParser.java:667)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:189)
	at se.datadosen.jalbum.TemplateParser.handleIfElse(TemplateParser.java:416)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:179)
	at se.datadosen.jalbum.TemplateParser.handleScriptlet(TemplateParser.java:674)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:189)
	at se.datadosen.jalbum.TemplateParser.handleScriptlet(TemplateParser.java:674)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:189)
	at se.datadosen.jalbum.TemplateParser.handleScriptlet(TemplateParser.java:674)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:189)
	at se.datadosen.jalbum.TemplateParser.handleIfElse(TemplateParser.java:413)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:179)
	at se.datadosen.jalbum.TemplateParser.handleExpressionLanguage(TemplateParser.java:648)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:191)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:156)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:147)
	at se.datadosen.jalbum.AlbumBean.makeIndexPages(AlbumBean.java:2692)
	at se.datadosen.jalbum.AlbumBean.makeAlbumForFolder(AlbumBean.java:1123)
	at se.datadosen.jalbum.AlbumBean.makeAlbum(AlbumBean.java:2294)
	at se.datadosen.jalbum.AlbumBean.smartMakeAlbum(AlbumBean.java:2236)
	at se.datadosen.jalbum.JAlbumFrame$11.run(JAlbumFrame.java:947)
Caused by: javax.script.ScriptException: bsh.ParseException:
Parse error at line 59, column 21.  Encountered: } in inline evaluation of:
``    import java.text.CharacterIterator;  import java.text.StringCharacterIterato . . . ''
at line number 59
	at bsh.BshScriptEngine.evalSource(BshScriptEngine.java:93)
	at bsh.BshScriptEngine.eval(BshScriptEngine.java:61)
	at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
	at se.datadosen.jalbum.AlbumBean.doProcessExpression(AlbumBean.java:2090)
	at se.datadosen.jalbum.TemplateParser.eval(TemplateParser.java:720)
	at se.datadosen.jalbum.TemplateParser.handleScriptlet(TemplateParser.java:667)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:189)
	at se.datadosen.jalbum.TemplateParser.handleIfElse(TemplateParser.java:402)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:179)
	at se.datadosen.jalbum.TemplateParser.handleExpressionLanguage(TemplateParser.java:648)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:191)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:156)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:147)
	at se.datadosen.jalbum.TemplateParser.parseElements(TemplateParser.java:130)
	at se.datadosen.jalbum.AlbumBean.processTemplateFile(AlbumBean.java:891)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at bsh.Reflect.invokeMethod(Reflect.java:146)
	at bsh.Reflect.invokeObjectMethod(Reflect.java:79)
	at bsh.Name.invokeMethod(Name.java:859)
	at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:75)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102)
	at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47)
	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:89)
	... 25 more


Any ideas anyone?
jGromit

Posts: 33,198
Registered: 31-Jan-2006
Re: Curious exception when making albums
Posted: 04-Jan-2015 02:32   in response to: CLOSED_USER in response to: CLOSED_USER
Helpful
  Click to reply to this thread Reply
I'm not getting that error - same setup, with Yosemite, jAlbum 12.3.9, and a fresh install of BananAlbum. If reinstalling the skin doesn't fix it, please attach your project file here (jalbum-settings.jap). Maybe it's being triggered by some particular combination of settings.
CLOSED_USER

Posts: 121
Registered: 19-Mar-2008
Re: Curious exception when making albums
Posted: 04-Jan-2015 09:43   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
jGromit, you are right, I just tested the normal version of BananAlbum and it works fine with 12.3.9 and Yosemite.

Apparently I broke something when making modifications to the skin files to improve some things... Ill start debugging.
CLOSED_USER

Posts: 121
Registered: 19-Mar-2008
Re: Curious exception when making albums
Posted: 04-Jan-2015 11:32   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
The issues was in the menu.htt file.

I modified the original lines:
if (filesForCount.length > 0) loadaction = "loadalbum";
if (filesForCount.length > 0) filescount = filesForCount.length + 0;
else filescount = 0;

to:
if (filesForCount.length > 0) {
    loadaction = "loadalbum";
    filescount = filesForCount.length + 0;}
else {filescount = 0};


Which broke the skin because of a typo, the '}' in the else was before the ';' ..

All works well now.
jGromit

Posts: 33,198
Registered: 31-Jan-2006
Re: Curious exception when making albums
Posted: 04-Jan-2015 13:30   in response to: CLOSED_USER in response to: CLOSED_USER
 
  Click to reply to this thread Reply
Easy mistake to make. Actually, you don't need the curly braces on the else statement at all:
if (filesForCount.length > 0) {
    loadaction = "loadalbum";
    filescount = filesForCount.length + 0;
}
else filescount = 0;
But your modification doesn't change anything - it will produce exactly the same results as the original code. So I'm not sure why you modified the original code in the first place.
CLOSED_USER

Posts: 121
Registered: 19-Mar-2008
Re: Curious exception when making albums
Posted: 04-Jan-2015 21:30   in response to: jGromit in response to: jGromit
 
  Click to reply to this thread Reply
That was of course not the only modification, merely one to keep the code style more consistent.
In the original skin code some of the indentation is incorrect as it does not match the depth of code (for loops/functions/if statements). So in trying to figure out what was part of what I tried to make most thing more readable, and I prefer to use brackets in if-else statements in Java code, even for one liners, that also makes it easier to expand later..
Legend
Forum admins
Helpful Answer
Correct Answer

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