I have a problem that is 'rJava' and 'KoNLP' package deploy.

64 views
Skip to first unread message

pow...@spi.co.kr

unread,
Apr 2, 2018, 9:07:05 PM4/2/18
to shinyapps.io Users
help~~

my local machine is running but not deploy.


Below is My source code

library(shiny)
library(tm)
library(stringr)
library(rJava)
library(KoNLP)

# Define UI for data upload app ----
ui <- fluidPage(
  
  # App title ----
  titlePanel("Topkeyword Producing"),
  
  # Sidebar layout with input and output definitions ----
  sidebarLayout(
    
    # Sidebar panel for inputs ----
    sidebarPanel(
      
      # Input: Select a file ----
      fileInput("file1", "Choose csv or txt File",
                multiple = TRUE,
                accept = c("text/csv",
                           "text/comma-separated-values,text/plain",
                           ".csv")),
      
      # Horizontal line ----
      tags$hr()
    ),
    
    mainPanel(
      
      tableOutput("contents")
      
    )
    
  )
)

# Define server logic to read selected file ----
server <- function(input, output) {
  
  output$contents <- renderTable({
    
    req(input$file1)
    f <- file(input$file1$datapath, blocking = F, open='r')
    txtlines <- readLines(f, skipNul = T, encoding="UTF-8")
    close(f)
    
    txtlines <- str_replace_all(txtlines, "[^[:alnum:]]", " ")
    txtlines <- toupper(txtlines)
    
    nounslist <- alply(txtlines, 1, extractNoun, .inform=T)
    nouns <- unlist(nounslist)
    realnouns <- nouns[nchar(nouns) >= 2]
    wordcount <- sort(table(realnouns), decreasing=T)
    wordcountfr <- as.data.frame(wordcount)
    
    return(wordcountfr)
  })
}

shinyApp(ui, server)

***********************************************************************************************************

Below is an error message when I publish

Preparing to deploy application...DONE
Uploading bundle for application: 310822...DONE
Deploying bundle: 1298860 for application: 310822 ...
Waiting for task: 517752459
  building: Parsing manifest
  building: Installing system dependencies
  building: Fetching packages
  building: Building package: KoNLP
################################ Begin Task Log ################################ 
[2018-04-03T00:53:23.943368399+0000] Execute script: packages/build/rJava.sh
+ set -e
+ /usr/bin/R CMD javareconf
*** JAVA_HOME is not a valid path, ignoring
Java interpreter : /usr/bin/java
Java version     : 1.8.0_141
Java home path   : /usr/lib/jvm/java-8-openjdk-amd64/jre
Java compiler    : /usr/bin/javac
Java headers gen.: /usr/bin/javah
Java archive tool: /usr/bin/jar

trying to compile and link a JNI program 
detected JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
detected JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c conftest.c -o conftest.o
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o conftest.so conftest.o -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm -L/usr/lib/R/lib -lR


JAVA_HOME        : /usr/lib/jvm/java-8-openjdk-amd64/jre
Java library path: $(JAVA_HOME)/lib/amd64/server
JNI cpp flags    : -I$(JAVA_HOME)/../include -I$(JAVA_HOME)/../include/linux
JNI linker flags : -L$(JAVA_HOME)/lib/amd64/server -ljvm
Updating Java configuration in /usr/lib/R
Done.

Joshua Spiewak

unread,
Apr 3, 2018, 10:33:08 AM4/3/18
to shinyapps.io Users
Reply all
Reply to author
Forward
0 new messages