You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Oleg <ol...@gmail.com> on 2005/02/20 03:38:03 UTC

moving all classes to shared

If I have 200 users deployed on tomcat with 99% using identical
classes, would it be ok to move all classes to shared/classes
directory? Will that give better memory usage? Also, can I later add
the classes that are different directly to WEB-INF/classes and will
they be given priority?

Thank you
Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: moving all classes to shared

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Oleg" <ol...@gmail.com>

> Hmm, quick question, do you know of a reason why this ould not work
> for Struts, I did it and for some reason I get an error
> org.apache.struts.action.RequestProcessor - ERROR - No action instance
> for path /selectTiles could be created
> this class was moved to shared.

You can't share the Struts libraries across multiple webapps.  (Well, you
can, but it probably won't work, and it's not a supported configuration-- 
the developers specifically warn against it.)

Scroll down to section 5.5:
http://struts.apache.org/userGuide/configuration.html

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: moving all classes to shared

Posted by Oleg <ol...@gmail.com>.
Hmm, quick question, do you know of a reason why this ould not work
for Struts, I did it and for some reason I get an error

org.apache.struts.action.RequestProcessor - ERROR - No action instance
for path /selectTiles could be created

this class was moved to shared.

Thansk,
Oleg

On Mon, 21 Feb 2005 14:39:52 -0600, QM <qm...@brandxdev.net> wrote:
> On Mon, Feb 21, 2005 at 11:21:01AM -0800, Oleg wrote:
> : Well regarding #1 from what I understand the class in webapp web-inf
> : will take priority, however, I can see how #2 can be a problem, but,
> : does it only work one way? Meaning a class in sared/classes will not
> : see webapp/web-inf/classes, so down the hierarchy, however, it will
> : work just fine going up, so class in webapp will see classes in
> : shared?
> 
> Correct -- the per-webapp classloader is the child of the shared/lib
> classloader.  (This is an oversimplification but please bear with me.)
> 
> Really, there are more than two classloaders involved, forming several
> parent/child relationships in a hierarchy...
> 
> Try to think of it as the GoF Chain of Responsiblity pattern: when the
> per-webapp classloader can't find a class, it delegates (passes the
> request) to its parent.  This keeps going until you hit a classloader
> that can successfully load the class, or until the innermost classloader
> -- which doesn't delegate to anyone else -- gives up and says there's no
> such class.
> 
> Going the other way thus isn't possible: that innermost (parent)
> classloader can't see what its children see, and so on. If a class
> under shared/lib needs access to (depends on) a class in a child
> classloader, it will never find it, and the system throws a
> NoClassDefFoundError.
> 
> It's for a similar reason one webapp can't see another webapp's classes:
> they only have a relationship with their parent classloader, and not
> that of their siblings.
> 
> -QM
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: moving all classes to shared

Posted by QM <qm...@brandxdev.net>.
On Mon, Feb 21, 2005 at 11:21:01AM -0800, Oleg wrote:
: Well regarding #1 from what I understand the class in webapp web-inf
: will take priority, however, I can see how #2 can be a problem, but,
: does it only work one way? Meaning a class in sared/classes will not
: see webapp/web-inf/classes, so down the hierarchy, however, it will
: work just fine going up, so class in webapp will see classes in
: shared?

Correct -- the per-webapp classloader is the child of the shared/lib
classloader.  (This is an oversimplification but please bear with me.)

Really, there are more than two classloaders involved, forming several
parent/child relationships in a hierarchy...


Try to think of it as the GoF Chain of Responsiblity pattern: when the
per-webapp classloader can't find a class, it delegates (passes the
request) to its parent.  This keeps going until you hit a classloader
that can successfully load the class, or until the innermost classloader
-- which doesn't delegate to anyone else -- gives up and says there's no
such class.


Going the other way thus isn't possible: that innermost (parent)
classloader can't see what its children see, and so on. If a class
under shared/lib needs access to (depends on) a class in a child
classloader, it will never find it, and the system throws a
NoClassDefFoundError.

It's for a similar reason one webapp can't see another webapp's classes:
they only have a relationship with their parent classloader, and not
that of their siblings.

-QM

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Facing problems in tomcat configuration - on "XP Professional"

