My favorites | Sign in
Project Home Downloads Issues Source
New issue   Search
for
  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
Owner:  shagr...@gmail.com
Closed:  Jan 2011


Sign in to add a comment
 
Reported by thomas.i...@gmail.com, 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(RootFolder.java:85)
 at net.pms.dlna.DLNAMediaDatabase.run(DLNAMediaDatabase.java:624)
 at java.lang.Thread.run(Thread.java:619)

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/RootFolder.java
===================================================================
--- net/pms/dlna/RootFolder.java	(revision 410)
+++ net/pms/dlna/RootFolder.java	(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 @@
 		refreshChildren();
 		defaultRenderer = RendererConfiguration.getDefaultConf();
 		scan(this);
-		((LooksFrame) PMS.get().getFrame()).getFt().setScanLibraryEnabled(true);
+		IFrame frame = PMS.get().getFrame();
+		if (frame instanceof LooksFrame) {
+			LooksFrame looksframe = (LooksFrame)frame;
+			looksframe.getFt().setScanLibraryEnabled(true);
+		}
 		PMS.get().getDatabase().cleanup();
 		PMS.get().getFrame().setStatusLine(null);
 	}


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

Powered by Google Project Hosting