Robot Initilization failure on deploy

I’ve been trying to deploy the code to our test bot, but I keep getting am error message everytime and after searching around for quite awhile I haven’t really gotten any closer to finding out what’s wrong so I was hoping someone here could help.

Error Message:
Unhandled exception instantiating robot org.usfirst.frc.team3655.robot.Robot java.lang.ExceptionInInitializerError at [java.lang.Class.forName0(Native Method), java.lang.Class.forName(Class.java:259), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:197)]

Robot class Code



package org.usfirst.frc.team3655.robot;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.Scheduler;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;

import org.usfirst.frc.team3655.robot.commands.*;
import org.usfirst.frc.team3655.robot.subsystems.*;

/**
 * The VM is configured to automatically run this class, and to call the
 * functions corresponding to each mode, as described in the IterativeRobot
 * documentation. If you change the name of this class or the package after
 * creating this project, you must also update the manifest file in the resource
 * directory.
 */
public class Robot extends IterativeRobot 
{
	//Update EVERYtime you make a change to make sure you deployed the correct version!!
	public static final String VERSION = "0.0.04";
	
	//SubSystem Variables
	public static final Elevator elevator = new Elevator();
	public static final Gyroscope gyro = new Gyroscope();
	public static final MecanumDrive mecanumDrive = new MecanumDrive();
	public static final RotaryEncoder encoder = new RotaryEncoder();
	public static OI oi = new OI();
	
	//Commands
    Command teleOpDrive;

    /**
     * This function is run when the robot is first started up and should be
     * used for any initialization code.
     */
    public void robotInit() 
    {
    	System.out.println("Robot Init v: " + VERSION);
		oi = new OI();
        // instantiate the command used for the autonomous period
		teleOpDrive = new TeleOpDrive();      
    }
	
	public void disabledPeriodic() 
	{
		Scheduler.getInstance().run();
	}

    public void autonomousInit() 
    {
        
    }

    /**
     * This function is called periodically during autonomous
     */
    public void autonomousPeriodic() 
    {
        Scheduler.getInstance().run();
    }

    public void teleopInit() 
    {
        //Starts TeleOP drive base
        if (teleOpDrive != null) { 
        	teleOpDrive.start();
        }
    }

    /**
     * This function is called when the disabled button is hit.
     * You can use it to reset subsystems before shutting down.
     */
    public void disabledInit()
    {
    	//Kills the drive base for teleOP
    	if (teleOpDrive != null) { 
        	teleOpDrive.cancel();
        }
    }

    /**
     * This function is called periodically during operator control
     */
    public void teleopPeriodic() 
    {
        Scheduler.getInstance().run();
        //Runs the button checking, probably not the best way but it'll work for now.
        oi.teleOpJoyStick();
    }
    
    /**
     * This function is called periodically during test mode
     */
    public void testPeriodic() 
    {
        LiveWindow.run();
    }
}


*I set up most of the command groups to be ran from the OI when a button is pushed if that’s helpful as well. Thank you for any help in advance.

You sir… Have a logic error. You never connect up anything so the program is a dead program… The error your getting is hoping you will go find the line in your code and debug it with the debugging window in eclipse. Set break points and find exactly what line… I think you’ll be amazed at where your logic error is. You have no type of speed controllers set. You have no place where your mechanum drive is hooked up to your motors. Try those first.

This is all done in separate classes, the robot project is set up using the command template. I’m at least competent in Java, I just haven’t ever seen such an ambiguous error before without any kind of line number to my code before, so I’m kind of confused as to what would cause it.

Did you rename your class after creating the project?

No, I left the main class’ name the same. I do use EGit with eclipse though, so do you think it’s possible that it might affect it in someway?

I don’t know if this is causing this error, but I wouldn’t instantiate OI twice like you’re doing. I would only instantiate OI in robotInit(), where all subsystems are guaranteed to be constructed. If you change the line “public static OI oi = new OI()” to “public static OI oi”, you may fix the problem.

Whoops, didn’t even notice that… I made a new project and copied over the code and now also changed that double initialization like that. I’ll have to see if it works or not tomorrow though. Thanks for spotting that silly mistake. :ahh:

*Git also probably had nothing to do with it either, so that was a waste of time copying all that too, but oh well if it works I’ll be a happy man.