Redian新闻
>
Re: Help!: tomcat classloading problem
avatar
Re: Help!: tomcat classloading problem# Java - 爪哇娇娃
s*n
1
I read the Tomcat5.0 documentation here:
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html
and I learn about another thing: The "System" classloader doesn't load classes
from CLASSPATH environment. IF I can instruct the "System" classLoader to load
classes from CLASSPATH, my problem will be solved, although it is not so
elegent.
Anyone here has the expertise to instruct "system" classloader to load classes
from CLASSPATH?
Thanks!
avatar
m*t
2

You should not put class A in shared if it's part of a web app.
You might want to look deeper into Tomcap documentation about how
each web app has its own classloader, etc.

【在 s*********n 的大作中提到】
: I read the Tomcat5.0 documentation here:
: http://jakarta.apache.org/tomcat/tomcat-5.0-doc/class-loader-howto.html
: and I learn about another thing: The "System" classloader doesn't load classes
: from CLASSPATH environment. IF I can instruct the "System" classLoader to load
: classes from CLASSPATH, my problem will be solved, although it is not so
: elegent.
: Anyone here has the expertise to instruct "system" classloader to load classes
: from CLASSPATH?
: Thanks!

avatar
s*n
3
I want to share the class A to different applciations, so I try to put it into
shared/ directory. Now the classes in different web app can discover the class
A, but class A could not discover the classes inside web app.
I can only find one page about the tomcat classloader from its offical
website. Could you recommend me some more? thanks!

classes
load
classes

【在 m******t 的大作中提到】
:
: You should not put class A in shared if it's part of a web app.
: You might want to look deeper into Tomcap documentation about how
: each web app has its own classloader, etc.

avatar
m*t
4

cang said it below - you can't do that.
Not sure why you want to do that, but it's generally not a
good idea to share classes across web applications by putting
the classes on the server classpath - web applications are supposed
to be self-contained.

【在 s*********n 的大作中提到】
: I want to share the class A to different applciations, so I try to put it into
: shared/ directory. Now the classes in different web app can discover the class
: A, but class A could not discover the classes inside web app.
: I can only find one page about the tomcat classloader from its offical
: website. Could you recommend me some more? thanks!
:
: classes
: load
: classes

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。