Hello I have been working on a project where I send numbers to an nxt brick over blue tooth from my computer, it was working perfectly until I tried to run the same program on my friends brick.

I have two bricks, at run time the master brick connects via blue tooth to the slave with no issue. It then wait for a connection from BTSend from my computer, then it starts. After I tried to run it on my friends identical setup, and failed, I tried on mine again, to learn that it now fails. I get the following error messages:

BlueCove version 2.1.0 on winsockBTSend Log.listener: Error: Exception connecting to NXT.Failed to connect to any NXTBTSend Log.listener: Caused by lejos.pc.comm.NXTCommException: Open of NXT failed.BTSend Log.listener: at lejos.pc.comm.NXTCommBluecove.open(NXTCommBluecove.java:136)BTSend Log.listener: Caused by javax.bluetooth.BluetoothConnectionException: Failed to connect; [10064] A socket operation failed because the destination host was down.BTSend Log.listener: at com.intel.bluetooth.BluetoothStackMicrosoft.connect(Native Method)BTSend Log.listener: Failed to connect to any NXTBlueCove stack shutdown completed

I tried removing and re-installing the device (running windows and it still doesn't work, the only time it connects now is after the second brick that it was connected to sleeps. But then it acts very strange. I have rebooted my machine and the bricks to no avail. Can anyone explain to me how in the world it would work just fine, but because I paired my friends brick to my computer (deleted it after) mine now stopped working?

in the log.but i see, that its not the same exception. my exeption is [10060] and his is [10064].i will try this programm on my laptop later (dropbox sync, takes time ).in my pc is a small logitech micro usb bluetooth dongle with bt 4.0 and that and that and that , maybe it works with an integreted dongle in my laptop

java.lang.NoClassDefFoundError: javax/bluetooth/DiscoveryListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:792) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:190) at lejos.pc.comm.NXTCommFactory.newNXTCommInstance(NXTCommFactory.java:98) at lejos.pc.comm.NXTCommFactory.createNXTComm(NXTCommFactory.java:91) at lejos.pc.comm.NXTConnector.search(NXTConnector.java:111) at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:235) at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:347) at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:362) at BTSend.main(BTSend.java:29)Caused by: java.lang.ClassNotFoundException: javax.bluetooth.DiscoveryListener 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.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:792) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) at java.net.URLClassLoader.access$100(URLClassLoader.java:71) at java.net.URLClassLoader$1.run(URLClassLoader.java:361) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:190) at lejos.pc.comm.NXTCommFactory.newNXTCommInstance(NXTCommFactory.java:98) at lejos.pc.comm.NXTCommFactory.createNXTComm(NXTCommFactory.java:91) at lejos.pc.comm.NXTConnector.search(NXTConnector.java:111) at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:235) at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:347) at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:362) at BTSend.main(BTSend.java:29) at __SHELL3.run(__SHELL3.java:6) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at bluej.runtime.ExecServer$3.run(ExecServer.java:725)

so WHAT?!? it is not the bluetooth dongle, not the nxt, not the ide. java is jdk and jre ver7u45 32 bit. lejos last version of 0.9.1 program to send: lejos-example btsend.javaprogram to recieve, is my own:

you saw the exception on my pc. nxt stays on wating for connection. one pc is on windows7, one is win8.bluetooth is on at both devices. visibility also on.nxt can find laptop, but i dont have any password so nxt says unsuccessful.

The NoClassDefFoundError was clearly a problem with your bluej setup. You didn't include all the leJOS JAR files in the classpath/buildpath/or whatever bluej calls it.The error you posted now is caused by a BluetoothConnectionException. The error message (luckily I'm German and can understand it) might indicate some hardware issue (the NXT's bluetooth module doesn't seem to be the most compatible). So when you write that you can use nxjcontrol to control the NXT, was that on the same PC?

finally i reached to get the same status on both pcs. i can use lejos tools and run the program with the same exception on both pcs (i dont know what i changed on the pc) :Sso now: i can connect from pc to nxt (search/pair on nxt doesnt work ) and use the bat files, but ,my java programms wont work

i think the problem of bluej was, that in eclipse i have a lejos nxj project and a lejos pc project. the "class not found" was a class of the lejos nxj class so bluej doesnt split this projects. it would be fine to have both files in one project but ok, now its working.

I'm a bit confused by what you write. You don't mix Java code that's supposed to run on the PC and Java code that's supposed to run on the NXT. Neither in BlueJ nor in Eclipse. Both project types (projects for PC-side code and NXT-side code) need to be setup very differently. For the NXT-side code you need to override the bootclasspath with class.jar - for the PC-side code you need to add a completely different set of JAR files to the classpath and you don't touch the bootclasspath. Now if BlueJ doesn't allow you to override the bootclasspath, well then you shouldn't use BlueJ anyway.

Now on the same machine, your own program should behave just as well/bad as the leJOS tools (say nxjcontrol). Please post the output of your PC-side program on the computer where nxjcontrol works just fine. Also, while your program tries to connect to the NXT, what is running on the NXT. The menu? Or your own program?

ok. i think you dont understand me: now i can use the lejos tools on both computers via bluetooth. exception for my java program is finally the same on both computers. output of my java program is this error

and for those, who doesnt speak german: connection timeout. connecting fails, because the other device didnt answer or the connection was defective, because the connected host didnt replied

first i start my nxtapp.java (go up), and wait until it reaches "wait for connection" with "..." after that (so before line connection = Bluetooth.waitForConnection();). then i start the program on my pc and it gives the error message

sry but i dont understand it...................now it is ok. it sends integers to the nxt and it shows them on the screen.i did everything like everytime but it works its the same code like before. only with "btspp://". confusing