|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Exceptions from calling Java
Okay, I've got more exceptions than this, but I figured I'd start with this one, and see what falls out of this. I'm currently doing a bunch of work altering some STVi's, and some of what I'm doing is calling straight java from the Studio interface. It appears that this is throwing some exceptions, even though the routines appear to be doing what I expect. Here's the debug output of an exception:
Code:
Sun 2/22 17:30:30.467 EXCEPTION in getValueAsObject:sage.a.e: Error in method reflection of java_util_ArrayList_add of java.lang.NullPointerException for:java_util_ArrayList_add( Categories, "NewReleases" ) Sun 2/22 17:30:30.468 sage.a.e: Error in method reflection of java_util_ArrayList_add of java.lang.NullPointerException Sun 2/22 17:30:30.468 at sage.e$d.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.a.m$b.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.a.m.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.b1.M(Unknown Source) Sun 2/22 17:30:30.468 at sage.UIManager.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.UIManager.a(Unknown Source) Sun 2/22 17:30:30.468 at sage.f$23.run(Unknown Source) Sun 2/22 17:30:30.468 Caused by: java.lang.NullPointerException Sun 2/22 17:30:30.468 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Sun 2/22 17:30:30.468 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) Sun 2/22 17:30:30.469 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) Sun 2/22 17:30:30.469 at java.lang.reflect.Method.invoke(Unknown Source) Sun 2/22 17:30:30.469 ... 14 more Sun 2/22 17:30:30.469 java.lang.reflect.InvocationTargetException Sun 2/22 17:30:30.469 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Sun 2/22 17:30:30.469 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) Sun 2/22 17:30:30.469 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) Sun 2/22 17:30:30.469 at java.lang.reflect.Method.invoke(Unknown Source) Sun 2/22 17:30:30.469 at sage.e$d.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.a.m$b.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.a.m.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.469 at sage.b1.M(Unknown Source) Sun 2/22 17:30:30.470 at sage.UIManager.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.UIManager.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.f$23.run(Unknown Source) Sun 2/22 17:30:30.470 Caused by: java.lang.NullPointerException Sun 2/22 17:30:30.470 at java.util.Collections.sort(Unknown Source) Sun 2/22 17:30:30.470 ... 18 more Sun 2/22 17:30:30.470 java.lang.NullPointerException Sun 2/22 17:30:30.470 at java.util.Collections.sort(Unknown Source) Sun 2/22 17:30:30.470 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Sun 2/22 17:30:30.470 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) Sun 2/22 17:30:30.470 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) Sun 2/22 17:30:30.470 at java.lang.reflect.Method.invoke(Unknown Source) Sun 2/22 17:30:30.470 at sage.e$d.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.a.m$b.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.a.m.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.a8.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.470 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.471 at sage.e.a(Unknown Source) Sun 2/22 17:30:30.471 at sage.b1.M(Unknown Source) Sun 2/22 17:30:30.471 at sage.UIManager.a(Unknown Source) Sun 2/22 17:30:30.471 at sage.UIManager.a(Unknown Source) Sun 2/22 17:30:30.471 at sage.f$23.run(Unknown Source) Code:
Categories = new_java_ArrayList( java_utils_Arrays_asList( GetAllCategories() ) ) java_util_ArrayList_add( Categories, "NewReleases" ) Ikarius
__________________
SageTV 6.6.2, SageMC+CenterSage Theme Server: Intel Core2 Q6600, 8gb memory, 3x 1tb WD EACS drives, software RAID5 2tb capacity, 4gb Flash boot drive, Ubuntu 8.0.4 Server edition Capture: 1x HD-PVR -> Motorola DTC6200 Clients: 1x STX-HD100 1x STX-HD200, Windows & OSX Clients |
#2
|
||||
|
||||
You should not normally get exceptions when calling Java from Studio code. Turn on Tools > Notify On Errors in Studio to get a popup dialog when an exception occurs.
According to your stack trace, you're getting a NullPointerException in java_util_ArrayList_add, probably because you're passing in a null argument. Sure enough, your Categories variable is not getting initialized properly because you called new_java_ArrayList instead of new_java_util_ArrayList. So presumably there's an "unknown method" error being logged just before the snippet of log you showed us. If you haven't already done so, I highly recommend enabling SageTV's console window during Studio development. That way you can see the errors as they occur instead of having to dig them out of the log after the fact. If your code goes wrong and throws a bunch of exceptions, it's pretty obvious with the console window open and visible. But wait, you're developing on a Mac, right? In that case I'm afraid I have no idea how to enable the console window (in Windows it's a registry setting) or even if one exists in the Mac version.
__________________
-- Greg |
#3
|
||||
|
||||
/sigh.
Lesson learned. When copying code from one workstation to another, you're subject to typos. Also don't call the default sage sort routine on an arraylist, as you're not likely to get an arraylist back, thus later attempts to call "add" will cause exceptions. God for the ability to use diff, patch, and vi.
__________________
SageTV 6.6.2, SageMC+CenterSage Theme Server: Intel Core2 Q6600, 8gb memory, 3x 1tb WD EACS drives, software RAID5 2tb capacity, 4gb Flash boot drive, Ubuntu 8.0.4 Server edition Capture: 1x HD-PVR -> Motorola DTC6200 Clients: 1x STX-HD100 1x STX-HD200, Windows & OSX Clients |
#4
|
||||
|
||||
Well, there is the built-in UID File Difference and STVI generator command, which can be used to encode differences between two STVs in a form that can be imported into a third STV.
And come to that, STV files are just XML, which is just text. So using text-based diff and patch tools isn't totally out of the question.
__________________
-- Greg |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Help calling Java from Studio | Tiki | SageTV Studio | 3 | 12-31-2008 12:51 PM |
Calling SetRecordingTimes() | Slugger | SageTV Studio | 6 | 03-26-2007 07:10 PM |
Calling custom java classes from studio | davin | SageTV Studio | 9 | 11-09-2005 11:50 AM |
Calling all images! | mlbdude | SageTV Beta Test Software | 7 | 02-24-2004 06:40 AM |