本人属于前端白痴.但是鉴于没办法的原因,偶尔还是需要写一些js...这里就随便记录一下我踩的坑.
1 Uncaught TypeError: object is not a function
原因是我的id与js的函数名重复了..
2 jquery 里面使用了$ , 和velcotiy 中的冲突了 .然后,就没有然后了..哈哈,漫姐的经验.
3 直接看下面的代码
package executor;
import java.util.concurrent.*;
/**
* Created with IntelliJ IDEA.
* User: zhenghui
* Date: 14-3-21
* Time: 下午8:53
*/
public class Test implements Runnable{
ScheduledExecutorService executorService = null;
ScheduledFuture<?> fetchTaskFuture = null;
private static final int DELAY_SECONDS = 5;
@Override
public void run() {
System.out.println("i'am running");
}
public static void main(String[] args){
new Test().scheduleTask();
}
public void scheduleTask(){
executorService = Executors.newScheduledThreadPool(1);
executorService.submit(new Runnable() {
@Override
public void run() {
if (fetchTaskFuture != null && !fetchTaskFuture.isCancelled()) {
fetchTaskFuture.cancel(false);
}
fetchTaskFuture = executorService.scheduleWithFixedDelay(this, DELAY_SECONDS, DELAY_SECONDS, TimeUnit.SECONDS);
}
});
}
}
编码的时候遇到的. 简单一看应该没啥问题..但是,运行以后就是没有效果...找了半天,发现是自己被自己坑了.上面只需要改一句代码
fetchTaskFuture = executorService.scheduleWithFixedDelay(Test.this, DELAY_SECONDS, DELAY_SECONDS, TimeUnit.SECONDS);
囧.
4 jboss启动失败,但是应用不抛错。原因是在
@Resource
private PositionItemService positionItemService;
中,PositionItemService类型变了,也就似乎在spring配置文件中定义的positionItemService前后不一致。然后很奇怪,没抛错。应用就是起不来。
5 ibatis查询列表,就是返回空的list.最后的结论是
<select id="queryList" resultMap="jsonConfigRuleResultMap">
忘记写对应的 resultMap了。。看了半天源码。呵呵
6 SimpleDateFormat 不是线程安全的。悲剧。