|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#61
|
||||
|
||||
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. |
#62
|
|||
|
|||
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? |
#63
|
|||
|
|||
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. |
#64
|
||||
|
||||
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. |
#65
|
|||
|
|||
Quote:
BobP. |
#66
|
|||
|
|||
Quote:
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; } 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 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. |
#67
|
|||
|
|||
Quote:
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. |
#68
|
|||
|
|||
Quote:
|
#69
|
|||
|
|||
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. |
#70
|
||||
|
||||
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. |
#71
|
|||
|
|||
Quote:
BobP. |
#72
|
|||
|
|||
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. |
#73
|
|||
|
|||
Quote:
|
#74
|
|||
|
|||
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. |
#75
|
|||
|
|||
The log from MCE2K5 machine is on its way - did forget to change the subject line when I replied - sorry about that.
BobP. |
#76
|
||||
|
||||
Quote:
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. |
#77
|
|||
|
|||
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. |
#78
|
|||
|
|||
Quote:
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. |
#79
|
|||
|
|||
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. |
#80
|
||||
|
||||
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 Bob, in Studio, can you enter in the Tools->expession evaluator : Code:
java_lang_Class_forName("SystemMonitorPlugin")
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|