0

我的第二个问题:我是 Linux/Java/Scriptella 的新手,我正在尝试在 xls 本地文件上与 scriptella 建立 jdbc 连接,但我收到以下错误:

4-dic-2013 0.41.46 <GRAVE> Script /home/maurizio/Scrivania/JATROPHA/applicazioni/prova_per_scriptella.etl execution failed.
Unable to instantiate driver for class scriptella.driver.xls.Driver
JDBC provider exception: Couldn't find appropriate jdbc driver : net.pcal.sqlsheet.XlsDriver. Please check class path settings
Error codes: []
4-dic-2013 0.41.46 <GRAVE> Scriptella bug report. Submit to issue tracker.
Scriptella version: 1.1
Exception: 
scriptella.execution.EtlExecutorException: Unable to instantiate driver for class scriptella.driver.xls.Driver
JDBC provider exception: Couldn't find appropriate jdbc driver : net.pcal.sqlsheet.XlsDriver. Please check class path settings
Error codes: []
    at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:190)
    at scriptella.tools.launcher.EtlLauncher.execute(EtlLauncher.java:276)
    at scriptella.tools.launcher.EtlLauncher.launch(EtlLauncher.java:193)
    at scriptella.tools.launcher.EtlLauncher.main(EtlLauncher.java:321)
Caused by: java.lang.IllegalStateException: Unable to instantiate driver for class scriptella.driver.xls.Driver
    at scriptella.core.DriverFactory.getDriver(DriverFactory.java:98)
    at scriptella.core.DriverFactory.getDriver(DriverFactory.java:58)
    at scriptella.driver.auto.Driver.getConnection(Driver.java:96)
    at scriptella.driver.auto.Driver.connect(Driver.java:77)
    at scriptella.core.ConnectionManager.getConnection(ConnectionManager.java:81)
    at scriptella.core.Session.<init>(Session.java:57)
    at scriptella.execution.EtlExecutor.prepare(EtlExecutor.java:248)
    at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:178)
    ... 3 more
Caused by: scriptella.jdbc.JdbcException: Couldn't find appropriate jdbc driver : net.pcal.sqlsheet.XlsDriver. Please check class path settings
    at scriptella.jdbc.GenericDriver.loadDrivers(GenericDriver.java:87)
    at scriptella.driver.xls.Driver.<init>(Driver.java:33)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:534)
    at java.lang.Class.newInstance(Class.java:374)
    at scriptella.core.DriverFactory.getDriver(DriverFactory.java:96)
    ... 10 more
Caused by: java.lang.NoClassDefFoundError: org/apache/poi/xssf/usermodel/XSSFWorkbook
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at scriptella.jdbc.GenericDriver.loadDrivers(GenericDriver.java:67)
    ... 17 more
Caused by: java.lang.ClassNotFoundException: org.apache.poi.xssf.usermodel.XSSFWorkbook
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
    ... 20 more

我正在使用 Ubuntu 10.04 Lucid Lynx。

我通过控制台在目录 /home/maurizio/Scrivania/JATROPHA/applicazioni/ 使用命令 scriptella/scriptella-1.1/bin/scriptella.sh -debug "prova_per_scriptella.etl" 启动 scriptella 我的 ETL 文件 prova_per_scriptella.etl 包含以下行:

<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
  <description>Prova connessione Firebird e XLS</description>
  <connection 
    id="fb_destination" 
    driver="org.firebirdsql.jdbc.FBDriver"
    url="jdbc:firebirdsql:localhost/3050:jatropha" 
    user="SYSDBA" 
    password="jatro201"
    classpath="/home/maurizio/Scrivania/JATROPHA/applicazioni/jaybird/Jaybird-2.2.3JDK_1.6/jaybird-2.2.3.jar"
  />
  <connection 
    id="xls_source" 
    url="jdbc:xls:file:prova_per_scriptella.xls"
    classpath="/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/sqlsheet-6.5.jar"
  />
</etl>

批处理命令 scriptella/scriptella-1.1/bin/scriptella.sh 的环境变量 $_SCRIPTELLA_CP 导致

:/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/commons-jexl.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/commons-logging.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/jaybird-2.2.3.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/jsqlparser-0.8.0.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/mini-j2ee.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/scriptella-core.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/scriptella-drivers.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/scriptella-tools.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/sqlsheet-6.5.jar

我的 scriptella lib 目录包含以下文件:

commons-jexl.jar
commons-logging.jar
jaybird-2.2.3.jar
jsqlparser-0.8.0.jar
mini-j2ee.jar
scriptella-core.jar
scriptella-drivers.jar
scriptella-tools.jar
sqlsheet-6.5.jar

任何帮助将不胜感激。提前致谢。

4

2 回答 2

1

不久前有人问过这个问题,但我想我还是可以回答这个问题,因为我遇到了同样的问题。

答案的关键在堆栈跟踪的末尾Caused by: java.lang.ClassNotFoundException: org.apache.poi.xssf.usermodel.XSSFWorkbook

这可以通过包含在此处找到的最新 poi 下载中包含的所有库来解决。

于 2014-05-04T03:57:49.050 回答
0

我也遇到了问题。与其按照 otty 的建议下载最新版本,不如查看 net.pcal.sqlsheet.XlsDriver 的 pom.xml 文件(这是 scriptella.driver.xls.Driver 尝试实例化的内容。这个我们使用正确依赖项的方式。

于 2016-03-02T03:02:29.790 回答