Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Scheduler.getInstance().run() throws a null pointer (http://www.chiefdelphi.com/forums/showthread.php?t=111430)

salandri_s 17-01-2013 06:51

Scheduler.getInstance().run() throws a null pointer
 
Scheduler.getInstance().run() throws a null pointer exception. Anybody encountered same problem and found a fix? If yes, please share.

RufflesRidge 17-01-2013 07:18

Re: Scheduler.getInstance().run() throws a null pointer
 
It's unclear if the Scheduler call is throwing a null pointer, or if one of your commands is. Can you post the full stack trace?

joelg236 17-01-2013 11:10

Re: Scheduler.getInstance().run() throws a null pointer
 
It's sure to be an exception being thrown in .run() since it is a singleton instance. Something in your scheduled commands is throwing the error.

salandri_s 17-01-2013 12:52

Re: Scheduler.getInstance().run() throws a null pointer
 
Thanks for responding.

Here is the exception stack trace.

[frcrun] [cRIO] 1969/12/31_16:04:53.119,E,WkwFrcRobot2013,teleopPeriodic() ,java.lang.NullPointerException, message=Cannot put a null value into networktables.

[frcrun] [cRIO] java.lang.NullPointerException: Cannot put a null value into networktables

[frcrun] [cRIO] at edu.wpi.first.wpilibj.networktables2.NetworkTableN ode.putValue(NetworkTableNode.java:95)

[frcrun] [cRIO] at edu.wpi.first.wpilibj.networktables.NetworkTable.p utValue(NetworkTable.java:406)

[frcrun] [cRIO] at edu.wpi.first.wpilibj.command.Scheduler.run(Schedu ler.java:208)

[frcrun] [cRIO] at us.oh.k12.wkw.robot.WkwFrcRobot2013.teleopPeriodic (WkwFrcRobot2013.java:331)

[frcrun] [cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.otBase.startApp(RobotBase.java: 169)

[frcrun] [cRIO] in virtual method #10 of javax.microedition.midlet.MIDlet(bci=17)

[frcrun] [cRIO] at javax.microedition.midlet.MIDletTunnelImpl.callSta rtApp(64)

[frcrun] [cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(110)

[frcrun] [cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)

[frcrun] [cRIO] at com.sun.squawk.Isolate.run(1506)

[frcrun] [cRIO] at java.lang.Thread.run(231)

[frcrun] [cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)

[frcrun] [cRIO] ijava:165)

[frcrun] [cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase .java:169)

[frcrun] [cRIO] in virtual method #10 of javax.microedition.midlet.MIDlet(bci=17)

[frcrun] [cRIO] at javax.microedition.midlet.MIDletTunnelImpl.callSta rtApp(64)

[frcrun] [cRIO] at cn static method #3 of com.sun.squawk.VM(bci=6)

joelg236 17-01-2013 12:58

Re: Scheduler.getInstance().run() throws a null pointer
 
It appears that it has nothing to do with Scheduler.run(). Are you using NetworkTables to send and receive data in any way (or SmartDashboard)? It seems you've sent a null reference through NetworkTables.

detruby 17-01-2013 17:10

Re: Scheduler.getInstance().run() throws a null pointer
 
In wpilibjava jar, in Scheduler.java line 208,

m_table.putValue(string.valueOf(++count), e.getData().getTable());

Would return the error about putting a null in the network table. Looks like a code bug to me.

BradAMiller 20-01-2013 15:31

Re: Scheduler.getInstance().run() throws a null pointer
 
Quote:

Originally Posted by salandri_s (Post 1217068)
Scheduler.getInstance().run() throws a null pointer exception. Anybody encountered same problem and found a fix? If yes, please share.

Can you post a (preferably) small program that causes the NULL pointer exception that you are seeing?

Thanks,
Brad

Bryce Paputa 21-01-2013 13:38

Re: Scheduler.getInstance().run() throws a null pointer
 
We had this issue because we removed the line in RobotTemplate that initialized the example autonomous command, but we did not get rid of the line that started it.

AsianRookie 22-01-2013 08:17

Re: Scheduler.getInstance().run() throws a null pointer
 
is there some code in the teleopInit()?

carneeki 07-02-2013 10:19

Re: Scheduler.getInstance().run() throws a null pointer
 
Hi salandri_s,

Did you wind up fixing this? If so, could you please post your troubleshooting method? Our team (#4774) is having some trouble finding where the null pointer is creeping in as it doesn't appear in our stack trace either.

Quote:

Originally Posted by BradAMiller (Post 1219129)
Can you post a (preferably) small program that causes the NULL pointer exception that you are seeing?

Thanks,
Brad

Hi Brad,

Did anybody post any example code to you? If not, I can share our code with you. I'm heading into the workshop in about 7 hours. I will try and strip out everything to see if I can get rid of the exception. If I have no luck, I'll create a Gist and share the link.

Arhowk 07-02-2013 15:45

Re: Scheduler.getInstance().run() throws a null pointer
 
Quote:

Originally Posted by carneeki (Post 1229322)
Hi salandri_s,

Did you wind up fixing this? If so, could you please post your troubleshooting method? Our team (#4774) is having some trouble finding where the null pointer is creeping in as it doesn't appear in our stack trace either.



Hi Brad,

Did anybody post any example code to you? If not, I can share our code with you. I'm heading into the workshop in about 7 hours. I will try and strip out everything to see if I can get rid of the exception. If I have no luck, I'll create a Gist and share the link.

The person above you was correct, you started a command that was not initialized. This throws a NetworkTable error because the commands use NetworkTable to put buttons on the driverstation/dashboard

BradAMiller 07-02-2013 16:37

Re: Scheduler.getInstance().run() throws a null pointer
 
We found a bug in the C++ and Java libraries where doing a putData() of the Scheduler instance will cause the program to crash. That has been fixed and will be released later today or tomorrow morning.

So if you have code like this:

SmartDashboard.putData(Scheduler.getInstance())

it will be fixed in that update.

Sorry about the annoyance.

Brad

Arhowk 07-02-2013 16:57

Re: Scheduler.getInstance().run() throws a null pointer
 
Quote:

Originally Posted by BradAMiller (Post 1229504)
We found a bug in the C++ and Java libraries where doing a putData() of the Scheduler instance will cause the program to crash. That has been fixed and will be released later today or tomorrow morning.

So if you have code like this:

SmartDashboard.putData(Scheduler.getInstance())

it will be fixed in that update.

Sorry about the annoyance.

Brad

Didn't know you could do that :o

BradAMiller 07-02-2013 18:58

Re: Scheduler.getInstance().run() throws a null pointer
 
You can do that,

and the update just got pushed out. Look for it in Netbeans.

Brad

Arhowk 07-02-2013 19:04

Re: Scheduler.getInstance().run() throws a null pointer
 
Quote:

Originally Posted by BradAMiller (Post 1229570)
You can do that,

and the update just got pushed out. Look for it in Netbeans.

Brad

How? "Check For Updates" is empty

BradAMiller 07-02-2013 19:55

Re: Scheduler.getInstance().run() throws a null pointer
 
Can you confirm that you aren't seeing the update?

Thanks,
Brad

Joe Ross 07-02-2013 20:10

Re: Scheduler.getInstance().run() throws a null pointer
 
I see the updated WPILibJ plugins (version 429) when I reload the catalog

Arhowk 07-02-2013 21:05

Re: Scheduler.getInstance().run() throws a null pointer
 
Quote:

Originally Posted by BradAMiller (Post 1229594)
Can you confirm that you aren't seeing the update?

Thanks,
Brad

are these WPIJavaCV updates or WPILibJ updates? WPIJavaCV never worked for me and theres no WPILibJ updates (all are version 2013.0.417)

BradAMiller 08-02-2013 08:13

Re: Scheduler.getInstance().run() throws a null pointer
 
Quote:

Originally Posted by Arhowk (Post 1229624)
are these WPIJavaCV updates or WPILibJ updates? WPIJavaCV never worked for me and theres no WPILibJ updates (all are version 2013.0.417)

If you look in this directory:

http://first.wpi.edu/FRC/java/netbeans/update/Release

you'll see the file updates.xml. That is the file that controls the update process and it should be at version 429.

The SmartDashboard also updated both in the NetBeans update and in the plugin update.

Brad

Arhowk 08-02-2013 11:08

Re: Scheduler.getInstance().run() throws a null pointer
 
Quote:

Originally Posted by BradAMiller (Post 1229798)
If you look in this directory:

http://first.wpi.edu/FRC/java/netbeans/update/Release

you'll see the file updates.xml. That is the file that controls the update process and it should be at version 429.

The SmartDashboard also updated both in the NetBeans update and in the plugin update.

Brad

how do you download from there

Joe Ross 08-02-2013 12:30

Re: Scheduler.getInstance().run() throws a null pointer
 
Quote:

Originally Posted by Arhowk (Post 1229869)
how do you download from there

There are instructions here: http://wpilib.screenstepslive.com/s/...elopment-tools

Jon Stratis 13-02-2013 21:19

Re: Scheduler.getInstance().run() throws a null pointer
 
Can someone outline the solution for this issue? We're encountering it as well, and tried what we read in this thread - restoring that autonomous example command, updating the libraries... any help would be appreciated!


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

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