由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Re: Help!: tomcat classloading problem
相关主题
Help!: tomcat classloading problem请教一个有关 inner class 的问题
com.sun.tools.javac.Main 问题问一个关于access object instance的问题
[合集] How to get all classes under a package?Java中如何动态生成对象
JSP How to Invoke the Specific version of Xerces-Jjava深度历险 阅读笔记 zt
classpath 和 lib/ext 的区别?[转载] servlet调用sql 访问oracle的问题
问个eclipse装jar的入门问题Re: [转载] Questions on failover & Hot dep
如何获得类定义的public methods?A very Stupid Question
get full class name请问protected的使用
相关话题的讨论汇总
话题: classes话题: classpath话题: tomcat
进入Java版参与讨论
1 (共1页)
s*********n
发帖数: 38
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!
m******t
发帖数: 2416
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!

s*********n
发帖数: 38
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.

m******t
发帖数: 2416
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

1 (共1页)
进入Java版参与讨论
相关主题
请问protected的使用classpath 和 lib/ext 的区别?
问个问题啊. JDK/JRE问个eclipse装jar的入门问题
如何让servlet调用的一些class reload/reinitiate?如何获得类定义的public methods?
OutofMemoryError: Java Heap Spaceget full class name
Help!: tomcat classloading problem请教一个有关 inner class 的问题
com.sun.tools.javac.Main 问题问一个关于access object instance的问题
[合集] How to get all classes under a package?Java中如何动态生成对象
JSP How to Invoke the Specific version of Xerces-Jjava深度历险 阅读笔记 zt
相关话题的讨论汇总
话题: classes话题: classpath话题: tomcat