l*********s 发帖数: 5409 | 1 I am trying to compile demo of jasperreport, funny thing is that, if I put
the appache common logging/beanutil jars in the %JAVA%\lib\ext, compiling is
OK.
But if the libraries locate in somewhere else, and referenced through %
classpath%, ant complains. Why is such a different behavior? | r*****l 发帖数: 2859 | 2 Java load class的顺序是:
1,bootstrap classloader,load最基本的runtime classes。bootstrap classloader
在Java世界里基本是神一样的class,有着不受Java规则制约的行为。
2,extension classloader,它load你放在java\lib\ext里面的jar。一般这个目录里
面放一些OS dependent的东西,等等。
3,system classloader,应该是AppClassLoader,load classpath里面的,WEB-INF\
lib里面的classes。
jasperreport的东西尽量用system loader来load。ant complaint应该是没设置好的缘
故。
is
【在 l*********s 的大作中提到】 : I am trying to compile demo of jasperreport, funny thing is that, if I put : the appache common logging/beanutil jars in the %JAVA%\lib\ext, compiling is : OK. : But if the libraries locate in somewhere else, and referenced through % : classpath%, ant complains. Why is such a different behavior?
| l*********s 发帖数: 5409 | | m*****k 发帖数: 731 | 4 maybe some class conflicting, such as what you need is xxx.class ver 3 in
beanutil.jar while some other jar contains xxx.class ver2 . | S****h 发帖数: 558 | 5 Common log use other library (log4J for example) to do the real log job. It
searches certain folder for a logger library and search rules are quite
complicated. So I guess it might be important to sit in CORRECT place. I
think that is one reason lots of new library try to dump it for other log
facade. |
|