Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in .jcheck: Java Exception <no description because toString() failed> #180

Open
mmoralesIG opened this issue Jul 12, 2021 · 9 comments

Comments

@mmoralesIG
Copy link

mmoralesIG commented Jul 12, 2021

Months ago I had this issue and I fixed it by updating the rJava package.
But now I had to update xlsx and again it's not working, regardless the rJava package

The rest of the message is
.jcall("RJavaTools", "Z", "hasMethod", .jcast(x, "java/lang/Object"), name)new("jobjRef", jobj = <pointer: 0x556275683bd0>, jclass = "java/lang/Throwable")

I need it since I'm using createstyle and other cell format related functions.

My R version is 3.6.3, RTools 3.5, xlsx 0.6.5, rJava 1.0.4

@colearendt
Copy link
Owner

colearendt commented Jul 12, 2021

Hello @mmoralesIG ! I'm sorry to hear about your trouble! Does rJava work? i.e. trying rJava::.jinit()? Can you show a reprex, perhaps?

(EDIT: fixed link)

@mmoralesIG
Copy link
Author

mmoralesIG commented Jul 13, 2021

Hello @mmoralesIG ! I'm sorry to hear about your trouble! Does rJava work? i.e. trying rJava::.jinit()? Can you show a reprex, perhaps?

(EDIT: fixed link)

Hi! thank you for your speed answer
I got 0

rJava::.jinit()

Created on 2021-07-12 by the reprex package (v2.0.0)

but I'll try it in the application, since in my local works
yep, also 0 in the deployed app

@colearendt
Copy link
Owner

Perfect! Good to know! That is the expected result. Can you provide a reprex of the code that is causing the broken behavior, perhaps? That would be helpful to understand what is happening.

@mmoralesIG
Copy link
Author

mmoralesIG commented Jul 13, 2021

Perfect! Good to know! That is the expected result. Can you provide a reprex of the code that is causing the broken behavior, perhaps? That would be helpful to understand what is happening.

The original script is quite long since it's a report (a whole workbook). I made a pretty simple one and this
it's just a download button, it reads a small csv and then write's it into a xlsx.
It's in a small shiny application. (https://inspeccionesglobales.shinyapps.io/cajas_colores/ where it says "descargar tabla")

(and since it's in a application, the reprex doesn't quite work. it downloads fine in my laptop, but not when I deploy)

output$downloadData <- downloadHandler(
    filename = function() {
      paste('test-', Sys.Date(), '.xlsx', sep='')
    },
    content = function(con) {
      df <- read.csv("./data/coordenadas_zonas.csv")
      
      write.xlsx(df,con)
    })

the libraries used
library(shiny)
library(shinydashboard)
library(shinyWidgets)
library(lubridate)
library(tidyr)
library(dplyr)

library(xlsx)

@colearendt
Copy link
Owner

colearendt commented Jul 13, 2021

Thank you for providing this simple example!! Removing layers of complexity to get to the core issue is very helpful 😄 Is it possible to reproduce with a simple / public CSV? That is one that I do not have access to. I'm wondering if something about the language / etc. is causing the trouble on the shinyapps.io environment. Can you print the output of the following locally and in the deployed application? Sharing both here?:

devtools::session_info()

@mmoralesIG
Copy link
Author

Thank you for providing this simple example!! Removing layers of complexity to get to the core issue is very helpful 😄 Is it possible to reproduce with a simple / public CSV? That is one that I do not have access to. I'm wondering if something about the language / etc. is causing the trouble on the shinyapps.io environment. Can you print the output of the following locally and in the deployed application? Sharing both here?:

devtools::session_info()

Hi, I modified the dataframe to something simpler: a row with sys.time

output$downloadData <- downloadHandler(
    filename = function() {
      paste('test-', Sys.Date(), '.xlsx', sep='')
    },
    content = function(con) {
      
      df <- data.frame(n=1,"time"=Sys.time() )
      print(devtools::session_info())
      write.xlsx(df,con)
          })

And the shiny.app.logs.txt is the downloaded log of the deployed app, meanwhile the local.session.info is the one from my computer

I really appreciate your help on this

shiny app logs.txt
local session info.txt

@datavisyn-ro-v
Copy link

Hello, any solution to this issue? We're suffering from the same problem in 0.6.5 and R 4.1 .

@mmoralesIG
Copy link
Author

I switched to the package openxlsx, with minor modifications to existing code.

@colearendt
Copy link
Owner

I'm working on getting CI set up so we can actually test against R 4.1 a bit better. Apologies for the trouble! If openxlsx works for you, that is a great alternative!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants