I made some projects using LejOS and remote method invocations (i.e. Axis2 or Tomcat+Axis2). I am also on OSX (Lion) platform.
I use either lejos v0.85 and v0.90.
As a basic example, I want to invoke a Web Service operation that itself would start a motor. Using bluecove.jar it's ok (I configured a specific platform and it was painful but that's now ok). But I cannot use USB protocol that is my favorite one.
I also have to say that without Web service, it's ok: the NXT brick is discovered and the motor can be started using USB protocol. But, using a servlet application server, or Web service, that doesn't work.
I have a classic NullPointerException:
java.lang.NullPointerException
Exception in thread "Thread-6" java.lang.NullPointerException
at lejos.nxt.remote.NXTCommand.sendRequest(NXTCommand.java:65)
at lejos.nxt.remote.NXTCommand.setOutputState(NXTCommand.java:798)
at lejos.nxt.remote.RemoteMotor.rotate(RemoteMotor.java:163)
at com.myproject.lejos.v090.examples.SensorAndMotorExample1.run(SensorAndMotorExample1.java:55)
at java.lang.Thread.run(Thread.java:680)
The code at line 55 is quite simple: myMotor.rotate(1000,true);
The method search("", null, NXTCommFactory.USB) : NXTConnector returns an empty collection that indicates that no USB connection has been found/set.
Right. As the same example with NXTCommFactory.BLUETOOTH is ok and runs, I suspect that the libfantom library (libjfantom.dylib) is the problem and cannot be found passing through an application server. pccomm.jar is put in the axis2.../WEB-INF/lib folder where external jar files have to be (where bluecove.jar is also put). I also defined all environment variables ($NXJ_HOME,...,$DLYB_LIBRARY_PATH=/Path-to-lejos_nxj/bin), I modified all nxj scripts and axis2 scripts for forcing the java 32 bit mode and set the -Djava.library.path=/path-to-lejos_nxj/bin...But, I'm quite lost and I have no more idea
Any suggestions would be greatly appreciated !
Thanks.
