首页 > 代码库 > 20141128bug
20141128bug
1.java.util.Date转java.sql.Date时分秒丢失!!
解决:
使用Timestamp代替java.sql.Date:
long curMillis = System.currentTimeMillis(); Timestamp currentDate = new Timestamp(curMillis); Date time = DateUtils.parseDate(errorCodeCountBean.getTime(), NginxConfig.TIME_PATTERN); String sql = "insert into ERROR_CODE_COUNT (ID, ERRCODECOUNT,TIME,CREATE_DATE,UPDATE_DATE) VALUES (?,?,?,?,?)"; pstmt = conn.prepareStatement(sql); pstmt.setLong(1, curMillis); pstmt.setInt(2, errorCodeCountBean.getErrcodecount()); pstmt.setTimestamp(3, new Timestamp(time.getTime())); pstmt.setTimestamp(4, currentDate); pstmt.setTimestamp(5, currentDate);
2.Strom一个Bolt对象只能用一次:
下面的printBolt对象使用了两次:
PrinterBolt printBolt=new PrinterBolt();builder.setBolt("print", printBolt,1).shuffleGrouping("ErrorCodeStatisticsBolt");builder.setBolt("print", printBolt,1).shuffleGrouping("UVRealTimeBolt");
Exception in thread "main" java.lang.IllegalArgumentException: Bolt has already been declared for id print
at backtype.storm.topology.TopologyBuilder.validateUnusedId(TopologyBuilder.java:212)
at backtype.storm.topology.TopologyBuilder.setBolt(TopologyBuilder.java:139)
at backtype.storm.topology.TopologyBuilder.setBolt(TopologyBuilder.java:171)
at com.handpay.hawkeye.core.storm.topology.LogTopology.main(LogTopology.java:62)
20141128bug
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。