1. 首先下载pdi-ce-src-4.3.0-stable-r16786.zip, 解压后导入eclipse,设置ant的target为clean, webstart,注意调整顺序,使clean先执行
2. 为了在配置过程中查看log,需要打开java调试: 控制面板-> Java -> 高级-> 设置->调试-> 启用跟踪,启用记录,
log存放地址:C:\Documents and Settings\YOURID\Application Data\Sun\Java\Deployment\log
这样,在运行过程中,会在这个目录下生成.trace与.log日志
3. 修改pdi-ce-src-4.3.0-stable-r16786\web 中的spoon.jnlp, swt.jnlp, activation.jnlp, mail.jnlp,修改codebase,例如
<jnlp spec="1.0+" codebase="http://localhost:7080/pdi-ce-4.3.0" href="spoon.jnlp">
4. 常见错误:
1> java.lang.RuntimeException: Unable to load image with name [ui/images/spoon.ico]
这是由于默认编译出来的kettle-ui-swt.jar中没有spoon.ico, 在kettle的ant build.xml中,copy ui的时候没有拷贝gif和ico,修改后的结果为
<!-- embedd the UI definition files in the jar so that webstart will work -->
<copy todir="${classes-ui}/ui">
<fileset dir="${ui}" includes="**/*.gif **/*.ico **/*.png **/*.xml **/*.xul **/*.properties"/>
</copy>
2> jar签名不一致
这是由于某些spoon.jnlp中列的jar文件有些已经是签过名的,比如mail.jar, activation.jar, commands.jar common.jar jface.jar runtime.jar,对于这几个jar文件,最好是和其他额jar一起进行签名,修改build.xml:
<copy todir="${webstart}/libext">
<!--fileset dir="${libext}" includes="**/*.jar" excludes="mail.jar web/activation.jar"/-->
<fileset dir="${libext}" includes="**/*.jar"/>
</copy>
<copy todir="${webstart}/libswt">
<!--fileset dir="${libswt}" includes="**/*.jar" excludes="commands.jar common.jar jface.jar runtime.jar"/-->
<fileset dir="${libswt}" includes="**/*.jar"/>
</copy>
<!-- for jars that are already signed by other parties, copy the originals back over -->
<!--
<echo>Copying third-party signed jars</echo>
<copy todir="${webstart}/libext">
<fileset dir="${libext}" includes="mail.jar web/activation.jar"/>
</copy>
<copy todir="${webstart}/libswt">
<fileset dir="${libswt}" includes="commands.jar common.jar jface.jar runtime.jar"/>
</copy>
-->
对于其他的第三方的jar,如果已经签过名了,可以通过jar -xf解包,删除META-INF,再通过jar -cf重新打包,签过名的jar其META-INF中含有签名文件,比如KETTLE.RSA,
KETTLE.SF, MANIFEST.MF
3>java.lang.ClassNotFoundException: org.pentaho.ui.xul.swt.SwtXulLoader
解决方案:
在添加spoon.jnlp 中添加<jar href="libext/pentaho/pentaho-xul-swt-3.3.4.jar"/>
4> java.util.MissingResourceException: Can't find bundle for base name ui/laf, locale zh_CN
解决方案:
src-ui/org/pentaho/di/ui/spoon/XulSpoonResourceBundle.java Line 63:
将
lafBundle = ResourceBundle.getBundle("ui/laf", Locale.getDefault(), classLoader); 改为:
lafBundle = ResourceBundle.getBundle("ui.laf", Locale.getDefault());
用加载这个Class的classLoader从jar内部来加载laf.properties
5> 找不到/ui/images/transformation.png
解决方案:
src-ui/pentaho/di/ui/spoon/MianSpoonPerspective.java Line 69,函数getPerspectiveIcon(),这里从jar内部加载资源有问题,
修改为:
public InputStream getPerspectiveIcon() {
InputStream is = getClass().getResourceAsStream("/ui/images/transformation.png");
return is;
}
最终,spoon.jnlp,build.xml 以及部分缺失的jar 放在:
http://download.csdn.net/detail/sundongsdu/5089760