Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Java Deploy Error (http://www.chiefdelphi.com/forums/showthread.php?t=145139)

Stevil99 03-03-2016 07:30 PM

Java Deploy Error
 
Hello, I tried deploying my code (https://github.com/FRC2495/2016-Java-FRC-Code.git) and am getting this error when i do:
➔ Launching «'/usr/local/frc/JRE/bin/java' '-jar' '/home/lvuser/FRCUserProgram.jar'»
platform: /Linux/arm/
********** Robot program starting **********
Error at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:244): ERROR Unhandled exception: java.lang.StackOverflowError at [edu.wpi.first.wpilibj.communication.UsageReporting .report(UsageReporting.java:21), edu.wpi.first.wpilibj.communication.UsageReporting .report(UsageReporting.java:17), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:70), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72), org.usfirst.frc.team2495.robot.Robot.robotInit(Rob ot.java:51), (Continues on for a really long time.)]
WARNING: Robots don't quit!
---> The startCompetition() method (or methods called by it) should have handled the exception above.

mikets 03-03-2016 08:44 PM

Re: Java Deploy Error
 
Looks like you have a run-away recursion. What is on line 51 in robot.java? It is somehow calling startCompetition.

Oromus 03-05-2016 07:04 PM

Re: Java Deploy Error
 
The problem is here:

Code:

public void robotInit() {
           
                oi = new OI();
      // autochooser = new SendableChooser();
        //autochooser.addDefault("Default Auto", new ExampleCommand());
//        chooser.addObject("My Auto", new MyAutoCommand());
      // SmartDashboard.putData("Auto mode", autochooser);
       
      startCompetition();
    }

Remove the startCompetition() line and it will fix the problem. robotInit() is called when you call startCompetition(), so calling startCompetition() in robotInit() causes an infinite loop (AKA, a StackOverflowError). Also, you shouldn't call startCompetition() anywhere, since that function is handled by FIRST.


All times are GMT -5. The time now is 07:56 AM.

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