Java Vision Camera cannot be found

My team wrote vision code for last year and are planning on using it for the imminent FRC competition, but a new problem has developed since we used it last year. I have been researching and other people had a similar problem and attributed it to wpilibs; I just want to know if there is anything I can do to solve it.

ERROR Unhandled exception: VisionException [com.ni.vision.VisionException: IMAQdxError: -1074360310: Camera is already in use.] at [com.ni.vision.NIVision._IMAQdxOpenCamera(Native Method), com.ni.vision.NIVision.IMAQdxOpenCamera(NIVision.java:24455), org.usfirst.frc.team3205.robot.subsystems.Vision.cameraInit(Vision.java:72), org.usfirst.frc.team3205.robot.Robot.robotInit(Robot.java:59), edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:76), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:234)]

Vision.java (11.4 KB)


Vision.java (11.4 KB)

if you run an opencv program on linux and it uses the camera and close the program. then run the same program again you will find that it returns an error, it simply is the fact that none of the programs are run as root, try restarting the roborio and you should be fine.