码迷,mamicode.com
首页 > 其他好文 > 详细

20141128bug

时间:2014-11-28 17:59:11      阅读:174      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   io   ar   color   使用   sp   java   

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

标签:des   style   blog   io   ar   color   使用   sp   java   

原文地址:http://www.cnblogs.com/muzhongjiang/p/4128812.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!