Java Lang Error 137 | Telit Cinterion IoT Developer Community
September 6, 2016 - 5:06am, 3556 views
Hello,
I am running a Java program on EHS6 sending some data through ASC0 of EHS6, but sometime it yields java.lang.Error: 137, sometime not. Although I put the code in try catch block I still get this error sometimes and my midlet is quitted unexpectly. Does any one have any idea about java.lang.Error: 137? I try to search for it but only find "java exit code 137", is it the same?
Thanks,
Thanh
Hello,
This error indicates some serious problem, abnormal condition that generally should never happen. The programmer is not required to catch it in most cases should not do that. There is no guarantee that the application will be able to recover from that. It could probably be caused by some problem during runtime but also a programming error or maybe the application was built in a wrong way. At the moment it is hard to say what the reason is.
If you get in in the development phase you have to debug it and possibly find the cause.
The java.lang.Error class is not a subclass of java.lang.Exception so to catch it you would have to catch java.lang.Error or java.lang.Throwable.
Does it always happen in the same place during the same operation? What else is your application doing? What hardware is connected? Is it using any external libraries? Is it reproducible on more than one module?
Regards,
Bartłomiej
Hi Bartlomiej,
Thanks for your info. Yes, it produced that error for all module, however when I tried to rebuild the problem is gone. But I need to test more whether because of compile process. In my program I implemented my own "Error" class to process some internal errors, does the same name "Error" cause this problem?
In my program, I connect to a device using ASC0 communication, when there is attahced device the problem does not happened. When there is no conected device my error object (instance of my Error class) will set a private flag, and the problem happen.
BTW, I will change the class name "Error" and see what happen.
Thanks for your support again.
Thanh
Hello,
It's better not to use the same names as the classes from API but this should rather not cause java.lang.Error to be thrown.
If your application throws the Error when the device is not connected you should analyse the application behaviour in that case. Or maybe there's some hardware issue.
Regards,
Bartłomiej