从零开始学Shark(1)--序 (作者:HongSoft (http://blog.youkuaiyun.com/hongbo781202))

这篇文档将一步步地教您完成如下任务:下载shark,编译,建立环境并运行它.我们用MySql作为数据库并在win2000上运行. 这篇文档汇聚了各方面的经验,其中包括shark项目组的或清晰或不清晰的提示,包括我自己痛苦思索的经验总结,还包括募然之惊喜的发现.

 

我没有使用可执行安装程序,因为我想自己从零开始学习它.

 

在正式开始前你要做如下的准备工作.请注意,这并不是shark所必需的,仅仅是本文档的要求:

  1. MySQL - I'm using 4.0.16-nt
  2. MySQL Connector - I have mysql-connector-java-3.0.11-stable-bin.jar
  3. Java - I'm using the Sun j2sdk version 1.4.2_04
  4. CVS, Winzip, etc. as needed

首先,请你自己安装这几个软件,然后开始我们的shark学习.

//执行本地文件作业 public boolean runKettleJob(Map<String, String> initKettleParam, String jobName) throws URISyntaxException, FileNotFoundException { KettleEnv.init(); String uuid = UUID.randomUUID().toString(); String pluginBasePath = KettleEnv.getPluginBasePath(); if (pluginBasePath == null) { throw new IllegalStateException("Kettle插件基础路径未初始化"); } // 设置JNDI路径(基于插件路径) Path jndiPath = Paths.get(pluginBasePath, "simple-jndi"); Const.JNDI_DIRECTORY = jndiPath.toString(); // 设置系统属性 System.setProperty("KETTLE_HOME", pluginBasePath); System.setProperty("org.osjava.sj.root", jndiPath.toString()); log.info("Kettle插件基础路径: {}", pluginBasePath); log.info("JNDI路径: {}", jndiPath); Path jobPath = Paths.get(jobName); log.info("JjobPath: {}", jobPath.toString()); DataSource ds = null; try { ds = (DataSource) new InitialContext().lookup("ORA_BIM"); } catch (NamingException e) { throw new RuntimeException(e); } try (Connection conn = ds.getConnection()) { log.info("JNDI Connection Successful!"); } catch (SQLException e) { throw new RuntimeException(e); } 09:49:35.706 [Thread-19] INFO c.r.k.t.KettleUtil - [init,543] - Kettle环境初始化成功 09:49:35.707 [Thread-19] INFO c.r.k.t.KettleUtil - [runKettleJob,266] - Kettle插件基础路径: D:\IDEA\java_kettle\smart-kettle\RuoYi-master\ruoyi-admin\target\classes\kettlePlugins 09:49:35.707 [Thread-19] INFO c.r.k.t.KettleUtil - [runKettleJob,267] - JNDI路径: D:\IDEA\java_kettle\smart-kettle\RuoYi-master\ruoyi-admin\target\classes\kettlePlugins\simple-jndi 09:49:35.707 [Thread-19] INFO c.r.k.t.KettleUtil - [runKettleJob,270] - JjobPath: D:\kettle\pims_etl_jndi\pims_job_jndi.kjb java.lang.NullPointerException at com.ruoyi.kettle.tools.KettleUtil.runKettleJob(KettleUtil.java:279) at com.ruoyi.kettle.service.impl.KettleJobServiceImpl.runJobRightNow(KettleJobServiceImpl.java:259) at com.ruoyi.kettle.tools.RedisStreamUtil.readGroup(RedisStreamUtil.java:251) at com.ruoyi.kettle.tools.CommandLineRunnerImpl$1.run(CommandLineRunnerImpl.java:26) D:\IDEA\java_kettle\smart-kettle\RuoYi-master\ruoyi-admin\target\classes\kettlePlugins\simple-jndi目录下jdbc.properties配置如下: SampleData/type=javax.sql.DataSource SampleData/driver=org.h2.Driver SampleData/url=jdbc:h2:file:samples/db/sampledb;IFEXISTS=TRUE SampleData/user=PENTAHO_USER SampleData/password=PASSWORD Quartz/type=javax.sql.DataSource Quartz/driver=org.hsqldb.jdbcDriver Quartz/url=jdbc:hsqldb:hsql://localhost/quartz Quartz/user=pentaho_user Quartz/password=password Hibernate/type=javax.sql.DataSource Hibernate/driver=org.hsqldb.jdbcDriver Hibernate/url=jdbc:hsqldb:hsql://localhost/hibernate Hibernate/user=hibuser Hibernate/password=password Shark/type=javax.sql.DataSource Shark/driver=org.hsqldb.jdbcDriver Shark/url=jdbc:hsqldb:hsql://localhost/shark Shark/user=sa Shark/password= PDI_Operations_Mart/type=javax.sql.DataSource PDI_Operations_Mart/driver=org.postgresql.Driver PDI_Operations_Mart/url=jdbc:postgresql://localhost:5432/hibernate?searchpath=pentaho_operations_mart PDI_Operations_Mart/user=hibuser PDI_Operations_Mart/password=password live_logging_info/type=javax.sql.DataSource live_logging_info/driver=org.postgresql.Driver live_logging_info/url=jdbc:postgresql://localhost:5432/hibernate?searchpath=pentaho_dilogs live_logging_info/user=hibuser live_logging_info/password=password ORA_BIMS/type=javax.sql.DataSource ORA_BIMS/driver=com.mysql.cj.jdbc.Driver ORA_BIMS/url=jdbc:mysql://192.168.168.217:3306/plasma_kb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8 ORA_BIMS/user=plasma ORA_BIMS/password=szrouting2004plasma ORA_BIM/type=javax.sql.DataSource ORA_BIM/driver=oracle.jdbc.driver.OracleDriver ORA_BIM/url=jdbc:oracle:thin:@192.168.168.218:1521:orcl ORA_BIM/user=BIM ORA_BIM/password=szrouting2015bip 经过验证配置没有问题,是哪里出错了
06-07
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值