Timer not running in prpduction - but in debug mode

I have deployed two timers and bought the extended execution time add on. When I start the timers in debug mode, it works like intended and data is written to the tables. But when I deploy and try to use them in production, no data is written to the tables. No matter if I wait until they are executed or if I execute the timers manually. My ApplicationId is 420FC3B2-ABE7-0A99-FF6A-DC4667D43700

Thanks for your help.

Hi Jens

Please specify what does your custom code do? Just adding a record to the data table? And are you using Java or JS timers?

Regards Anton

I am using Java timers. The timers are reading RSS feeds and write new items to the table.

I am using Java timers. The timers are reading RSS feeds and write new items to the table.

Jens

I was not able to reproduce the issue you described, timers work ok for me in debug and in production mode as well.

Please zip up your project and send to support@backendless.com. We’ll investigate the issue on our side.

Regards Anton

Okay, thanks. I have sent you my project via email.

Jens

This case requires more time for testing. I’ll contact you as soon as I get any info regarding the issue.

Regards Anton

Allright, thanks.

I hope this can be fixed quickly.

No progress with this issue?

Hi Jens,

We made changes in the code to capture any unhandled exceptions and put them in the log. This should help in identifying the root cause of the issue. These changes should be deployed to the production servers later today.

Regards,
Mark

Hi Jens

We’ve fixed the issue which was causing that exceptions caught from timers were not logged. Now when exceptions during invocations occur - you will be able to see error log in:
Manage > Log Management > log file (its name corresponds to the current day).

The error you get might be related to your attempt to manipulate with files which are not located in the backendless File service (which is not permitted). Please review this guide about coderunner limitations. Hope it will help to avoid further issues.

Regards Anton

Thanks for your support.
But is there a simple way, to use the Rometools lib within the Backendless Cloud project? This lib is very important for the project to work.

Hi Jens,

I am not familiar with Rometools. Could you please elaborate on what you learned from the logs?

Regards,
Mark

Hey Mark,

the Log says “Business logic execution has been stopped, due to error: Code: 0 Class: java.lang.NoClassDefFoundError Message: Could not initialize class com.rometools.rome.feed.synd.SyndFeedImpl”

RomeTools is a lib that offers functions to easily parse RSS Feeds. Is it genereally not allowed to user 3rd party libs via gradle?

You can add any 3rd party library, however, if the code in the library does something that is not allowed by our Java SecurityManager, the code will generate an error (which is now logged). Some of the examples of these restricted operations:

  • creating a server-side socket
  • direct access to the file system
  • creating threads without purchasing a function pack

Hope this helps.

Regards,
Mark

Hey Marc,

I guess the lib does create threads. But what kind of function pack do I have to purchase, to make that work? I can’t find a function pack for threads.

Best,
Jens

Hi Jens,

I need to find out the details. I know we did some work in coderunner to allow additional threads, but I am not sure if it was for CodeRunner 3.x or the new 4.0. I will post a response soon.

Mark

Hi, Jens.
This functionality (additional threads in your code) available only for 4.0 version.

Hi Oleg,

I have migrated my app to 4.0 but it still does not work. The log still says:

2017-04-28 16:29:17,849 | Coderunner | ERROR | Business logic execution has been stopped, due to error: Code: 0 Class: java.lang.ExceptionInInitializerError Message: null
2017-04-28 16:29:36,010 | Coderunner | ERROR | Business logic execution has been stopped, due to error: Code: 0 Class: java.lang.NoClassDefFoundError Message: Could not initialize class com.rometools.rome.feed.synd.SyndFeedImpl

In 4.0 I can’t find where to buy function pack. As far as I know, all functions are included, as is is still in beta. Am I right?

Hi Jens,

Since 4.0 is in beta, additional purchases are not required.

The error tells me that there is a problem in the static initializer of the com.rometools.rome.feed.synd.SyndFeedImpl class. Do you know what is going on there?

Regards,
Mark