我的第二个问题:我是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 / scriptella-1.1 / bin / scriptella.sh -debug“prova_per_scriptella.etl”我的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>
批处理命令的脚本var $ _SCRIPTELLA_CP scriptella / scriptella-1.1 / bin / scriptella.sh导致
:/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
非常感谢任何帮助。提前谢谢。
答案 0 :(得分:1)
刚才有人问过,但我想我可能会回答这个问题,因为我遇到了同样的问题。
答案的关键是在堆栈跟踪Caused by: java.lang.ClassNotFoundException: org.apache.poi.xssf.usermodel.XSSFWorkbook
的末尾。
这可以通过包含最新的poi下载here中包含的所有库来修复。
答案 1 :(得分:0)
我也遇到了问题。不是按照otty的建议下载最新版本,而是查看net.pcal.sqlsheet.XlsDriver的pom.xml文件(这是scriptella.driver.xls.Driver试图实例化的内容)。我们正在使用正确的依赖关系。