SageTV Community  

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

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-29-2006, 06:21 PM
dadams dadams is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Oklahoma
Posts: 195
Help - Trying to call GetScheduledRecordings from Java

I am trying to get a list of upcoming recordings from the SageTV api and it keeps on erroring out when I make the call. I was trying to make it simple since this is my first try in calling the api from Java. Here is the code:

public static void GetScheduleRec()
{
try
{

Object FileList = (Object[])sage.SageTV.api("GetScheduledRecordings", null);

}

catch (java.lang.reflect.InvocationTargetException e)
{
System.out.println("ERROR invoking SageTV API calls of: " + e.toString());
}
}

I know this is probably simple for most, but any help would be appreciated.

Thank you,

Dennis
Reply With Quote
  #2  
Old 01-29-2006, 06:47 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Your posted code works for me. Maybe you could give more details about the exact error(s) you're getting.
__________________
-- Greg
Reply With Quote
  #3  
Old 01-29-2006, 09:05 PM
dadams dadams is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Oklahoma
Posts: 195
I'm getting this message:

ERROR invoking SageTV API calls of: java.lang.reflect.InvocationTargetException

Thanks for the reply
Reply With Quote
  #4  
Old 01-30-2006, 02:58 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Are you running the java code inside a SageTV / SageTVService / SageClient process?

(you might also want to do e.printStackTrace(), and also print the e.getCause() if it exists)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #5  
Old 01-30-2006, 06:26 AM
dadams dadams is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Oklahoma
Posts: 195
Quote:
Originally Posted by nielm
Are you running the java code inside a SageTV / SageTVService / SageClient process?
I'm calling it from a java program that I'm developing with NetBeans.

Quote:
Originally Posted by nielm
(you might also want to do e.printStackTrace(), and also print the e.getCause() if it exists)
I did the e.getCause() and it gives me:

java.lang.UnsatisfiedLinkError: no SageTVWin32 in java.library.path

I have the Sage.jar included in the classpath. Is there something else I need to add?

Thanks
Reply With Quote
  #6  
Old 01-30-2006, 08:00 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by dadams
I'm calling it from a java program that I'm developing with NetBeans.
Then there is your problem...

To read the info from Sage's internal classes/DB, the sage.SageTV.api() needs to be called in the context of a running SageTV/SageTVClient/SageService application.

This means, either run the class as a separate thread (eg in my getstaus/webserver apps), which is run on startup by Sage, or being called from an STV (as in the rest of my plugins!)

If you are trying to get some info from Sage to be used by another program, then you will need to set up some inter process communication between the 2 programs...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #7  
Old 01-30-2006, 08:14 AM
dadams dadams is offline
Sage Advanced User
 
Join Date: Feb 2004
Location: Oklahoma
Posts: 195
Thanks for your help, Niem!
Reply With Quote
  #8  
Old 01-30-2006, 08:28 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
no problem -- good luck with the app...

Source code to my plugins is all in Sourceforge, if it helps...
http://cvs.sourceforge.net/viewcvs.py/sageplugins/
__________________
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 06:11 PM.


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