Log in

View Full Version : NetworkTable error


Arhowk
29-07-2013, 18:21
I'm trying to make a SmartDashboard application that communicates with the robot via network tables. Im trying to use this code


NetworkTable.setIPAddress("10.20.12.2");
NetworkTable.setClientMode();
try {
NetworkTable.initialize();
} catch (Exception e) {
e.printStackTrace();
}
t = NetworkTable

but it prints this error

Exception in thread "main" java.lang.NoClassDefFoundError: javax/microedition/io/Connector
at edu.wpi.first.wpilibj.networktables2.stream.Socket ConnectionStream.<init>(SocketConnectionStream.java:26)
at edu.wpi.first.wpilibj.networktables2.stream.Socket ConnectionStreamFactory.createStream(SocketConnect ionStreamFactory.java:27)
at edu.wpi.first.wpilibj.networktables2.client.Client ConnectionAdapter.reconnect(ClientConnectionAdapte r.java:84)
at edu.wpi.first.wpilibj.networktables2.client.Networ kTableClient.reconnect(NetworkTableClient.java:46)
at edu.wpi.first.wpilibj.networktables.NetworkTableMo de$2.createNode(NetworkTableMode.java:39)
at edu.wpi.first.wpilibj.networktables.NetworkTable.i nitialize(NetworkTable.java:52)
at edu.wpi.first.wpilibj.networktables.NetworkTable.g etTable(NetworkTable.java:106)
at org.chimeras1684.ui.operation.SerialByteStreamReci ever.<clinit>(SerialByteStreamReciever.java:26)
at org.chimeras1684.ui.operation.NewDriverUI.main(New DriverUI.java:35)
Caused by: java.lang.ClassNotFoundException: javax.microedition.io.Connector
at java.net.URLClassLoader$1.run(URLClassLoader.java: 366)
at java.net.URLClassLoader$1.run(URLClassLoader.java: 355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:4 23)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 56)
... 9 more
Exception in thread "Write Manager Thread" java.lang.NoClassDefFoundError: javax/microedition/io/Connector
at edu.wpi.first.wpilibj.networktables2.stream.Socket ConnectionStream.<init>(SocketConnectionStream.java:26)
at edu.wpi.first.wpilibj.networktables2.stream.Socket ConnectionStreamFactory.createStream(SocketConnect ionStreamFactory.java:27)
at edu.wpi.first.wpilibj.networktables2.client.Client ConnectionAdapter.reconnect(ClientConnectionAdapte r.java:84)
at edu.wpi.first.wpilibj.networktables2.client.Client ConnectionAdapter.ensureAlive(ClientConnectionAdap ter.java:214)
at edu.wpi.first.wpilibj.networktables2.WriteManager. run(WriteManager.java:146)
at edu.wpi.first.wpilibj.networktables2.thread.Defaul tThreadManager$PeriodicNTThread$1.run(DefaultThrea dManager.java:18)
at java.lang.Thread.run(Thread.java:722)

Joe Ross
29-07-2013, 19:07
It looks like it's using the cRIO version of network tables. If you're writing a program for your computer, you need to use the networktables-desktop.jar.

279 EMPIE
08-02-2014, 18:17
would you mind posting a link to that jar file? :D

fovea1959
09-02-2014, 10:38
hunt around in your sunspotfrc folder; I'm pretty sure it's gets plopped there as part of the Netbeans FRC Plugin install.

fovea1959
09-02-2014, 15:43
yep. in the desktop-lib subfolder of the sunspotfrcsdk folder.