i have got a very wired problem.
put a 0 in a list and get 1 as result in my project.
here is the test code!
java.util.List alist =new java.util.ArrayList<Integer>();
alist.add(0);
out.print(alist.get(0));
i run the text code in a jsp in the tomcat.
as you see, i put 0 in the list, but get 1 as result.
i wonder why?
after many hour of testing, i found there is a jar file has cause this problem,which is 'antlr-2.7.5H3.jar' which is shipped with Hibernate,when i remove this jar file from the Tomcat\webapps\myproject\WEB-INF\lib and it work fine. put 0 get 0;
i have tried to put the newest jar file which is 'antlr-2.7.6.jar' from the newest Hibernate, but it is still put 0 get 1;
does anyone has a idea?
I think maybe when tomcat started , it load the 'antlr-2.7.5H3.jar' file, and maybe do some mapping, map 0 to a object? i am not so sure!
i am eager to get the answer, and also i am new to Hibernate, someone else in my project used hibernate.
i am very appreciate for your help!
|