SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #61  
Old 11-18-2005, 05:04 PM
salsbst's Avatar
salsbst salsbst is offline
SageTVaholic
 
Join Date: Jun 2003
Posts: 2,592
I tried it. So this works on your system, deria? Strange.

SageTV is unable to find your Java class on my machine. I've tried various things.

Wild guess... does it have to do with the fact that the class is in the default package (aka root namespace)?

I don't think that hunting down JNI issues is relevant right now. Do you consider the source code of your Java class to be private? If not, you might want to post it. One of us should be able to at least get the class loaded by SageTV.
Reply With Quote
  #62  
Old 11-18-2005, 05:06 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Hi Bob,

Yes, try adding that key to the registry. I belive its value should be set to the path that the BasicSystemMonitor.dll file is in (so, basically, "c:\program files\sagetv\sagetv" on most systems). On your system it will be different since you installed to a non-standard path. I don't have that key on my system either, but Jeff said it would influence the path so its worth a shot.

Regarding the Filemon, did you see all the other output (like a bazillion lines of text) or did the window stay blank? If its not blank, and you ran the system monitor from inside sagetv (far enough to either get the errors or see the blank display with close/configure at the bottom) can you send me the entire log?
Reply With Quote
  #63  
Old 11-18-2005, 05:08 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Thanks salsbst,

I was begining to think it was just me. I have a friend at work that breaks things whenever he touches them and I thought he might be influencing me!

BobP.
Reply With Quote
  #64  
Old 11-18-2005, 05:13 PM
salsbst's Avatar
salsbst salsbst is offline
SageTVaholic
 
Join Date: Jun 2003
Posts: 2,592
One of the QC guys in our office is able to break pretty much anything, and it's not always because the system or device was flawed to begin with. He just has the magic touch.

We tease him that he's not allowed to sit on any of our chairs.
Reply With Quote
  #65  
Old 11-18-2005, 05:13 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by deria
Hi Bob,

Yes, try adding that key to the registry. I belive its value should be set to the path that the BasicSystemMonitor.dll file is in (so, basically, "c:\program files\sagetv\sagetv" on most systems). On your system it will be different since you installed to a non-standard path. I don't have that key on my system either, but Jeff said it would influence the path so its worth a shot.

Regarding the Filemon, did you see all the other output (like a bazillion lines of text) or did the window stay blank? If its not blank, and you ran the system monitor from inside sagetv (far enough to either get the errors or see the blank display with close/configure at the bottom) can you send me the entire log?
Yes I will email you the log little big to post. I started SageTV first then Filemon then selected the "Disk Utilization". Note I was using the VirtualPC version for this so all default paths - it's the MCE2k5 version that is non-standard and I haven't done the filemon on that do you want me to? Will try to add the key shortly.

BobP.
Reply With Quote
  #66  
Old 11-18-2005, 05:16 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Quote:
Originally Posted by salsbst
I tried it. So this works on your system, deria? Strange.

SageTV is unable to find your Java class on my machine. I've tried various things.

Wild guess... does it have to do with the fact that the class is in the default package (aka root namespace)?

I don't think that hunting down JNI issues is relevant right now. Do you consider the source code of your Java class to be private? If not, you might want to post it. One of us should be able to at least get the class loaded by SageTV.
Hi salbst,

The code of the java class isn't private at all. In fact, the code of the entire plugin is open source. The java class is trivial (its like 30 lines) -- I'll post it right here in this message.

To answer your question, yes, it works on my systems (both of them) and also on another test system that belongs to a friend, and even Jeff @ SageTV was able to get it working on his. It just doesn't seem to work for anyone else. Jeff had me create a test class and run that from the command line which is where we see the problem. Basically Java starts up fine, the class is loaded, the JNI .dll is loaded -- thats all fine. Its the BasicSystemMonitor.dll file itself thats unable to be found.

Here is the code. If you have any insights, I'd like to hear. them. This issue is driving me crazy.

Code:
public class SystemMonitorPlugin
{
	static
	{
		System.loadLibrary("SystemMonitorJNI");
	}

