1

I have my shinyapp deployed on Shiny Server. I use RJDBC::JDBC() method to connect to Redshift DB.

RedshiftJDBC42-1.2.1.1001.jar file is in the folder called "driver" which is in the same folder as app.R file, the argument 'driverClass' is "com.amazon.redshift.jdbc42.Driver" and 'classPath' argument I provide is ".../driver/RedshiftJDBC42-1.2.1.1001.jar" but when I want to run the app in my browser, I get the following message (in browser):

An error has occurred

The application failed to start.

The application exited during initialization.

In the log I find the following:

Error in .jfindClass(as.character(driverClass)[1]) : class not found Calls: runApp ... ..stacktraceon.. -> JDBC -> is.jnull -> .jfindClass

I tried to set the CLASSPATH ('...' classified folders ):

export CLASSPATH="/home/.../driver/RedshiftJDBC42-1.2.1.1001.jar"

but this does not work.

Please help.

Julia
  • 11
  • 4
  • you forget to put the .jar on the shiny server – s.brunel Aug 24 '17 at 13:44
  • well, I use WinSCP to upload files, and as I said .jar file is in the folder that is parallel to app.R, is there any other place I should put it? – Julia Aug 24 '17 at 13:51
  • you need to do `jdbcDriver <- JDBC(driverClass="com.amazon.redshift.jdbc42.Driver", classPath="the jar adress on shiny server" )` – s.brunel Aug 24 '17 at 14:14
  • yes, it is as you say, still does not work – Julia Aug 24 '17 at 14:29
  • you need to use \\ instead of `/` in the path – s.brunel Aug 24 '17 at 14:41
  • Solved. The problem was with Java version, when I checked it by > library(rJava) > jinit() > .jcall("java/lang/System", "S", "getProperty", "java.runtime.version") it turned out I needed Java 8, but provided Java 7 – Julia Aug 25 '17 at 09:20

1 Answers1

0

put the diriver under /opt make like /opt/driver/driver/RedshiftJDBC42-1.2.1.1001.jar double check the path ... it is case sensitive