1

我是 Linux/Java/Scriptella 的新手,我正在 Firebird 本地数据库上尝试与 scriptella 建立 jdbc 连接,但收到以下错误:

2-dic-2013 1.03.34 <INFO> Execution Progress.Initializing properties: 1%
2-dic-2013 1.03.34 <GRAVE> Script /home/maurizio/Scrivania/JATROPHA/applicazioni/prova_per_scriptella.etl execution failed.
javax/resource/ResourceException
2-dic-2013 1.03.34 <GRAVE> Scriptella bug report. Submit to issue tracker.
Scriptella version: 1.1
Exception:
scriptella.execution.EtlExecutorException: javax/resource/ResourceException
    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.NoClassDefFoundError: javax/resource/ResourceException
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:270)
    at scriptella.core.DriverFactory.getDriver(DriverFactory.java:53)
    at scriptella.core.ConnectionManager.<init>(ConnectionManager.java:70)
    at scriptella.core.Session.<init>(Session.java:51)
    at scriptella.execution.EtlExecutor.prepare(EtlExecutor.java:248)
    at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:178)
    ... 3 more
Caused by: java.lang.ClassNotFoundException: javax.resource.ResourceException
    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)
    ... 10 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</description>
  <connection
    id="fb_destination"
    driver="org.firebirdsql.jdbc.FBDriver"
    url="jdbc:firebirdsql:localhost/3050:/home/maurizio/Scrivania/JATROPHA/db/jatrofa.fdb"
    user="user"
    password="password"
    classpath="/home/maurizio/Scrivania/JATROPHA/applicazioni/jaybird/Jaybird-2.2.3JDK_1.6/jaybird-2.2.3.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/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

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

4

2 回答 2

2

您缺少所需的依赖项connector-api-1.5.jar,或者您需要使用jaybird-full-2.2.3.jar(包括普通的 Jaybird 和 connector-api)。请参阅Jaybird 2.2.3 的发行说明

于 2013-12-04T12:49:19.243 回答
1

该错误意味着您可能错过了类路径上的其他 J2EE 类。尝试从http://www.firebirdsql.org/en/jdbc-driver/下载 mini-j2ee.jar并将其添加到 etl.xml 中的类路径属性:

classpath="/path/to/mini-j2ee.jar:/home/maurizio/Scrivania/JATROPHA/applicazioni/jaybird/Jaybird-2.2.3JDK_1.6/jaybird-2.2.3.jar"
于 2013-12-03T05:29:46.007 回答