	/** Creates a new instance of SystemMonitorPlugin */
	public SystemMonitorPlugin()
	{
	}
	
	public native void Startup();
	public native void Shutdown();
	public native String GetDiskUsageText();
	public native java.awt.Image GetDiskspaceImage();
	public native void SetExcludeList(String ExcludeList);
	public native void SetAlarmLimit(String AlarmLimit);
	public native int GetPluginVersion();
	public native String GetPluginTitle();
	public native String GetPluginCategory();
	public native String GetPluginDescription();
	public native int RegisterEvent(String EventName, String EventData);
	public native void SetStartupDelay(String StartupDelay);
	public native void SetPluginHost(String PluginHost);
	public native void SetBorderThickness(String BorderThickness);
	public native void SetOutlineColorByName(String ColorName);
	public native void SetImageFile(String ImageFile);
	public native void SetTextColorByName(String ColorName);
	public native void SetLabelFontSize(String FontSize);
	public native void SetGraphItemBackgroundColorByName(String ColorName);
	public native void SetGraphItemClearColorByName(String ColorName);
	public native void SetGraphItemWarningColorByName(String ColorName);
	public native void SetGraphItemAlarmColorByName(String ColorName);
	public native void SetBorderDrawing(boolean YesNo);
	public native void SetGraphTitle(String GraphTitle);
	public native void SetTextualMessage(String TextualMessage);
	public native int GetDriveCount();
	public native void Refresh();
	public native void RecreateGraphicalSummary();
	public native void RecreateTextualSummary();
	public native void SetRefreshRateInMinutes(String RefreshFrequency);

	private long nativePtr;
}
That's the whole class. Everything that actually does any work is located in BasicSystemMonitor.dll (thats the managed .NET code). The trouble is that it can't find the assembly to actually do it. The test code Jeff had me create is this:

Code:
public class SystemMonitorPlugin
{
	static
	{
		System.loadLibrary("SystemMonitorJNI");
	}

	/** Creates a new instance of SystemMonitorPlugin */
	public SystemMonitorPlugin()
	{
	}

	public static void main(String[] args)
	{
		System.out.println("In main now.");
		System.out.println("Creating plugin.");
		SystemMonitorPlugin smp = new SystemMonitorPlugin();
		System.out.println("Running startup.");
		smp.Startup();
		System.out.println("Calling GetDiskUsageText().");
		System.out.println("Text=" + smp.GetDiskUsageText());
		System.out.println("Shutting down.");
		smp.Shutdown();
	}
	
	public native void Startup();
	public native void Shutdown();
	public native String GetDiskUsageText();
	public native java.awt.Image GetDiskspaceImage();
	public native void SetExcludeList(String ExcludeList);
	public native void SetAlarmLimit(String AlarmLimit);
	public native int GetPluginVersion();
	public native String GetPluginTitle();
	public native String GetPluginCategory();
	public native String GetPluginDescription();
	public native int RegisterEvent(String EventName, String EventData);
	public native void SetStartupDelay(String StartupDelay);
	public native void SetPluginHost(String PluginHost);
	public native void SetBorderThickness(String BorderThickness);
	public native void SetOutlineColorByName(String ColorName);
	public native void SetImageFile(String ImageFile);
	public native void SetTextColorByName(String ColorName);
	public native void SetLabelFontSize(String FontSize);
	public native void SetGraphItemBackgroundColorByName(String ColorName);
	public native void SetGraphItemClearColorByName(String ColorName);
	public native void SetGraphItemWarningColorByName(String ColorName);
	public native void SetGraphItemAlarmColorByName(String ColorName);
	public native void SetBorderDrawing(boolean YesNo);
	public native void SetGraphTitle(String GraphTitle);
	public native void SetTextualMessage(String TextualMessage);
	public native int GetDriveCount();
	public native void Refresh();
	public native void RecreateGraphicalSummary();
	public native void RecreateTextualSummary();
	public native void SetRefreshRateInMinutes(String RefreshFrequency);

