Go to Post FIRST has changed my life and I can never say thank you enough. - Jason Kixmiller [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2013, 06:51
salandri_s's Avatar
salandri_s salandri_s is offline
Registered User
FRC #4145
 
Join Date: Jan 2013
Location: Columbus
Posts: 2
salandri_s is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2013, 07:18
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
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?
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2013, 11:10
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
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.
__________________
All opinions are my own.
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2013, 12:52
salandri_s's Avatar
salandri_s salandri_s is offline
Registered User
FRC #4145
 
Join Date: Jan 2013
Location: Columbus
Posts: 2
salandri_s is an unknown quantity at this point
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)
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2013, 12:58
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
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.
__________________
All opinions are my own.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2013, 17:10
detruby detruby is offline
Dave Truby
AKA: Dave Truby
FRC #4145 (Wolf Pack)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Columbus
Posts: 11
detruby is an unknown quantity at this point
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 20-01-2013, 15:31
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: Scheduler.getInstance().run() throws a null pointer

Quote:
Originally Posted by salandri_s View Post
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
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #8   Spotlight this post!  
Unread 21-01-2013, 13:38
Bryce Paputa's Avatar
Bryce Paputa Bryce Paputa is offline
FF TSL: Frog Farce
FRC #0503 (Frog Force)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Novi Michigan
Posts: 454
Bryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond repute
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.
Reply With Quote
  #9   Spotlight this post!  
Unread 22-01-2013, 08:17
AsianRookie AsianRookie is offline
Registered User
AKA: Steven/Tim
FRC #0321 (Robolancers)
Team Role: Programmer
 
Join Date: Oct 2012
Rookie Year: 2007
Location: Philadelphia
Posts: 31
AsianRookie is an unknown quantity at this point
Re: Scheduler.getInstance().run() throws a null pointer

is there some code in the teleopInit()?
Reply With Quote
  #10   Spotlight this post!  
Unread 07-02-2013, 10:19
carneeki carneeki is offline
Registered User
AKA: Adam
FRC #3132 (Thunder Down Under), FRC#4774 (LAN Down Under)
Team Role: Mentor
 
Join Date: May 2011
Rookie Year: 2010
Location: Australia
Posts: 5
carneeki is an unknown quantity at this point
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 View Post
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.
__________________
FRC-3132 - Thunder Down Under - Mentor since 2011
FRC-4774 - LAN Down Under - Mentor since 2013

VK2JSI... Adam
Reply With Quote
  #11   Spotlight this post!  
Unread 07-02-2013, 15:45
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Scheduler.getInstance().run() throws a null pointer

Quote:
Originally Posted by carneeki View Post
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
Reply With Quote
  #12   Spotlight this post!  
Unread 07-02-2013, 16:37
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
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
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #13   Spotlight this post!  
Unread 07-02-2013, 16:57
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Scheduler.getInstance().run() throws a null pointer

Quote:
Originally Posted by BradAMiller View Post
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
Reply With Quote
  #14   Spotlight this post!  
Unread 07-02-2013, 18:58
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
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
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
Reply With Quote
  #15   Spotlight this post!  
Unread 07-02-2013, 19:04
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Scheduler.getInstance().run() throws a null pointer

Quote:
Originally Posted by BradAMiller View Post
You can do that,

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

Brad
How? "Check For Updates" is empty
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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