xlsx icon indicating copy to clipboard operation
xlsx copied to clipboard

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

Open mmoralesIG opened this issue 4 years ago • 9 comments

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

mmoralesIG avatar Jul 12 '21 22:07 mmoralesIG

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)

colearendt avatar Jul 12 '21 23:07 colearendt

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

mmoralesIG avatar Jul 13 '21 00:07 mmoralesIG

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.

colearendt avatar Jul 13 '21 01:07 colearendt

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)

mmoralesIG avatar Jul 13 '21 02:07 mmoralesIG

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()

colearendt avatar Jul 13 '21 10:07 colearendt

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

mmoralesIG avatar Jul 13 '21 14:07 mmoralesIG

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

datavisyn-ro-v avatar Sep 17 '21 07:09 datavisyn-ro-v

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

mmoralesIG avatar Sep 17 '21 14:09 mmoralesIG

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!

colearendt avatar Jan 29 '22 04:01 colearendt