lejos with Web Service and remote programming

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

Moderators: roger, 99jonathan, imaqine

lejos with Web Service and remote programming

Postby caribou » Wed Nov 07, 2012 9:33 pm

Hi All,

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.
caribou
New User
 
Posts: 3
Joined: Wed Nov 07, 2012 9:02 pm

Re: lejos with Web Service and remote programming

Postby caribou » Sat Nov 10, 2012 11:01 am

I made some tests, trying to reproduce the same error without Web service and remote operation invocation. If I delete /Library/Frameworks/Fantom.framework folder, the same error arises. I deduce that Axis2 is not able to load the Fantom driver. Is there some other environment variables I should set ? Is there a way to indicate or enforce my program to link to the Fantom driver ? Is libjfantom.jnlib useless (I read some posts about this file) ?

Cheers,
caribou
New User
 
Posts: 3
Joined: Wed Nov 07, 2012 9:02 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff