My favorites | Sign in
Project Home Downloads Issues Source
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 808: ClassCastException when doing a headless library scan
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Closed:  Jan 2011

Sign in to add a comment
Reported by, Jul 27, 2010
What steps will reproduce the problem?
1. Run PMS headless (e.g. on Linux: java -Xmx768M -Xss16M -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava
.net.preferIPv4Stack=true -classpath "$PMS_JARS" net.pms.PMS "$@"

2. Start "scan folders" via the web interface

What is the expected output? What do you see instead?

from debug.log:

Exception in thread "Thread-224" java.lang.ClassCastException: net.pms.gui.DummyFrame cannot be cast to net.pms.newgui.LooksFrame
 at net.pms.dlna.RootFolder.scan(

What version of the product are you using? On what operating system?
1.20.409 on a QNAP NAS (running Linux)

Please provide any additional information below and PLEASE JOIN debug.log file !!

While in long run it would be great if the UI could be separated from the server (PMS on a NAS is a really magnificent combination), a short term solution would be the following patch:

Index: net/pms/dlna/
--- net/pms/dlna/	(revision 410)
+++ net/pms/dlna/	(working copy)
@@ -29,6 +29,7 @@
 import net.pms.PMS;
 import net.pms.configuration.RendererConfiguration;
 import net.pms.dlna.virtual.VirtualFolder;
+import net.pms.gui.IFrame;
 import net.pms.newgui.LooksFrame;
@@ -82,7 +83,11 @@
 		defaultRenderer = RendererConfiguration.getDefaultConf();
-		((LooksFrame) PMS.get().getFrame()).getFt().setScanLibraryEnabled(true);
+		IFrame frame = PMS.get().getFrame();
+		if (frame instanceof LooksFrame) {
+			LooksFrame looksframe = (LooksFrame)frame;
+			looksframe.getFt().setScanLibraryEnabled(true);
+		}

Sep 29, 2010
Project Member #1
(No comment was entered for this change.)
Status: Started
Owner: shagr4th
Jan 17, 2011
Project Member #2
Thanks. Applied in r413.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting