在尝试Kettle的webstart方式运行时,遇到了一点问题,最终解决。
一、下载kettle
从http://sourceforge.net/projects/pentaho/files/下载pdi3.2(也就是kettle)。
二、ant webstart
解压后等到kettle trunk目录,在cmd下,直接ant webstart。如果出现编译错误,是因为没有把当前路径加到classpath。
再尝试,会出现以下错误:
signjar] Signing JAR: G:/Work/Kettle/webstart/libext/salesforce/saaj.jar
[signjar] 警告: 签名者证书将在六个月内过期。
[signjar] Signing JAR: G:/Work/Kettle/webstart/libext/salesforce/salesforce-1.0.jar
[signjar] jarsigner: 无法对 jar 进行签名 : java.util.zip.ZipException: duplicate entry: com/sforce/soap/partner/AssignmentRuleHeader.class BUILD FAILED
产生的原因为libext/salesforce/salesforce-1.0.jar 里面有重复的文件,不知道为什么会这样,删除重复的文件后(可先用WinRAR解缩,再用压缩),就正常了。
三、部署
将生成的war包,改名为了kettle.war,放到Tomcat的webapps下。访问http://localhost:8080/kettle,就可以页面上看到一个链接,点击链接将开始下载jnlp依赖的jar文件。如果你使用的Tomcat是6.0之前的,请在%tomcat_home%/conf/web.xml文件中,添加
<mime-mapping>
<extension>jnlp</extension>
<mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>
下载过程中,会出现一个“jar签名不一致 ”的错误,产生的原因是spoon.jnlp依赖到的部分jar,已经有其他厂商签名过了。请删除spoon.jnlp中这段代码:
<jar href="libswt/common.jar"/>
<jar href="libswt/commands.jar"/>
<jar href="libswt/jface.jar"/>
<jar href="libswt/runtime.jar"/>
继续尝试,还会提示找不到Spoon类 ,需要修改spoon.jnlp,指定Main文件所在的jar
<jar href="lib/kettle-ui-swt.jar" main="true"/>
继续尝试,已经可以完全下载,出现安全提示,点击“运行”之后,屏幕闪了一下,就没有任何显示了。启用Java 控制台,发现错误如下:
Exception in thread "javawsApplicationMain" java.lang.NoClassDefFoundError: org/pentaho/di/core/database/DatabaseMeta
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
因为没有导入kettle-db.jar,修改spoon.jnpl
<jar href="lib/kettle-core.jar"/>
<jar href="lib/kettle-ui-swt.jar" main="true"/>
<jar href="lib/kettle-engine.jar"/>
<jar href="lib/kettle-db.jar"/>
还是会有异常出现说找不到图片文件。
NFO 27-
08 15:15:50,734 - Using "C:/DOCUME~1/administator/LOCALS~1/Temp/vfs_cache" as temporary files store.
ERROR 27-
08 15:15:51,234 - Spoon - Fatal error : java.lang.RuntimeException: Unable to load image with name [ui/images/spoon.ico]
ERROR 27-
08 15:15:51,234 - Spoon - java.lang.RuntimeException: Unable to load image with name [ui/images/spoon.ico]
at org.pentaho.di.ui.util.ImageUtil.getImageAsResource(ImageUtil.java:77)
at org.pentaho.di.ui.core.dialog.Splash.<init>(Splash.java:48)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:380)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
将源文件的ui目录复制到桌面,再运行,窗口已经可以显示,但还是有错误信息:
ERROR 27-
08 15:21:05,062 - Kettle - Unable to create job entry from plugin [org.pentaho.di.job.JobPlugin: SSH2_GET(NATIVE)]
ERROR 27-08 15:21:05,062 - Kettle - org.pentaho.di.core.exception.KettleStepLoaderException:
Unexpected error loading class
com/trilead/ssh2/ServerHostKeyVerifier
at org.pentaho.di.job.JobEntryLoader.getJobEntryClass(JobEntryLoader.java:258)
at org.pentaho.di.ui.core.gui.GUIResource.loadJobEntryImages(GUIResource.java:678)
at org.pentaho.di.ui.core.gui.GUIResource.getResources(GUIResource.java:322)
at org.pentaho.di.ui.core.gui.GUIResource.<init>(GUIResource.java:256)
at org.pentaho.di.ui.core.gui.GUIResource.getInstance(GUIResource.java:273)
at org.pentaho.di.ui.core.PropsUI.init(PropsUI.java:100)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:387)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/trilead/ssh2/ServerHostKeyVerifier
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.pentaho.di.job.JobEntryLoader.getJobEntryClass(JobEntryLoader.java:211)
... 17 more
ERROR 27-
08 15:21:05,062 - Kettle - Unable to create job entry from plugin [org.pentaho.di.job.JobPlugin: SSH2_PUT(NATIVE)]
ERROR 27-08 15:21:05,078 - Kettle - org.pentaho.di.core.exception.KettleStepLoaderException:
Unexpected error loading class
com/trilead/ssh2/ServerHostKeyVerifier
at org.pentaho.di.job.JobEntryLoader.getJobEntryClass(JobEntryLoader.java:258)
at org.pentaho.di.ui.core.gui.GUIResource.loadJobEntryImages(GUIResource.java:678)
at org.pentaho.di.ui.core.gui.GUIResource.getResources(GUIResource.java:322)
at org.pentaho.di.ui.core.gui.GUIResource.<init>(GUIResource.java:256)
at org.pentaho.di.ui.core.gui.GUIResource.getInstance(GUIResource.java:273)
at org.pentaho.di.ui.core.PropsUI.init(PropsUI.java:100)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:387)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/trilead/ssh2/ServerHostKeyVerifier
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.pentaho.di.job.JobEntryLoader.getJobEntryClass(JobEntryLoader.java:211)
... 17 more
ERROR 27-
08 15:21:05,078 - Kettle - Unable to create job entry from plugin [org.pentaho.di.job.JobPlugin: FTP_DELETE(NATIVE)]
ERROR 27-08 15:21:05,078 - Kettle - org.pentaho.di.core.exception.KettleStepLoaderException:
Unexpected error loading class
com/trilead/ssh2/ProxyData
at org.pentaho.di.job.JobEntryLoader.getJobEntryClass(JobEntryLoader.java:258)
at org.pentaho.di.ui.core.gui.GUIResource.loadJobEntryImages(GUIResource.java:678)
at org.pentaho.di.ui.core.gui.GUIResource.getResources(GUIResource.java:322)
at org.pentaho.di.ui.core.gui.GUIResource.<init>(GUIResource.java:256)
at org.pentaho.di.ui.core.gui.GUIResource.getInstance(GUIResource.java:273)
at org.pentaho.di.ui.core.PropsUI.init(PropsUI.java:100)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:387)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/trilead/ssh2/ProxyData
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.pentaho.di.job.JobEntryLoader.getJobEntryClass(JobEntryLoader.java:211)
... 17 more
ERROR 27-
08 15:21:05,218 - Kettle - Unable to create job entry from plugin [org.pentaho.di.job.JobPlugin: SNMP_TRAP(NATIVE)]
ERROR 27-08 15:21:05,218 - Kettle - org.pentaho.di.core.exception.KettleStepLoaderException:
Unexpected error loading class
org/snmp4j/TransportMapping
at org.pentaho.di.job.JobEntryLoader.getJobEntryClass(JobEntryLoader.java:258)
at org.pentaho.di.ui.core.gui.GUIResource.loadJobEntryImages(GUIResource.java:678)
at org.pentaho.di.ui.core.gui.GUIResource.getResources(GUIResource.java:322)
at org.pentaho.di.ui.core.gui.GUIResource.<init>(GUIResource.java:256)
at org.pentaho.di.ui.core.gui.GUIResource.getInstance(GUIResource.java:273)
at org.pentaho.di.ui.core.PropsUI.init(PropsUI.java:100)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:387)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: org/snmp4j/TransportMapping
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.pentaho.di.job.JobEntryLoader.getJobEntryClass(JobEntryLoader.java:211)
... 17 more
INFO 27-08 15:21:05,640 - Spoon - 主窗口被创建
INFO 27-08 15:21:05,656 - Spoon - 要求资源库
INFO 27-
08 15:21:05,718 - RepositoriesMeta - Reading repositories XML file: C:/Documents and Settings/administrator/.kettle/repositories.xml
[Fatal Error] repositories.xml:6:69: Invalid byte 2 of 2-byte UTF-8 sequence.
ERROR 27-
08 15:21:05,765 - RepositoriesMeta - Error reading information from file : org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.
ERROR 27-
08 15:21:05,765 - RepositoriesMeta - org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at org.pentaho.di.repository.RepositoriesMeta.readData(RepositoriesMeta.java:167)
at org.pentaho.di.ui.repository.dialog.RepositoriesDialog.<init>(RepositoriesDialog.java:132)
at org.pentaho.di.ui.spoon.Spoon.selectRep(Spoon.java:5416)
at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:5548)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:412)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
--转自