You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Andrew (Tver)" <a...@etver.com> on 2001/12/27 07:09:09 UTC

outside catalina

Hello All,

I'm new in the list. Sorry if such question already was here.

I have:

1. This context:

<Context path="/myapp"  docBase="c:/path/to/myapp"
         debug="0" reloadable="true"/>

2. Kit of classes, XML-files anf jars needed to servlets, for example:

c:/kit/classes - .class files
c:/kit/resources - JPG, XML, properties, ...
c:/kit/lib/some.jar, ...

Question:

By some reason it is not handy to copy any of these files to docBase,
common/classes, common/lib - in one word, to "Catalina inside".

Is it possible to config Catalina these resources be accessable from
servlets (and for classes in c:/kit/classes too)?

Thanks!
Andrew                          mailto:a@etver.com


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re[2]: outside catalina

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 27 Dec 2001, Andrew (Tver) wrote:

>
> I'm absolutley agree with you in the case of "real" deployment. But
> what about development time? I have about 600 classes in my project.
> Using standard ant build make me to recompile all of them, and so on
> according to ant task. Are you using full deployment process after any
> small modifying of a single file (at development/*debugging* time)?
>

Yes, I really do say "ant deploy" every time through the compile/debug
cycle, and it really does copy everything necessary.  Ant is smart about
not copying files that haven't changed, so it only takes a couple of
seconds on a fast machine -- no big deal IMHO.

> BTW, is it possible to do something like
>
> .../manager/reload?path=/myApp
>
> with respect to external classes/jars?
>

You can certainly reload the app this way, but there's no way to reload
the classes from the external JARs without restarting Tomcat.  This is due
to restrictions in what Java class loaders let you do -- the only way to
"throw away" an old class is to throw away the entire class loader that
loaded it (which would mean throwing away *all* webapps and reloading
them).

If you're actively developing the classes for external JARs themselves,
put them inside your webapp (in /WEB-INF/lib, or just unpacked under
/WEB-INF/classe) during development, and then package them up when you are
done.  That way, you can use the manager's restart capability to pick up
the changes.

> Thanks,
> Andrew                            mailto:a@etver.com
>

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re[2]: outside catalina

Posted by "Andrew (Tver)" <a...@etver.com>.
Hello Craig,


>>
...
>> Is it possible to config Catalina these resources be accessable from
>> servlets (and for classes in c:/kit/classes too)?
>>

CRM> It's only possible to do this if you hand-modify the "catalina.sh" or
CRM> "catalina.bat" scripts to set the startup CLASSPATH to include your extra
CRM> repositories.  Personally, I am *****absolutely***** not interested in
CRM> supporting any standard mechanism like this.  You are totally on your own.

Thanks, it works.

CRM> Why?  Experience has shown that using the CLASSPATH for this purpose
CRM> causes *huge* numbers of support issues.  Prior to the introduction of
CRM> this concept, CLASSPATH was the number 2 question volume on TOMCAT-USER
CRM> (after web connector config issues).  Now , it has almost disappeared
CRM> because people easily understand how it works.  You'd be *much* better off
CRM> setting up your application deployment process to include copying the
CRM> shared JAR files to the correct place.  With disk space costs being what
CRM> they are, there's just no cost-based excuse for trying to avoid
CRM> duplication.

CRM> Hint -- the sample "build.xml" scripts included with the Tomcat 4 version
CRM> of the "Application Developer's Guide" have provisions to do this kind of
CRM> thing automatically, so you don't have to think about it :-).

CRM>   http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/index.html

CRM> Craig McClanahan


I'm absolutley agree with you in the case of "real" deployment. But
what about development time? I have about 600 classes in my project.
Using standard ant build make me to recompile all of them, and so on
according to ant task. Are you using full deployment process after any
small modifying of a single file (at development/*debugging* time)?

BTW, is it possible to do something like

.../manager/reload?path=/myApp

with respect to external classes/jars?

Thanks,
Andrew                            mailto:a@etver.com


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: outside catalina

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 27 Dec 2001, Andrew (Tver) wrote:

> Date: Thu, 27 Dec 2001 09:09:09 +0300
> From: "Andrew (Tver)" <a...@etver.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>,
>      "Andrew (Tver)" <a...@etver.com>
> To: tomcat-user@jakarta.apache.org
> Subject: outside catalina
>
> Hello All,
>
> I'm new in the list. Sorry if such question already was here.
>

It has been asked ... many times ... but many other newbies haven't
researched the answer either, so here it is again.

> I have:
>
> 1. This context:
>
> <Context path="/myapp"  docBase="c:/path/to/myapp"
>          debug="0" reloadable="true"/>
>
> 2. Kit of classes, XML-files anf jars needed to servlets, for example:
>
> c:/kit/classes - .class files
> c:/kit/resources - JPG, XML, properties, ...
> c:/kit/lib/some.jar, ...
>
> Question:
>
> By some reason it is not handy to copy any of these files to docBase,
> common/classes, common/lib - in one word, to "Catalina inside".
>
> Is it possible to config Catalina these resources be accessable from
> servlets (and for classes in c:/kit/classes too)?
>

It's only possible to do this if you hand-modify the "catalina.sh" or
"catalina.bat" scripts to set the startup CLASSPATH to include your extra
repositories.  Personally, I am *****absolutely***** not interested in
supporting any standard mechanism like this.  You are totally on your own.

Why?  Experience has shown that using the CLASSPATH for this purpose
causes *huge* numbers of support issues.  Prior to the introduction of
this concept, CLASSPATH was the number 2 question volume on TOMCAT-USER
(after web connector config issues).  Now , it has almost disappeared
because people easily understand how it works.  You'd be *much* better off
setting up your application deployment process to include copying the
shared JAR files to the correct place.  With disk space costs being what
they are, there's just no cost-based excuse for trying to avoid
duplication.

Hint -- the sample "build.xml" scripts included with the Tomcat 4 version
of the "Application Developer's Guide" have provisions to do this kind of
thing automatically, so you don't have to think about it :-).

  http://jakarta.apache.org/tomcat/tomcat-4.0-doc/appdev/index.html

> Thanks!
> Andrew                          mailto:a@etver.com

Craig McClanahan


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>