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


Permlink Replies: 7 - Pages: 1 - Last Post: 10 Nov 25, 19:48 Last Post By: RobM Threads: [ Previous | Next ]
kcrews

Posts: 3
Registered: 10-Jul-2025
ClassNotFound exception when trying to use new skin
Posted: 6 Nov 25, 21:28
 
  Click to reply to this thread Reply
I am using jalbum 38.

I created a new skin based on Plain, called it LCPlain. I created a new project and selected LCPlain. I dragged a folder of images into the new project and selected Make Album. jalbum said:

An unexpected error occurred. Please see detailed description below:

java.lang.RuntimeException: java.lang.ClassNotFoundException: lcplain.Zip
at org.openjdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:523)
at org.openjdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:415)
at org.openjdk.nashorn.api.scripting.NashornScriptEngine$1.eval(NashornScriptEngine.java:476)
at java.scripting/javax.script.CompiledScript.eval(Unknown Source)
at se.datadosen.jalbum.AlbumBean.processExpression(AlbumBean.java:3478)
at se.datadosen.jalbum.AlbumBean.processScript(AlbumBean.java:3400)
at se.datadosen.jalbum.AlbumBean.prepareMakeAlbum(AlbumBean.java:4070)
at se.datadosen.jalbum.AlbumBean.makeAlbum(AlbumBean.java:3704)
at se.datadosen.jalbum.AlbumBean.smartMakeAlbum(AlbumBean.java:3627)
at se.datadosen.jalbum.JAlbumFrame$7.run(JAlbumFrame.java:1210)
Caused by: java.lang.ClassNotFoundException: lcplain.Zip
at java.base/java.net.URLClassLoader.findClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at java.base/java.lang.Class.forName(Unknown Source)
at org.openjdk.nashorn.internal.runtime.Context.findClass(Context.java:1020)
at org.openjdk.nashorn.internal.objects.NativeJava.simpleType(NativeJava.java:543)
at org.openjdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:325)
at org.openjdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:317)
at org.openjdk.nashorn.internal.objects.NativeJava.type(NativeJava.java:313)
at org.openjdk.nashorn.internal.scripts.Script$9$init.:program(C:\Users\Linda\AppData\Roaming\JAlbum\skins\LCPlain\init.js:8)
at org.openjdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:646)
at org.openjdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:506)
at org.openjdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:519)
... 9 more
RobM

Posts: 3,948
Registered: 4-Aug-2006
Re: ClassNotFound exception when trying to use new skin
Posted: 6 Nov 25, 21:57   in response to: kcrews in response to: kcrews
 
  Click to reply to this thread Reply
I suspect you will need help from Laza. 'ClassNotFoundException: lcplain.Zip' indicates files in the skin's lib folder will need modifying.

Do you want this moving to the Plain skin forum?
JeffTucker

Posts: 8,062
Registered: 31-Jan-2006
Re: ClassNotFound exception when trying to use new skin
Posted: 6 Nov 25, 22:16   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Yes, I can "feel" that error. The defined class is almost certainly plain.zip. But with the change of the name to lcplain, it's now trying to use a class that doesn't exist.

But before heading down this complicated road, make sure you have a very good reason for creating a new skin. In most cases, you can just get all the settings the way you want them, and then save that as your default.
Laza

Posts: 1,419
Registered: 6-Sep-2005
Re: ClassNotFound exception when trying to use new skin
Posted: 7 Nov 25, 13:10   in response to: kcrews in response to: kcrews
 
  Click to reply to this thread Reply
Yes, I'm using the skin name to refer to the Main class. It works when I transplant the code from one skin to another, but it doesn't when one renames the skin. Fortunately, this doesn't happen frequently. Open the skin Editor (Ctrl-Shift-E), and replace this line in the init.js:
	Zip = Java.type(skin.toLowerCase().split(' ')[0] + ".Zip");

to this:
	Zip = Java.type("Plain.Zip");
Laza

Posts: 1,419
Registered: 6-Sep-2005
Re: ClassNotFound exception when trying to use new skin
Posted: 7 Nov 25, 13:11   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
By the way, this code also works if you use a new skin name, such as "Plain 2".
kcrews

Posts: 3
Registered: 10-Jul-2025
Re: ClassNotFound exception when trying to use new skin
Posted: 10 Nov 25, 19:42   in response to: Laza in response to: Laza
 
  Click to reply to this thread Reply
Thanks for the reply. It turns out that it needed to be plain.Zip (lower case p, upper case Z).

I would prefer not to create my own skin, but wanted to experiment without messing up the original.
kcrews

Posts: 3
Registered: 10-Jul-2025
Re: ClassNotFound exception when trying to use new skin
Posted: 10 Nov 25, 19:44   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Feel free to move it if that forum is a better place for it. I hadn't realized that this issue was specific to the plain skin.
RobM

Posts: 3,948
Registered: 4-Aug-2006
Re: ClassNotFound exception when trying to use new skin
Posted: 10 Nov 25, 19:48   in response to: kcrews in response to: kcrews
 
  Click to reply to this thread Reply
kcrews wrote:
Feel free to move it if that forum is a better place for it. I hadn't realized that this issue was specific to the plain skin.
This forum is fine now you have an answer, I’d have moved it if Laza hadn’t seen it - just to get his attention.
Legend
Forum admins
Helpful Answer
Correct Answer

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