Hi,
Tnx for your information. It was VERY useful.
"touching" the web.xml sounds like a tricky thing, but that's the reason
we're programmers, isn't it ?

Tnx again
Tamir


-----Original Message-----
From: Larry Isaacs [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 20, 2002 9:54 PM
To: 'Tomcat Users List'
Subject: RE: reloading classes - rephrase


It would pick up the new jar if the web application is reloaded, though
simply adding the new jar won't trigger the reload.  However,  "touching"
the web.xml file should do the trick.

Cheers,
Larry

> -----Original Message-----
> From: tamir [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 2:59 PM
> To: 'Tomcat Users List'
> Subject: RE: reloading classes - rephrase
> 
> 
> Hey there,
> Tnx, for the quick answer.
> 
> I meant to the first option of replacing a jar. However, it 
> probably made a
> problem because the 
> class also existed in web-inf/classes (and i moved it to the 
> jar...), which
> made tomcat confused.
> I checked it again, and it worked. TNX!!!
> 
> The only thing that still bothers me, is what will happen, if 
> I'm adding a
> new jar to web-inf/lib ?
> Will tomcat be able to recognize it ?
> 
> Thank you,
> Tamir
> 
> 
> 
> 
> -----Original Message-----
> From: Larry Isaacs [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 20, 2002 8:04 PM
> To: 'Tomcat Users List'
> Subject: RE: reloading classes - rephrase
> 
> 
> Does "override an existing jar" refer to replacing a jar with a newer
> version of the jar or adding a class in WEB-INF/classes to 
> override the
> class in a jar?
> 
> The first should work.  Adding a new class won't work because  the
> DependClassLoader
> only checks for "out of date" against the file, jar or class, 
> that the class
> was loaded from.
> Thus, if the class was loaded from a jar, only the jar would 
> be checked to
> see if a
> newer version of the jar was available.  If the class is 
> loaded from a jar,
> it isn't smart
> enough to go looking for class files that may or may not exist.
> 
> Cheers,
> Larry
> 
> > -----Original Message-----
> > From: tamir [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, February 20, 2002 12:41 PM
> > To: 'Tomcat Users List'
> > Subject: RE: reloading classes - rephrase
> > 
> > 
> > Hi again,
> > 
> > I still have some questions about the reloading classes 
> mechanizem...
> > 
> > I checked tomcat 3.3.1-b1, for a few days, and I still 
> > couldn't make my mind
> > clear about when classes
> > are refreshed and when not.
> > 
> > When I compiled classes to web-inf/classes, they were 
> > refreshed all the
> > time!!!. GOOD!
> > 
> > However, when I override an existing jar file at web-inf/lib, 
> > tomcat wasn't
> > always refreshed. I couldn't
> > decide when it was refreshed and when not.
> > 
> > I'd really apperciate your comments for this subject or 
> > correct me if i'm
> > wrong.
> > 
> > Tnx in advance,
> > Tamir
> > 
> > -----Original Message-----
> > From: Larry Isaacs [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 14, 2002 9:54 PM
> > To: 'Tomcat Users List'
> > Subject: RE: reloading classes - rephrase
> > 
> > 
> > There were some reloading problems encountered with 
> > URLClassLoader in Tomcat
> > 3.3.
> > A new attribute, use11Loader,  was added to 
> > <LoaderInterceptor .../> as a
> > workaround.
> > If you can, give Tomcat 3.3.1 Beta 1 a try with 
> > use11Loader="true" and see
> > if you
> > still have the problem.
> > 
> > See:
> > 
> > <http://jakarta.apache.org/tomcat/tomcat-3.3-doc/serverxml.htm
> > l#LoaderInterc
> > eptor11>
> > 
> > for details.
> > 
> > Cheers,
> > Larry
> > 
> > > -----Original Message-----
> > > From: tamir [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 14, 2002 2:10 PM
> > > To: 'Tomcat Users List'
> > > Subject: RE: reloading classes - rephrase
> > > 
> > > 
> > > Hello again,
> > > 
> > > Thank you very much for your quick response.
> > > 
> > > I read your answer and tried to refresh classes in the 
> web-inf/lib.
> > > 
> > > Nevertheless, when I override an already existing 
> myxxx.jar file (in
> > > web-inf/lib) with a newer version tomcat 3.3 gets crazy.
> > > 
> > > Our application is loading a class from myxxx.jar using 
> > > Class.forName and
> > > activates some methods in it.
> > > Everything is going well until we override myxxx.jar with a 
> > > newer jar (class
> > > interface hasn't been changed).
> > > Tomcat is refreshed well (although, losing session), however, 
> > > when accessing
> > > again the class in the jar,
> > > I get the following exception:
> > > 
> > > 2002-02-14 20:45:34 - Ctx(/movious) : Exception in R( 
> > > /movious + /portlet +
> > > null
> > > ) - java.lang.ClassFormatError: com/movious/NivPortlet 
> > > (Truncated class
> > > file)
> > >         at java.lang.ClassLoader.defineClass0(Native Method)
> > >         at java.lang.ClassLoader.defineClass(ClassLoader.java:495)
> > >         at
> > > 
> > 
> org.apache.tomcat.util.depend.DependClassLoader12.defineClassCompat(U
> > > nknown Source)
> > >         at
> > > 
> > 
> org.apache.tomcat.util.depend.DependClassLoader.loadClassInternal1(Un
> > > known Source)
> > >         at 
> > > org.apache.tomcat.util.depend.DependClassLoader12$1.run(Unknown
> > > Sourc
> > > e)
> > >         at 
> > java.security.AccessController.doPrivileged(Native Method)
> > >         at
> > > 
> > 
> org.apache.tomcat.util.depend.DependClassLoader12.loadClass(Unknown S
> > > ource)
> > >         at java.lang.ClassLoader.loadClass(ClassLoader.java:260)
> > >         at 
> > > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
> > >         at java.lang.Class.forName0(Native Method)
> > >         at java.lang.Class.forName(Class.java:130)
> > >         at
> > > 
> > 
> com.movious.api.portlets.PortletManager.getClass(PortletManager.java:
> > > 578)
> > >         at
> > > 
> > 
> com.movious.api.portlets.PortletManager.createClip(PortletManager.jav
> > > a:532)
> > >         at
> > > 
> > 
> com.movious.api.portlets.PortletManager.getData(PortletManager.java:2
> > > 88)
> > >         at
> > > 
> > 
> com.movious.api.portlets.PortletServlet.doPost(PortletServlet.java:11
> > > 9)
> > >         at
> > > 
> > 
> com.movious.api.portlets.PortletServlet.doGet(PortletServlet.java:37)
> > > 
> > >         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java)
> > >         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java)
> > >         at 
> > > org.apache.tomcat.facade.ServletHandler.doService(Unknown Source)
> > >         at org.apache.tomcat.core.Handler.invoke(Unknown Source)
> > >         at org.apache.tomcat.core.Handler.service(Unknown Source)
> > >         at 
> > > org.apache.tomcat.facade.ServletHandler.service(Unknown Source)
> > >         at 
> > > org.apache.tomcat.core.ContextManager.internalService(Unknown
> > > Source)
> > > 
> > >         at 
> > > org.apache.tomcat.core.ContextManager.service(Unknown Source)
> > >         at
> > > 
> > 
> org.apache.tomcat.modules.server.Http10Interceptor.processConnection(
> > > Unknown Source)
> > >         at 
> > > org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source)
> > >         at
> > > 
> > 
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown
> > >  Source)
> > >         at java.lang.Thread.run(Thread.java:579)
> > > 
> > > 
> > > Am i doing something wrong Dear Guru ???
> > > Tnx
> > > 
> > > 
> > > 
> > > -----Original Message-----
> > > From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, February 14, 2002 6:22 PM
> > > To: Tomcat Users List
> > > Subject: Re: reloading classes - rephrase
> > > 
> > > 
> > > 
> > > 
> > > On Thu, 14 Feb 2002, tamir wrote:
> > > 
> > > > Date: Thu, 14 Feb 2002 10:54:15 +0200
> > > > From: tamir <[EMAIL PROTECTED]>
> > > > Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> > > > To: [EMAIL PROTECTED]
> > > > Subject: reloading classes - rephrase
> > > >
> > > > Hi there,
> > > > I've a simple question, hope there's a simple answer.
> > > >
> > > > Is it possible to do autoreload for classes not found in 
> > > WEB-INF/classes
> > > or
> > > > WEB-INF/lib
> > > > without restarting tomcat or reloading my web-app classes ?
> > > > (I mean i put my classes OUTSIDE the web-app).
> > > >
> > > > I'm using tomcat 3.3, but can do the advance to 4.02 if needed.
> > > >
> > > > Tnx Alot
> > > > for any information!!!!!
> > > >
> > > 
> > > The answer is simple:  no.
> > > 
> > > Java provides no mechanism for unloading a class that has 
> > already been
> > > loaded.  The way that reloading is implemented for a webapp 
> > > is to throw
> > > away the entire class loader used to load that webapp, and 
> > > starting over
> > > again.  If we did that for shared classes, however, you'd 
> > > have to restart
> > > *all* webapps because they would all need to be thrown away.
> > > 
> > > If you want to take advantage of the auto-reload capability 
> > to update
> > > classes in a webapp, you *must* put those classes in 
> > > /WEB-INF/classes, or
> > > in a JAR file in /WEB-INF/lib.
> > > 
> > > Craig McClanahan
> > > 
> > > 
> > > 
> > > --
> > > To unsubscribe:   
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands: 
> > <mailto:[EMAIL PROTECTED]>
> > > Troubles with the list: 
> > <mailto:[EMAIL PROTECTED]>
> > > 
> > > --
> > > To unsubscribe:   
> > <mailto:[EMAIL PROTECTED]>
> > > For additional commands: 
> > <mailto:[EMAIL PROTECTED]>
> > > Troubles with the list: 
> > <mailto:[EMAIL PROTECTED]>
> > > 
> > 
> > --
> > To unsubscribe:   
> <mailto:[EMAIL PROTECTED]>
> > For additional commands: 
> <mailto:[EMAIL PROTECTED]>
> > Troubles with the list: 
> <mailto:[EMAIL PROTECTED]>
> > 
> > --
> > To unsubscribe:   
> <mailto:[EMAIL PROTECTED]>
> > For additional commands: 
> <mailto:[EMAIL PROTECTED]>
> > Troubles with the list: 
> <mailto:[EMAIL PROTECTED]>
> > 
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe:   <mailto:[EMAIL PROTECTED]>
> For additional commands: <mailto:[EMAIL PROTECTED]>
> Troubles with the list: <mailto:[EMAIL PROTECTED]>
> 

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to