Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Subsystem cannot be null (http://www.chiefdelphi.com/forums/showthread.php?t=113226)

arithehun 11-02-2013 00:11

Subsystem cannot be null
 
I am sorry for the lack of resources, but I am not with my robot at present, and thus cannot provide the full stack trace. But basically, I am both command programming my robot and using CAN-based jaguars. So, in my subsystem constructors, I have to add the line "throws CANTimeoutException" because that is where I naturally initialize my jaguars. However, when I compile and deploy my Java code, right before the line in the console that says "GOT_CONNECTION_FROM_CLIENT", I see a stack-trace that says "Subsystem must not be null". Again, I apologize that I don't have the stack trace message, but it basically finds the error in the line of code that says that that the required(whateverSubsystem) line is throwing the exception. I have a strong suspicion that the two are linked. When I commented out this line, I got a CANTimeoutException after the "GOT_CONNECTION_FROM_CLIENT" line when I clicked "Enable" in the driver station app. Naturally, because the subsystem constructors throw the error, so does the init() method of the CommandBase.

Has anyone experienced this? Should I replace all of my "throws" statements with internal try/catch blocks? Other options? I'll try post the stack trace errors during my Advisory period at school when I can access the robot next, which would be no later than 10:15 AM PST, but it maybe as late as 2:15 PM if that is not possible.

Thank you all.

Team3266Spencer 11-02-2013 00:17

Re: Subsystem cannot be null
 
Is your OI initiAlized before your subsystems?

arithehun 11-02-2013 01:25

Re: Subsystem cannot be null
 
Yes. Does that the commands initialize before the oi is set? That would make sense.

Ginto8 11-02-2013 01:27

Re: Subsystem cannot be null
 
Quote:

Originally Posted by arithehun (Post 1231392)
Yes.

Then one of your buttons' commands is probably require()ing a subsystem that hasn't been initialized yet, and is thus null. I'd recommend leaving OI as the last to be initialized.

arithehun 11-02-2013 01:30

Re: Subsystem cannot be null
 
Yeah, I just realized that. Wow, I can be an idiot sometimes.


All times are GMT -5. The time now is 10:11.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi