Java Compiler Version | Telit Cinterion IoT Developer Community
June 11, 2018 - 10:46am, 6775 views
Hai! I received the installstallation CD from the distributor. However i went through the userguide, there was one part mentioning Java compiler setting should be set to 1.3 or 1.4. But what i get from my distributor was a jdk 1.7 version. Does this effect on my project when using Eclipse for Java Development? Coz what i experienced was an abnormal exit when i ran a Midlet file in Eclipse with the installation of jdk 1.7.
Hello,
When you cannot install the MIDlet it's probably not built correctly. In case of Eclipse you need to add the library to the project and also mark it for export in the project configuration (Properties/Java Build Path/Order and Export).
Certificate failed verification while running the MIDlet suggests that you might have made a mistake in preparation and installation of certificates.
Can you provide the complete log from what you did step by step while preparing and installing the certificates.
Regards,
Bartłomiej
Hai.
I ran in two platforms to try on.
This is from my java console. For the library export, i only tick on the cwmlib (for at command). I tried before to tick the org.paho for export too but it can't be run, it poped out and mentioned that the file got error.
Registering ip address "192.168.244.1" of remote debugging device...
Waiting for debug device registration of "IMP_NG_EHS5_REMOTE"...
Passing control to external device emulator...
Installing suite from: http://192.168.244.2:49697/june.jad
java.lang.NoClassDefFoundError: org/eclipse/paho/client/mqttv3/MqttException
- java.lang.Class.invoke_verify(), bci=0
- java.lang.Class.initialize(), bci=100
- java.lang.Class.forName(), bci=0
- com.sun.midp.main.CldcMIDletLoader.newInstance(), bci=1
- com.sun.midp.midlet.MIDletStateHandler.createMIDlet(), bci=63
- com.sun.midp.midlet.MIDletStateHandler.createAndRegisterMIDlet(), bci=17
- com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=24
- com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=38
- com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=5
- com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=134
- com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
MIDlet:june2 abnormal exit
End of debug session. Emulator is closed!
Next, i tried on netbean with the same program. Both program is the same which i revised from the pdf file(the same link that previously u sent to me). When i trying to build, it say
Preverifying 128 file(s) into C:\Users\student\Documents\NetBeansProjects\MobileApplication1\build\IMP_NG_EHS5_REMOTE1\preverified directory.
Error preverifying class org.eclipse.paho.client.mqttv3.internal.SSLNetworkModule
VERIFIER ERROR org/eclipse/paho/client/mq
ttv3/internal/TCPNetworkModule.start()V:
Cannot find class java/net/SocketAddress
IMP_NG_EHS5_REMOTE1: The following error occurred while executing this line:
C:\Users\student\Documents\NetBeansProjects\MobileApplication1\nbproject\build-impl.xml:1204: The following error occurred while executing this line:
C:\Users\student\Documents\NetBeansProjects\MobileApplication1\nbproject\build-impl.xml:431: Preverification failed with error code 1.
C:\Users\student\Documents\NetBeansProjects\MobileApplication1\nbproject\build-impl.xml:1235: The following error occurred while executing this line:
C:\Users\student\Documents\NetBeansProjects\MobileApplication1\nbproject\build-impl.xml:1201: Keepgoing execution: 1 of 1 iterations failed.
BUILD FAILED (total time: 1 second)
About the installing the certificates, i downloded the 3 files from aws and convert and install the cert by obtain the binary file (addHttpsCertificateUntrusted.bin & AddHttpsClientCertificateUntrusted.bin). I also on the HttpsVerifyOnUntrusted. Followed exactly the same in the steps stated. Next in both the platforms, i created a midlet file that have startApp, pauseApp and destroyedApp. After i retype again the program included in the example and import the necessary librarys (cwmlib and the paho). After, i configure the signing session to included my keystore. My keystore have 2 aliases which are the client cert and the VeriSign cert. In java, under signing, both aliases are detected. In netbean, only client cert(aws iot cert) is detected. But i have imported into the emulator for the aws cert and verisign cert (I can see both certs in the key emulators). The problems started when i try to run or build. I think i have done the necessary steps but still couldn't get it. The expected is i can use at command to get and post to aws iot console under test there right?
Thanks for being so patient with me.
Hello,
If you use jar library in your project you need to export it because you will get java.lang.NoClassDefFoundError sooner or later (when your code refers to classes in this library). In this paho example there is also source code which you can add to your project instead of the jar library. Please try this. I have already tried and the application was working. So far without certificates.
In case of certificates it would be easier to help you if you published the exact log.
This demo app just publishes one message to MQTT broker.
Regards,
Bartłomiej
Hi
If i export the paho library, i get the preverification errors. In java ME eclipse, Under preference > preverification, i set cldc 1.1 and emulator preverifier, same as when i right click the project properties > preverification.
Hello,
You should not need to change anything in Eclipse general settings. I have tested this and was able to build MIDlet with this jar library an run it with success. Maybe you should try to use the fresh Eclipse copy from the installation CD for the module with the new workspace for test.
Or just try to use the java code instead jar library to check if this works for you.
Regards,
Bartłomiej