Uncaught exception


[cRIO] Uncaught exception in Thread.run():
[cRIO]     on thread edu.wpi.first.wpilibj.templates.RobotTemplate - main
[cRIO] java.lang.IllegalArgumentException: MIDlet class specified, edu.wpi.first.wpilibj.templates.RobotTemplate, was not found
[cRIO]     at java.lang.Throwable.<init>(88)
[cRIO]     at java.lang.Throwable.<init>(102)
[cRIO]     at java.lang.Exception.<init>(53)
[cRIO]     at java.lang.RuntimeException.<init>(58)
[cRIO]     at java.lang.IllegalArgumentException.<init>(54)
[cRIO]     at com.sun.squawk.imp.MIDletMainWrapper.main(94)
[cRIO]     in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO]     at com.sun.squawk.Isolate.run(1554)
[cRIO]     at java.lang.Thread.run(231)
[cRIO]     in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO]     in static method #3 of com.sun.squawk.VM(bci=6)

We don’t really know how this happened, but it broke sometime around when we tried to change the package name of the default code. Is there a way to get around this? How would we modify the midlet configurations in the Manifest file?

In Netbeans go to Tools -> Plugins and click the Settings tab.

Select FRC Java or whatever you named it and make sure the update site is:

http://first.wpi.edu/FRC/java/netbeans/update/updates.xml

If it isn’t, uninstall the FRC Plugins and change the update site and reinstall.

You’ll see this behavior if you change your package name after creating your project. Edit the file in ./resources/META-INF/MANIFEST.MF so that it uses your package and class name.

The default file will look something like this:

MIDlet-Name: RobotTemplate
MIDlet-Version: 1.0.0
MIDlet-Vendor: FIRST
MIDlet-1: RobotTemplate, , edu.wpi.first.wpilibj.templates.RobotTemplate
MicroEdition-Profile: IMP-1.0
MicroEdition-Configuration: CLDC-1.1

Replace ‘RobotTemplate’ with the name of your robot class, and ‘edu.wpi.first.wpilibj.templates’ with your package name.

Thanks MattD :slight_smile:

We’ve been confused for a bit and were starting to get worried. We tried what you said and it worked perfectly. Team 1517 thanks you.

Looks like it worked for us too. Thanks for your time and help!

I gave up on changing our default code name since week 1, so this is very helpful. Thanks a lot, Matt! :slight_smile: