DAVIDWebService$new(): Error: .jinit(...) == 0 is not TRUE 1 0 Entering edit mode Aditya ▴ 140 @aditya-7667 Last seen 3 months ago Germany I tried to use RDAVIDWebService (I did fill in a proper registered email address ): require(RDAVIDWebService) david <- DAVIDWebService$new(email = 'myemailaddress')

But that gave me the following error:

Error: .jinit(...) == 0 is not TRUE

I am using R 3.1.3 from within Architect

rdavidwebservice • 1.1k views
1
Entering edit mode
Last seen 3 months ago
Germany

I noticed that the error only occurs during the very first call to DAVIDWebService(). If the call is repeated a second time, no error is thrown and the call works (if R is restarted, the problem reoccurs the first time DAVIDWebService() is called):

require(RDAVIDWebService) david <- DAVIDWebService$new(email = 'myemailaddress') Error: .jinit(...) == 0 is not TRUE david <- DAVIDWebService$new(email = 'myemailaddress')   # Now it works!

So that suggests that for some reason .jniti() is not properly initialized within DAVIDWebService. I found that a fix is to explicitly call .jinit() before the DAVIDWebService function call.

# First start a fresh R session to ensure .jinit has not yet been run
require(RDAVIDWebService)
.jinit()
david <- DAVIDWebService\$new(email = 'myemailaddress')