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 Davis <dr...@gmail.com> on 2015/10/21 13:19:41 UTC

Question for posgresq, and jdbc.jar placement.

Ok, I'm embarrassed.

I've got a UBUNTU (GUI included) install of Tomcat7 installed from command
line.

Inside my machine I have what looks like two locations that play a key role.

****OPTION 1 for the jdbc.jar file?****
  I think that this is the "$CATALINA" base
  Path:  usr/share/tomcat7
         Folders Inside: (bin, common, conf, lib, log, server, shared)
         Files Inside: (defaults.md5sum, defaults.template,
logrotate.md5sum, logrotate.template)

****OPTION 2 for the jdbc.jar file?****
 I'm not sure if this would be the "$CATALINA" home
 Path: var/lib/tomcat7
         Folders Inside: (common, conf, logs, server, shared, webapps, work)
         **When I upload a .war file from the
http://localhost/manager/html interface
it is placed in the "webapps"**



****OPTION 3 for the jdbc.jar file?***  *This is working, but I am going to
write multiple apps which would use this .jar file.
do I just include multiple copies of the .jar, or is there a central place
to put it (please no jokes here).
[image: Inline image 2]


Andy...

Re: Question for posgresq, and jdbc.jar placement.

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jose,

On 10/22/15 2:22 PM, Jose María Zaragoza wrote:
> 2015-10-22 18:26 GMT+02:00 Christopher Schultz <ch...@christopherschultz.net>:
>> Ognjen,
>>
>> On 10/22/15 9:10 AM, Ognjen Blagojevic wrote:
>>> Jose & Chris,
>>>
>>> On 21.10.2015 20:47, Christopher Schultz wrote:
>>>> Jose,
>>>>
>>>> On 10/21/15 7:33 AM, Jose María Zaragoza wrote:
>>>>> IMHO
>>>>>
>>>>> $CATALINA_HOME/lib  would be the right place
>>>>
>>>> +1
>>>
>>> Are you willing to elaborate why do you prefer $CATALINA_HOME instead of
>>> $CATALINA_BASE?
>>>
>>> I don't have multiple Tomcat instances running, but I still split
>>> $CATALINA_HOME and $CATALINA_BASE to different directories in order to
>>> make Tomcat upgrades easier. Everything that is different from original
>>> installation goes to $CATALINA_BASE (bin/setenv.sh, conf/*, logs,
>>> webapp, etc... as well as additional jars including lib/(jdbc).jar. Thus
>>> when I upgrade Tomcat and change $CATALINA_HOME I don't have to think
>>> about additional jars.
>>
>> Our build process auto-builds CATALINA_BASE and so it's (marginally)
>> more convenient to have it in CATALINA_HOME. We also have 4 applications
>> running on each server from the same CATALINA_HOME and different
>> CATALINA_BASEs, but they all use the same JDBC driver.
>>
>> IMHO, it doesn't matter which one you use. I would have +1'd Jose
>> whichever one he said.
> 
> Cool !
> 
>> Honestly, CATALINA_BASE is probably much better,
>> since it won't interfere with other applications that might not need the
>> driver, or might require a different version, etc.
> 
> Honestly I've never needed to use CATALINA_BASE
> But I 've a question
> 
> every instance uses only its CATALINA_BASE directories or there is any
> kind of delegation hierachy for libraries ?
> 
> For example,if my webapp doesn't find a jar file on $CATALINA_BASE/lib
> , doest it search on $CATALINA_HOME/lib ?

Yes: the server's ClassLoader prefers JAR files found in CATALINA_BASE
over CATALINA_HOME. But if they conflict in odd ways, there can be
problems. I can't really think of a good example off-hand, but users
seem to find ways of shooting themselves in the foot with the
ClassLoaders quite well.

-chris

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


Re: Question for posgresq, and jdbc.jar placement.

Posted by Jose María Zaragoza <de...@gmail.com>.
2015-10-22 18:26 GMT+02:00 Christopher Schultz <ch...@christopherschultz.net>:
> Ognjen,
>
> On 10/22/15 9:10 AM, Ognjen Blagojevic wrote:
>> Jose & Chris,
>>
>> On 21.10.2015 20:47, Christopher Schultz wrote:
>>> Jose,
>>>
>>> On 10/21/15 7:33 AM, Jose María Zaragoza wrote:
>>>> IMHO
>>>>
>>>> $CATALINA_HOME/lib  would be the right place
>>>
>>> +1
>>
>> Are you willing to elaborate why do you prefer $CATALINA_HOME instead of
>> $CATALINA_BASE?
>>
>> I don't have multiple Tomcat instances running, but I still split
>> $CATALINA_HOME and $CATALINA_BASE to different directories in order to
>> make Tomcat upgrades easier. Everything that is different from original
>> installation goes to $CATALINA_BASE (bin/setenv.sh, conf/*, logs,
>> webapp, etc... as well as additional jars including lib/(jdbc).jar. Thus
>> when I upgrade Tomcat and change $CATALINA_HOME I don't have to think
>> about additional jars.
>
> Our build process auto-builds CATALINA_BASE and so it's (marginally)
> more convenient to have it in CATALINA_HOME. We also have 4 applications
> running on each server from the same CATALINA_HOME and different
> CATALINA_BASEs, but they all use the same JDBC driver.
>
> IMHO, it doesn't matter which one you use. I would have +1'd Jose
> whichever one he said.

Cool !

>Honestly, CATALINA_BASE is probably much better,
> since it won't interfere with other applications that might not need the
> driver, or might require a different version, etc.

Honestly I've never needed to use CATALINA_BASE
But I 've a question

every instance uses only its CATALINA_BASE directories or there is any
kind of delegation hierachy for libraries ?

For example,if my webapp doesn't find a jar file on $CATALINA_BASE/lib
, doest it search on $CATALINA_HOME/lib ?

Regards




>
> -chris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>

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


Re: Question for posgresq, and jdbc.jar placement.

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Ognjen,

On 10/22/15 9:10 AM, Ognjen Blagojevic wrote:
> Jose & Chris,
> 
> On 21.10.2015 20:47, Christopher Schultz wrote:
>> Jose,
>>
>> On 10/21/15 7:33 AM, Jose María Zaragoza wrote:
>>> IMHO
>>>
>>> $CATALINA_HOME/lib  would be the right place
>>
>> +1
> 
> Are you willing to elaborate why do you prefer $CATALINA_HOME instead of
> $CATALINA_BASE?
> 
> I don't have multiple Tomcat instances running, but I still split
> $CATALINA_HOME and $CATALINA_BASE to different directories in order to
> make Tomcat upgrades easier. Everything that is different from original
> installation goes to $CATALINA_BASE (bin/setenv.sh, conf/*, logs,
> webapp, etc... as well as additional jars including lib/(jdbc).jar. Thus
> when I upgrade Tomcat and change $CATALINA_HOME I don't have to think
> about additional jars.

Our build process auto-builds CATALINA_BASE and so it's (marginally)
more convenient to have it in CATALINA_HOME. We also have 4 applications
running on each server from the same CATALINA_HOME and different
CATALINA_BASEs, but they all use the same JDBC driver.

IMHO, it doesn't matter which one you use. I would have +1'd Jose
whichever one he said. Honestly, CATALINA_BASE is probably much better,
since it won't interfere with other applications that might not need the
driver, or might require a different version, etc.

-chris

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


Re: Question for posgresq, and jdbc.jar placement.

Posted by Ognjen Blagojevic <og...@gmail.com>.
Jose & Chris,

On 21.10.2015 20:47, Christopher Schultz wrote:
> Jose,
>
> On 10/21/15 7:33 AM, Jose María Zaragoza wrote:
>> IMHO
>>
>> $CATALINA_HOME/lib  would be the right place
>
> +1

Are you willing to elaborate why do you prefer $CATALINA_HOME instead of 
$CATALINA_BASE?

I don't have multiple Tomcat instances running, but I still split 
$CATALINA_HOME and $CATALINA_BASE to different directories in order to 
make Tomcat upgrades easier. Everything that is different from original 
installation goes to $CATALINA_BASE (bin/setenv.sh, conf/*, logs, 
webapp, etc... as well as additional jars including lib/(jdbc).jar. Thus 
when I upgrade Tomcat and change $CATALINA_HOME I don't have to think 
about additional jars.

-Ognjen

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


Re: Question for posgresq, and jdbc.jar placement.

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jose,

On 10/21/15 7:33 AM, Jose María Zaragoza wrote:
> IMHO
> 
> $CATALINA_HOME/lib  would be the right place

+1

-chris

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


Re: Question for posgresq, and jdbc.jar placement.

Posted by Jose María Zaragoza <de...@gmail.com>.
2015-10-21 13:19 GMT+02:00 Andrew Davis <dr...@gmail.com>:

> Ok, I'm embarrassed.
>
> I've got a UBUNTU (GUI included) install of Tomcat7 installed from command
> line.
>
> Inside my machine I have what looks like two locations that play a key
> role.
>
> ****OPTION 1 for the jdbc.jar file?****
>   I think that this is the "$CATALINA" base
>   Path:  usr/share/tomcat7
>          Folders Inside: (bin, common, conf, lib, log, server, shared)
>          Files Inside: (defaults.md5sum, defaults.template,
> logrotate.md5sum, logrotate.template)
>
> ****OPTION 2 for the jdbc.jar file?****
>  I'm not sure if this would be the "$CATALINA" home
>  Path: var/lib/tomcat7
>          Folders Inside: (common, conf, logs, server, shared, webapps,
> work)
>          **When I upload a .war file from the
> http://localhost/manager/html interface it is placed in the "webapps"**
>
>
>
Probably you have symbolic links in /usr/share/tomcat7
Have a look

ls -lrt tomcat7




>
> ****OPTION 3 for the jdbc.jar file?***  *This is working, but I am going
> to write multiple apps which would use this .jar file.
> do I just include multiple copies of the .jar, or is there a central place
> to put it (please no jokes here).
> [image: Inline image 2]
>


IMHO

$CATALINA_HOME/lib  would be the right place





>
>
> Andy...
>