Hi. I am simply having issue starting the Arduino service in mrl through Intellij on my x64 intel cpu desktop PC.
My steps that led to the issue are as follows:
- I cloned MRL through intellij using the url https://github.com/MyRobotLab/myrobotlab.git
- I ran the SwingGui service's main method,
- I right clicked on the Arduino service in the SwingGui's service list and click start to start the Arduino service.
- I get the error "createAndStart(arduino, org.myrobotlab.service.Arduino) java.lang.NullPointerException" at the bottom of the SwingGui window and the Arduino service doesnt start.
I have already switched to the Java 1.8 JDK in both my environment variables (path and JAVA_HOME) , and I have set the MRL nixie project in the IDE to use the 1.8 JDK. I have checked that running "java -version" in cmd returns 1.8 and that the IDE log shows that I am using 1.8 when I run any main method in the project, so it shouldnt be an issue of java version. Manticore runs the Arduino service fine using the Jar. However, trying to run the Arduino service in nixie in my IDE (either by the method above, or directly via Runtime.start("myarduino", "Arduino"); ) does not work and gives me a null pointer exception which is traced back to a failure of the Arduino service to create a Registration, at the point where the service is converted toJson. I will share my code with you @Kwatters or @Grog, in case you want to inspect the MRL package I have for cause of the issue. I tried pushing my new branch but git said remote permission was denied to my username.
Raspberry Pi service
You need it to be running on the Raspberry Pi for this service to work.
Also check your version of Java
Share the full exception
Null pointers can come from anywhere. You need to share with us the full exception not the the type of exception. There is usually information about what line number caused the exception... That's very important.
That being said . You should be doing this testing as a unit test.. not just randomly launching some services main method.
Here is an old video that I did. Hopefully it helps.
https://youtu.be/XvxO07uoXLk
Hi Alex. Testing locally on
Hi Alex.
Testing locally on my system using SwingGui's main ... I get worky - I'm a little ahead of the latest Nixie, but I don't see any fixes locally that would be relevant.
You don't need permissions to do a pr
https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork - this is how most of my prs to other projects are done (I've done several against Apache Ivy)
The quickest way I suspect to get to the root of this is to see a noWorky
Verified the latest Nixie
Verified the latest Nixie code works when I download the jar
build 195 - mrl version 65
Hi Grog! So, thank for
Hi Grog! So, thank for testing the arduino service via the jar. It appears im only having issues with the ide clone. The jar version that I downloaded an hour ago is 1.1.1.95 , however, the IDE clone, which i cloned an hour ago into a new directory, is 1.1.1.86. I used this url to clone today https://github.com/MyRobotLab/myrobotlab.git Ive had no problem whatsoever getting the jar to run the arduino service (in both the web gui and swing gui) but still cant get the cloned ide version to create the arduino service either by running the swing gui service's main and clicking start on the arduino service in that swing gui list, or by adding "Runtime.start("arduino", "Arduino")" to the swinggui. Ive also tried opening the arduino service by starting the swinggui service, then clicking on the web gui service and, then trying to start the Arduino service. In any case, any attempt to run the Arduino service via the IDE is not working. I want to post my error log so you can see exactly what is happening, but im not sure if it will format correctly in these comments. Perhaps its just 1.1.1.86 that is the issue. Let me know what you think.
So, what i did was simply
Here is a link to pics of the
Here is a link to pics of the issues in my pom https://imgur.com/a/MBgjC7u
hmmm ... if their not
hmmm ...
if their not defined they should evaluete to "nothing" which should be fine ..
Apache Maven (the group that defined the pom) handles this without problem...
Is it just a linting problem in Intellij - or is it not building because of it ?
There has got to be a way to set env variables in Intellij
The reason they are there is because our Ci/Cd (Jenkins) passes the vars on each build.
Yea, there is a way to set
Yea, there is a way to set the environment variables. What variables do i need to set?
The ones you pointed out in
The ones you pointed out in the pom.xml file, if that is really an issue...
I'm not too familiar with intellj - otherwise I would be able to help more,
but I'm pretty sure "for whatever reason, your IDE is not correctly processing the pom.xml"
(usually this is maven under the hood)
Ahoy. So I got the arduino
Ahoy. So I got the arduino service running in the ide, but now im running into another issue that ive slowly tracked down. The Arduino service uses the Serial class , which implements the JSSC library classes, to make a connection to the serial ports. Unforturnately, although maven has dowloaded the jssc dependency into my .m2 repository, the JSSC directory that the Serial class imports from is not found in my project directory. Im not sure why this is the case, but my only guess was that perhaps there was supposed to be an additional step for maven to decompile the JSSC jar in the .m2 directory into the MRL project directory. Let me know what you think might be the issue here when you come back online. Thanks.
try eclipse
all of this stuff magically just works fine in eclipse and with command line maven. I suspect all of your issues are related to how the project was imported into intellij. have you tried eclipse?
There's not magic de-compiling.. the ".m2" directory is where maven caches the jar files that it downloads. intellij will use the same one.
I'll try it out in Eclipse
I'll try it out in Eclipse and report back ;)