#205 nhaystack - {accept: application/json} on a Jace

Christian Tremblay Mon 1 Sep 2014

I've made some tests with python and found out that if I make get request (asking for application/json), I get a server error (500 / java.lang.StringBuilder)

Guess it's a library not working on Jace ?

Works perfectly if I use a station running on a PC (json data is served)

Actually, it seems I'll need to focus on Zinc but json was some much closer to Python objects...

Is this something that can be fixed ?

Christian Tremblay Mon 1 Sep 2014

Could this be caused by the way I compiled to module with Eclipse ? I may have specified the wrong library ?

Richard McElhinney Mon 1 Sep 2014

java.lang.StringBuilder is only available since Java 1.5 according to the Java Docs online, http://docs.oracle.com/javase/7/docs/api/java/lang/StringBuilder.html, if you built the module using a Java 1.5 or higher compiler and loaded it onto a Jace it may not run depending on which version of Java is running on the Jace.

Historically the Jace was running a 1.3 compliant JVM, however later Jaces are now running the Sun HotSpot JVM which conforms to Java 1.5.

When running on your PC it normally defaults to the JVM on the system which would more than likely be 1.5 or (much much) higher.

It kind of depends what you specified in your build.xml file.

Cheers, Richard

Christian Tremblay Mon 1 Sep 2014

So it's not how I built the module but how old is the Jace.

I'm doing my test on an old Jace, upgraded to 3.7 and it cannot find the class.

I understand that this cannot be upgraded. Can't use json format on old devices...

Mike Jarmy Tue 2 Sep 2014

Are you saying that nhaystack generates an error? Or is it your own custom module? Either way, do you have a server-side stack trace?

Christian Tremblay Tue 2 Sep 2014

I've tried with the "already compiled" module found on bitbucket and it's the same error (that we can see on the dialog output of the Jace).

Can't be more precise as I can't login right now

But it looks like

JsonWriter....java.lang.StringBuilder class not found

Mike Jarmy Tue 2 Sep 2014

aha, I think I know what might be going on here. I believe that the haystack-java toolkit may have been compiled agasint 1.5+ instead of 1.3 like it should have been. I will look into this and provide a fix in the next build, which is coming quite soon.

Login or Signup to reply.