	private long nativePtr;
}
The point of failure is in the call to Startup(), which is a function in the BasicSystemMonitor.dll file. When the .dll search fails to find the .dll, the JVM crashes. If I put the .dll somewhere in my machines search path, it works fine.

The interesting thing is that SageTV on my system automatically looks in the right place. On BobPheonix's machine, it doesn't. What I was hoping to see when BobPheonix ran the Filemon tool was a list of where it was looking for the .dll so that we could see if it worked by putting the file into one of those locations.
Reply With Quote
  #67  
Old 11-18-2005, 05:18 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Quote:
Originally Posted by BobPhoenix
Yes I will email you the log little big to post. I started SageTV first then Filemon then selected the "Disk Utilization". Note I was using the VirtualPC version for this so all default paths - it's the MCE2k5 version that is non-standard and I haven't done the filemon on that do you want me to? Will try to add the key shortly.

BobP.
Hi Bob,

Filemon is a pretty low-level tool, so it may not work with Virtual PC (or may not work reliably). If you can, please do try it on your regular PC.
Reply With Quote
  #68  
Old 11-18-2005, 05:20 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Quote:
Originally Posted by salsbst
Wild guess... does it have to do with the fact that the class is in the default package (aka root namespace)?
I'm not any kind of a java programmer. I can follow the syntax because its very close to C, but I don't have the faintest idea what the above statement means. Still, I posted the code so you can probably tell from that.
Reply With Quote
  #69  
Old 11-18-2005, 05:25 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Just so we are on the same page about the NativeLibPath

Should be something like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common]
"IRTunerPluginsDir"="C:\\Program Files\\SageTV\\Common"
"consolewin"=dword:00000001
"NativeLibPath"="C:\\Program Files\\SageTV\\SageTV"

Correct?

BobP.
Reply With Quote
  #70  
Old 11-18-2005, 05:25 PM
salsbst's Avatar
salsbst salsbst is offline
SageTVaholic
 
Join Date: Jun 2003
Posts: 2,592
I can't find the source code. You don't mean the .class file, do you? That's not source code.

EDIT: nevermind, I see it above.
Reply With Quote
  #71  
Old 11-18-2005, 05:26 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by deria
Hi Bob,

Filemon is a pretty low-level tool, so it may not work with Virtual PC (or may not work reliably). If you can, please do try it on your regular PC.
Will do and this one I'll zip up for you.

BobP.
Reply With Quote
  #72  
Old 11-18-2005, 05:28 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Salbst,

It occurs to me that there could really be two problems here. You mentioned that SageTV wasn't finding the class itself on your system. Is there a way that you can be sure of that?

I received the Filemon log from Bob, and on his system it does find and open the file containing the class (SystemMonitorPlugin.class) but (at least on his virtual pc) never searched for the .dll. Perhaps when he runs it on his regular PC we'll see something different.

This is a crazy issue to track down.

Would the version of Java make a difference? I'm using the latest. I would assume that once compiled, any version of java should be able to find/use the class. That is an assumption on my part, though.
Reply With Quote
  #73  
Old 11-18-2005, 05:29 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Quote:
Originally Posted by BobPhoenix
Just so we are on the same page about the NativeLibPath

Should be something like:
[HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common]
"IRTunerPluginsDir"="C:\\Program Files\\SageTV\\Common"
"consolewin"=dword:00000001
"NativeLibPath"="C:\\Program Files\\SageTV\\SageTV"

Correct?

BobP.
That's what I would expect. Jeff didn't specify in his email exactly what it should look like, but I would say that what you have is a reasonable assumption.
Reply With Quote
  #74  
Old 11-18-2005, 05:40 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Hi Salbst,

To see if its really finding the class or not on your system, you might want to try replacing Startup() with an actual java method. I'm not sure if you can do any type of visual feedback (ie: like debugging output) when the class is run by Sage, but thats about the only way I can think of to see if its finding the class at all.
Reply With Quote
  #75  