Posted by To...@ServaCorp.com.
There is a Windows Firewall (Control Panel, Windows Firewall)
which is probably preventing hackers from attacking strange ports like 8080.

-----Original Message-----
From: raghavendra datt [mailto:raghavendradatt@yahoo.com]
Sent: Monday, February 21, 2005 1:30 PM
To: Tomcat Users List; Oleg
Subject: Facing problems in tomcat configuration - on "XP Professional"


Hi all,
      I am new to this mailing list. for the past one
week i was trying to run tomcat on my XP Professional
OS but in vein. I downloaded the latest JDK and
downloaded tomcat 4.1 version and has set the
CATALINA_HOME and JAVA_HOME respectively. when I start
the server its getting started properly but, when i
try to access 8080 port I am getting "page can not be
displayed". I did the same installation on XP Home and
its working fine. Is there some problem ? Has any one
has configured tomcat on XP Professional.. If so,
kindly reply back to this stating the solution. That
will be very helpful.

Thanks in advance,
Raghavendra Datt



__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Facing problems in tomcat configuration - on "XP Professional"

Posted by raghavendra datt <ra...@yahoo.com>.
Hi all,
      I am new to this mailing list. for the past one
week i was trying to run tomcat on my XP Professional
OS but in vein. I downloaded the latest JDK and
downloaded tomcat 4.1 version and has set the
CATALINA_HOME and JAVA_HOME respectively. when I start
the server its getting started properly but, when i
try to access 8080 port I am getting "page can not be
displayed". I did the same installation on XP Home and
its working fine. Is there some problem ? Has any one
has configured tomcat on XP Professional.. If so,
kindly reply back to this stating the solution. That
will be very helpful.

Thanks in advance,
Raghavendra Datt


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: moving all classes to shared

Posted by Oleg <ol...@gmail.com>.
Well regarding #1 from what I understand the class in webapp web-inf
will take priority, however, I can see how #2 can be a problem, but,
does it only work one way? Meaning a class in sared/classes will not
see webapp/web-inf/classes, so down the hierarchy, however, it will
work just fine going up, so class in webapp will see classes in
shared?

Thank you
Oleg 

On Mon, 21 Feb 2005 10:54:45 -0600, QM <qm...@brandxdev.net> wrote:
> On Sat, Feb 19, 2005 at 06:38:03PM -0800, Oleg wrote:
> : If I have 200 users deployed on tomcat with 99% using identical
> : classes, would it be ok to move all classes to shared/classes
> : directory? Will that give better memory usage? Also, can I later add
> : the classes that are different directly to WEB-INF/classes and will
> : they be given priority?
> 
> You've already received answers to the other points, so I'll address
> just the last question:
> 
>        it depends
> 
> With hierarchical classloaders, you can get yourself into a right snit
> when 1/ there's version skew between the per-webapp class and the one in
> shared/lib; and 2/ when a class in shared/lib depends on a class that's
> in the per-webapp area (that is, it can't see a dependent class because
> it's out of the scope of the current classloader).
> 
> IIRC, both result in NoClassDefFoundError, and both can be a mess to
> sort out if you don't know in advance where to start looking.
> 
> -QM
> 
> --
> 
> software  -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: moving all classes to shared

Posted by QM <qm...@brandxdev.net>.
On Sat, Feb 19, 2005 at 06:38:03PM -0800, Oleg wrote:
: If I have 200 users deployed on tomcat with 99% using identical
: classes, would it be ok to move all classes to shared/classes
: directory? Will that give better memory usage? Also, can I later add
: the classes that are different directly to WEB-INF/classes and will
: they be given priority?

You've already received answers to the other points, so I'll address
just the last question:

	it depends

With hierarchical classloaders, you can get yourself into a right snit
when 1/ there's version skew between the per-webapp class and the one in
shared/lib; and 2/ when a class in shared/lib depends on a class that's
in the per-webapp area (that is, it can't see a dependent class because
it's out of the scope of the current classloader).  

IIRC, both result in NoClassDefFoundError, and both can be a mess to
sort out if you don't know in advance where to start looking.

-QM

-- 

software  -- http://www.brandxdev.net
tech news -- http://www.RoarNetworX.com


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org