Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Kura » No Exception is thrown in some situations
No Exception is thrown in some situations [message #1758276] Sun, 26 March 2017 23:09 Go to next message
Fatih o. is currently offline Fatih o.Friend
Messages: 5
Registered: March 2017
Junior Member
Hello everybody,

this is my first post in this forum and I hope we will hear more. I have started to learn Kura since two days and have spent more than 20 hours but still I feel that I am at the very beginning. I hope with your helps, I will go further much faster than I would go alone.

When it comes to my question,

I am using DropBox API and with some business logic, I want to send a text file to my Dropbox account in predefined intervals. When I do it on my local computer, everything works perfect and then, I have implemented the same code in OSGI way and imported to the KURA. To some point, my code works perfect until this point in code;

		
  String emailAdress = null;
     try {
	emailAdress = client.users().getCurrentAccount().getEmail(); // <-
	LOGGER.info("The email adress is " + emailAdress);
      } catch (DbxException e) {
	LOGGER.error("Could not get the email adress. The reason is; " + e.getMessage());
	}


After the first line in the try block, it does not throw any exception (i controlled by kura.log and kura-console.log) and the program gets stuck at the point because after catch block there are other log info, they will not be written as well.

Except for kura.log and kura-console.log, are there any other files, which I should check when something like that happens and how should I approch to solve such a problem?

Thanks you all in advance.

[Updated on: Wed, 29 March 2017 00:31]

Report message to a moderator

Re: No Exception is thrown in some situations [message #1758448 is a reply to message #1758276] Tue, 28 March 2017 18:40 Go to previous messageGo to next message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

All output from Kura is written to kura.log (log4j logger and kura-console.log (system out). If you are not seeing anything written to kura.log after this line of code, I am guessing Kura is crashing. Can you confirm if Kura is still running (ps aux | grep java)? If it is not running, you can check /var/log/syslog to see if the JVM crashed with an OOM.

When you say you had this running on your laptop, is it a plain Java application or an OSGi application? My guess is your bundle is missing libraries that it needs. You may want to try running the Kura emulator from the workspace, this may make debugging easier.

Thanks,
--Dave
Re: No Exception is thrown in some situations [message #1758464 is a reply to message #1758448] Wed, 29 March 2017 00:36 Go to previous messageGo to next message
Fatih o. is currently offline Fatih o.Friend
Messages: 5
Registered: March 2017
Junior Member
No, JVM does not crash.

After this question, I have learnt how to debug an Osgi application in Kura and detected that it threw actually an exception (java.lang.NoClassDefFoundError). However, it is not written to log files of the Kura.

A follow up question, Where should be checked to see the exceptions (logs), which are thrown by JVM or any other application/process (not defined specifically with logger) ?

Thank you for your answer.

[Updated on: Wed, 29 March 2017 00:40]

Report message to a moderator

Re: No Exception is thrown in some situations [message #1758515 is a reply to message #1758464] Wed, 29 March 2017 13:49 Go to previous message
David Woodard is currently offline David WoodardFriend
Messages: 420
Registered: July 2014
Senior Member
Hello,

Standard out from the JVM will be in /var/log/kura-console.log. I am surprised the NoClassDefFoundError did not show up there. This error was likely thrown from OSGi, which may have prevented it from showing in the log file. In any case, learning to use the OSGi console is a good idea. Whenever you are having an issue with a bundle, you should always check the OSGi 'ss' and 'ls' commands first.

Thanks,
--Dave
Previous Topic:Kura GUI (Java swing) issues
Next Topic:Device SSL Certificate error
Goto Forum:
  


Current Time: Fri Apr 26 14:26:40 GMT 2024

Powered by FUDForum. Page generated in 0.03456 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top