R-Shiny crashes using 'hdfs.init()'



My R shiny application kept crashing if I attempt to initiate a HDFS connect with the function ‘hdfs.init()’. It happens when there is a renderPlot/plotOutput attempt. The following code fully reproduces the issue.
Commenting out the line with ‘hdfs.init()’, the code would work without any problem.
Any help on troubleshooting the issue would be greatly appreciated.



ui <- fluidPage(
  plotOutput("Chart", width="560px", height='420px')

server <- function(session, input, output) {
  output$Chart=renderPlot(ggplot(data=data.frame(x=1:2, y=3:4), aes(x=x, y=y))+geom_abline())

#Run ShinyApp
shinyApp(ui=ui, server=server)


Hi, does hdfs.init() fail in a normal R console?

For example, does the following command produce the same error?

R -e 'library(rhdfs);hdfs.init()'

If so, it looks like the rhdfs looks like it has Java dependencies, and they might be the root of the problem.