bluetooth connection error

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, imaqine, 99jonathan

j0hn mandrake
New User
Posts: 5
Joined: Tue Oct 25, 2011 1:09 pm

bluetooth connection error

Postby j0hn mandrake » Sat Jan 21, 2012 8:45 pm

Hi guys,
I'm trying to connect to my NXT from the Computer for a long time now. But I'm always getting the same problem. I've even tried using the sample programs, but always at this line

Code: Select all

conn.connectTo(mynxt, NXTComm.RAW);

or at this one

Code: Select all

boolean connected = conn.connectTo("btspp://");

depending if I use my program or the sample one.
conn is a NXTConnector, and mynxt is a NXTInfo Object. With both programs I get this Error :evil:

Code: Select all

Exception in thread "main" java.lang.NoClassDefFoundError: javax/bluetooth/DiscoveryListener
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
   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:423)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:186)
   at lejos.pc.comm.NXTCommFactory.newNXTCommInstance(NXTCommFactory.java:87)
   at lejos.pc.comm.NXTCommFactory.createNXTComm(NXTCommFactory.java:76)
   at lejos.pc.comm.NXTConnector.connectTo(NXTConnector.java:272)
   at send.main(send.java:7)
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:423)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
   ... 18 more

I'm really desperated and I don't know what to do or what I'm doing wrong.

j0hn

User avatar
gloomyandy
leJOS Team Member
Posts: 4514
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: bluetooth connection error

Postby gloomyandy » Sat Jan 21, 2012 8:54 pm

Hi,
when asking for help the more you tell us the more likely we can help...
What OS are you using?
What version of Java?
64 bit or 32 bit Java?
What version of leJOS?
Do the standard programs like nxjbrowse work using Bluetooth?

Andy

skoehler
leJOS Team Member
Posts: 1515
Joined: Thu Oct 30, 2008 4:54 pm

Re: bluetooth connection error

Postby skoehler » Sat Jan 21, 2012 10:00 pm

j0hn mandrake wrote:I'm really desperated and I don't know what to do or what I'm doing wrong.

You have added pccomm.jar to the classpath, but not bluecove.jar. Are you using an IDE? If so, which?

j0hn mandrake
New User
Posts: 5
Joined: Tue Oct 25, 2011 1:09 pm

Re: bluetooth connection error

Postby j0hn mandrake » Sun Jan 22, 2012 10:48 am

Ah, thanks guys,
when I add bluecove.jar to it, it works. But can you tell me why I need to do that???
Cause I never use that package in my program, so how does it help me???

skoehler
leJOS Team Member
Posts: 1515
Joined: Thu Oct 30, 2008 4:54 pm

Re: bluetooth connection error

Postby skoehler » Sun Jan 22, 2012 12:16 pm

j0hn mandrake wrote:Ah, thanks guys,
when I add bluecove.jar to it, it works. But can you tell me why I need to do that???
Cause I never use that package in my program, so how does it help me???

You don't use bluecove, but you use classes from pccomm.jar which use on bluecove.


Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 1 guest