Old 11-18-2005, 05:43 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
The log from MCE2K5 machine is on its way - did forget to change the subject line when I replied - sorry about that.

BobP.
Reply With Quote
  #76  
Old 11-18-2005, 05:44 PM
salsbst's Avatar
salsbst salsbst is offline
SageTVaholic
 
Join Date: Jun 2003
Posts: 2,592
Quote:
Originally Posted by deria
Salbst,

It occurs to me that there could really be two problems here. You mentioned that SageTV wasn't finding the class itself on your system. Is there a way that you can be sure of that?

I received the Filemon log from Bob, and on his system it does find and open the file containing the class (SystemMonitorPlugin.class) but (at least on his virtual pc) never searched for the .dll. Perhaps when he runs it on his regular PC we'll see something different.

This is a crazy issue to track down.

Would the version of Java make a difference? I'm using the latest. I would assume that once compiled, any version of java should be able to find/use the class. That is an assumption on my part, though.
Perhaps the message that the method new_... can't be found is erroneous. Perhaps the real problem is that the static constructor (the one that is is failing, which is tricking Sage into saying that it can't find the instance constructor.

I guess if Jeff is taking care of you then you're in good hands. I have to go out to an engagement party, so I'm gone for the evening. Rushing off now, good luck.
Reply With Quote
  #77  
Old 11-18-2005, 06:32 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
Hi Bob,

I got your log file. In that log its definitely not even looking for the .dll file. When you added the registry entry, was there any effect?

If not, I think we'll have to wait to see if Jeff has any more ideas because I'm all out of useful ideas.
Reply With Quote
  #78  
Old 11-18-2005, 06:47 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by deria
Hi Bob,

I got your log file. In that log its definitely not even looking for the .dll file. When you added the registry entry, was there any effect?

If not, I think we'll have to wait to see if Jeff has any more ideas because I'm all out of useful ideas.
Nope I'm afraid not. I went ahead and added it on the MCE system as well and with the slightly modified path 'C:\Program Files\SageTVSrv\SageTV'

I'm going to create a dual boot system tomorrow so that I can have a real system as an alternative on another computer just incase VirtualPC is causing any issues.

BobP.
Reply With Quote
  #79  
Old 11-18-2005, 11:35 PM
deria deria is offline
Sage Aficionado
 
Join Date: Nov 2005
Posts: 408
I don't think you should go to the trouble of creating a dual-boot system. I don't think that its anything specific to your system thats preventing the plugin from working. The problems appear to be either related to SageTV, java, the interoperability between Java and .NET. I'm quite frustrated because this seems like such a simple issue and yet theres no obvious fix. I can't even reproduce the problem. So before you spend much more of your time on this, perhaps its best to wait and see if Jeff @ Sage TV has any more suggestions. I'll also install the Sage trial on my third computer and see if I can reproduce the problem somehow. It should have a relatively clean environment since it was never used for development and has no java stuff installed already. You've worked really hard to help diagnose this and I don't want to waste your time. I'd rather wait until we have something thats likely to work before asking you to spend large amounts of time on it.

EDIT: Or the plugin, of course.

Last edited by deria; 11-19-2005 at 12:10 AM.
Reply With Quote
  #80  
Old 11-19-2005, 12:44 PM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Finally found the time to try this!
I hate to say it, but it worked first time for me...
Copyied both dlls, and .class into SAGETV dir...
Copied STVI into SAGETV/STVs/SAGETV3
Imported STVI
Launched menu (via studio)
Configure / forced immediate refresh
Didn't even have to restart Sage...

(if it helps, running sage as a user with admin privs, and unpacked the files as the same user)

I think Bob's problem may be that the SystemMonitorClass is not being found -- the
Code:
Catbert Method Lookup Failure for:new_SystemMonitorPlugin
in the log is a good indication of this...

Bob, in Studio, can you enter in the Tools->expession evaluator :
Code:
java_lang_Class_forName("SystemMonitorPlugin")
this should indicate whether Sage can find the class or not...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 02:48 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.