Re: cluster deployment by context descriptors

2009-12-03 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Paolo,

On 11/20/2009 5:36 AM, Paolo Santarsiero wrote:
 So I must configure vhost under apache for a specific webapp and then create
 context descriptor for specific tomcats under default host (ex. under tom1
 and tom2 and not under tom3). Or must I create vhost under specific tomcats
 too?

No, you just have to use different load-balancing configurations for
each set of webapps you want to deploy differently.

Let's say you have 2 webapps: A and B.
Let's say you have 6 app servers: 1, 2, 3, 4, 5, and 6.
Let's say you have the following deployments:

Server  Webapps
1   A
2   B
3   A
4   B
5   A, B
6   A, B

You will want to set up your workers to load balance webapp A separately
from webapp B, maybe like this:

workers.properties
- --
worker.list=lbA, lbB

worker.lbA.type=lb
worker.lbA.balance_workers=server1, server3, server5, server6

worker.lbB.type=lb
worker.lbB.balance_workers=server2, server4, server5, server6

// now, configure the serverX workers in some obvious way

httpd.conf
- --

JkMount /webappA|/* lbA

JkMount /webappB|/* lbB

This should protect you from sending your requests to the wrong server.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAksYKZwACgkQ9CaO5/Lv0PAptACgmd+CBgY6Ku0/X21q7TtepHTY
X24AoIEiPy6MvmJWNIUq1I/yjZ91qBSp
=73aU
-END PGP SIGNATURE-

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



cluster deployment by context descriptors

2009-11-20 Thread Paolo Santarsiero
Hi all, I have a cluster with Apache2.2 and three Tomcat 6 instances in load
balance and sticky sessions on three different servers. I use another server
like webapps repository, so my tomcat's go to applications by context
descriptors. But I don't want all three tom go on all apllications, so I
replicate same context to only tomcats I want. This doesn't works fine,
beacause sometimes the tom that doesn't point to that application receive
the request and display a 404 page. How can I solve the problem? Thanks


Re: cluster deployment by context descriptors

2009-11-20 Thread Pid

On 20/11/2009 09:22, Paolo Santarsiero wrote:

Hi all, I have a cluster with Apache2.2 and three Tomcat 6 instances in load
balance and sticky sessions on three different servers. I use another server
like webapps repository, so my tomcat's go to applications by context
descriptors. But I don't want all three tom go on all apllications, so I
replicate same context to only tomcats I want. This doesn't works fine,
beacause sometimes the tom that doesn't point to that application receive
the request and display a 404 page. How can I solve the problem? Thanks



Problem: you're sending the traffic to the wrong Tomcats?
Solution: don't send the traffic to the wrong Tomcat.

Your mod_jk or mod_proxy load balancing config is sending* the traffic 
to Tomcat instances without the right apps, so you'll have to modify 
your config to ensure it does not do that.


There's no magic fix for undoing something you've told it to do.


p


* I'm guessing here, because your post is a bit short of actual details.

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



Re: cluster deployment by context descriptors

2009-11-20 Thread Paolo Santarsiero
So I must configure vhost under apache for a specific webapp and then create
context descriptor for specific tomcats under default host (ex. under tom1
and tom2 and not under tom3). Or must I create vhost under specific tomcats
too?

2009/11/20 Pid p...@pidster.com

 On 20/11/2009 09:22, Paolo Santarsiero wrote:

 Hi all, I have a cluster with Apache2.2 and three Tomcat 6 instances in
 load
 balance and sticky sessions on three different servers. I use another
 server
 like webapps repository, so my tomcat's go to applications by context
 descriptors. But I don't want all three tom go on all apllications, so I
 replicate same context to only tomcats I want. This doesn't works fine,
 beacause sometimes the tom that doesn't point to that application receive
 the request and display a 404 page. How can I solve the problem? Thanks


 Problem: you're sending the traffic to the wrong Tomcats?
 Solution: don't send the traffic to the wrong Tomcat.

 Your mod_jk or mod_proxy load balancing config is sending* the traffic to
 Tomcat instances without the right apps, so you'll have to modify your
 config to ensure it does not do that.

 There's no magic fix for undoing something you've told it to do.


 p


 * I'm guessing here, because your post is a bit short of actual details.


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




Share libraries for Context Descriptors

2009-10-30 Thread Paolo Santarsiero
Hi, I have a cluster with three tomcat6's instances. My tomcats access
applications on a common repository server, so I use Context descriptors in
order to point the applications. Differents apps often use same libraries,
and I'd like to share libraries at Context Descriptor level (in
context.xml). Is it possible? Or is there another system to do this? Many
thanks.


RE: Share libraries for Context Descriptors

2009-10-30 Thread Caldarale, Charles R
 From: Paolo Santarsiero [mailto:paolo.santarsi...@gmail.com]
 Subject: Share libraries for Context Descriptors
 
 Differents apps often use same libraries, and I'd like to share 
 libraries at Context Descriptor level (in context.xml).

As has been discussed numerous times on this mailing list, sharing libraries at 
run time is almost always a really bad idea.  Although it may reduce PermGen 
usage, memory and disk space are both extremely inexpensive these days, so that 
shouldn't be a concern.  The dependency problems and inability to restart 
individual webapps far outweigh any resource savings.

If you're talking about just sharing repository locations, that's not quite as 
bad, but still creates versioning dependency issues.  You can develop your own 
webapp classloader (or use Tomcat's undocumented VirtualWebappLoader) to extend 
the repository locations beyond WEB-INF/lib and WEB-INF/classes, but you are 
introducing unnecessary complexity if all you're saving is a little disk space. 
 Proper build and deployment scripts are usually a much better solution.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.


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



any way to inhibit Tomcat from deleting context descriptors if the WAR file disappears?

2008-09-05 Thread Julian Dunn

Is there any way to stop Tomcat from deleting my Context descriptor files if 
the WAR file somehow disappears? (Other than chmod 400 that is :-) )

- Julian


--
-- Julian C. Dunn, P.Eng. [EMAIL PROTECTED]
-- Assistant Team Lead / Chef d'équipe adjoint
-- Media Production Support / Soutien à la production des médias
-- Canadian Broadcasting Corporation / Société Radio-Canada
-- Office/Bureau: 2C310-N  *  Tel.: (416) 205-3311 x6988 * DID: 1-151-6988


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Context Descriptors

2007-05-11 Thread Caldarale, Charles R
 From: lightbulb432 [mailto:[EMAIL PROTECTED] 
 Subject: Context Descriptors
 
 The following regarding Context Descriptors is in
 the documentation for Tomcat 6. I'm wondering why
 the included contexts such as /examples, /docs,
 /host-manager, and ROOT (/) don't have Context
 Descriptors generated as described below. 

Because those apps are simple enough not to need one.

 If a Context Descriptor is not provided for a Context, Tomcat 
 automatically creates one and places it in (1) with a filename
 of [webappname].xml

The above statement is not true; the doc needs updating.  Tomcat creates
the internal data structures for the webapp's Context, but does not
store it in any persistent location.

 although if manually created, the filename need not match 
 the web application name

That statement is also not true - the filename must match, unless the
Context element is in server.xml, in which case there is no filename.

[Mark - the above somewhat out-of-date statements are in:
http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html#A%20word%20o
n%20Contexts]

 Why, under /manager, do I see the following in
 /manager/manager.xml:

As far as I can tell, that's left-over junk from previous levels; that
.xml file used to end up in conf/Catalina/localhost.  Regardless, the
location cited above isn't used during deployment or running of the app.

 And the following in /manager/META-INF/context.xml? Why the 
 presence of two context descriptors?

That's the real one; the first is no longer used.

 And finally, why do I see the docBase as
 ${catalina.home}/server/webapps/manager in the previous 
 manager.xml, when the default Tomcat 6 installation doesn't
 even have a server directory?

Again, left-over artifacts from previous Tomcat levels.

 What confuses me is how it still works even when that
 directory isn't there or created.

Because that .xml file is completely ignored.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Context Descriptors

2007-05-11 Thread Lakshmi Venkataraman
In the one month that I have been in this forum, people ask this
question in
 so many different words under so many different subject headings.
My own question, the newbie that I am  started out with  similar
questions.
Documentation is NOT CLEAR. I hope somebody who has the authority to
change the documentation does so.

Another suggestion, Chuck, since you are always responding to any
context related qeustion, if
you find some time, may be you should mail an FAQ post on this forum on
the topic of contexts
and deployments with example directory layouts.

Thanks
Lakshmi

-Original Message-
From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 11, 2007 6:13 AM
To: Tomcat Users List
Subject: RE: Context Descriptors

 From: lightbulb432 [mailto:[EMAIL PROTECTED]
 Subject: Context Descriptors
 
 The following regarding Context Descriptors is in the documentation 
 for Tomcat 6. I'm wondering why the included contexts such as 
 /examples, /docs, /host-manager, and ROOT (/) don't have Context 
 Descriptors generated as described below.

Because those apps are simple enough not to need one.

 If a Context Descriptor is not provided for a Context, Tomcat 
 automatically creates one and places it in (1) with a filename of 
 [webappname].xml

The above statement is not true; the doc needs updating.  Tomcat creates
the internal data structures for the webapp's Context, but does not
store it in any persistent location.

 although if manually created, the filename need not match the web 
 application name

That statement is also not true - the filename must match, unless the
Context element is in server.xml, in which case there is no filename.

[Mark - the above somewhat out-of-date statements are in:
http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html#A%20word%20o
n%20Contexts]

 Why, under /manager, do I see the following in
 /manager/manager.xml:

As far as I can tell, that's left-over junk from previous levels; that
.xml file used to end up in conf/Catalina/localhost.  Regardless, the
location cited above isn't used during deployment or running of the app.

 And the following in /manager/META-INF/context.xml? Why the presence 
 of two context descriptors?

That's the real one; the first is no longer used.

 And finally, why do I see the docBase as 
 ${catalina.home}/server/webapps/manager in the previous manager.xml,

 when the default Tomcat 6 installation doesn't even have a server 
 directory?

Again, left-over artifacts from previous Tomcat levels.

 What confuses me is how it still works even when that directory isn't 
 there or created.

Because that .xml file is completely ignored.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Context Descriptors

2007-05-11 Thread Mark Thomas
Caldarale, Charles R wrote:
 [Mark - the above somewhat out-of-date statements are in:
 http://tomcat.apache.org/tomcat-6.0-doc/deployer-howto.html#A%20word%20o
 n%20Contexts]

Thanks. Fixed.

Mark


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Context Descriptors

2007-05-10 Thread lightbulb432

The following regarding Context Descriptors is in the documentation for
Tomcat 6. I'm wondering why the included contexts such as /examples, /docs,
/host-manager, and ROOT (/) don't have Context Descriptors generated as
described below. 


The locations for Context Descriptors are; 

$CATALINA_HOME/conf/[enginename]/[hostname]/context.xml 
$CATALINA_HOME/webapps/[webappname]/META-INF/context.xml 

If a Context Descriptor is not provided for a Context, Tomcat automatically
creates one and places it in (1) with a filename of [webappname].xml
although if manually created, the filename need not match the web
application name as Tomcat is concerned only with the Context configuration
contained within the Context Descriptor file(s). 


The only one that I see one for is /manager, which leads to my next
question. Why, under /manager, do I see the following in
/manager/manager.xml:


Context docBase=${catalina.home}/server/webapps/manager
 privileged=true antiResourceLocking=false
antiJARLocking=false

  !-- Link to the user database we will get roles from --
  ResourceLink name=users global=UserDatabase
type=org.apache.catalina.UserDatabase/

/Context


And the following in /manager/META-INF/context.xml? Why the presence of two
context descriptors?


Context antiResourceLocking=false privileged=true /


And finally, why do I see the docBase as
${catalina.home}/server/webapps/manager in the previous manager.xml, when
the default Tomcat 6 installation doesn't even have a server directory? What
confuses me is how it still works even when that directory isn't there or
created.
-- 
View this message in context: 
http://www.nabble.com/Context-Descriptors-tf3725427.html#a10425763
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Deploying with Static Context Descriptors

2006-04-03 Thread sean . harrison
I'm migrating web applications from Tomcat v.4 to v.5.5 and having some 
trouble adapting my old virtual hosts setup with the 5.5 recommended 
methods.

According to http://tomcat.apache.org/tomcat-5.5-doc/config/context.html 
In addition to nesting Context elements inside a Host element, you can 
also store them: in individual files (with a .xml extension) in the 
$CATALINA_HOME/conf/[enginename]/[hostname]/ directory

So to make sure I know what I'm doing, I used a server.xml with this:

   Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm 
resourceName=UserDatabase/ 
  Host name=localhost appBase=webapps unpackWARs=true 
autoDeploy=true xmlValidation=false xmlNamespaceAware=false
/Host
/Engine

And then created a file $CATALINA_HOME/conf/Catalina/localhost/sean.xml 
with my Context element, which reads,

 Context path= docBase=ROOT/Context

But when I start Tomcat, I get surprising errors. First...

   Apr 3, 2006 3:05:13 PM org.apache.catalina.startup.HostConfig 
deployDescriptor
   WARNING: A docBase /var/tomcat5/webapps/ROOT inside the host appBase 
has been specified, and will be ignored

Although Tomcat seems to be trying to read my docBase param, something is 
not right. It thinks appBase is a host.[?] Then I get...

   Apr 3, 2006 3:05:13 PM org.apache.catalina.core.StandardContext 
resourcesStart
   SEVERE: Error starting static Resources
   java.lang.IllegalArgumentException: Document base 
/var/tomcat5/webapps/sean does not exist or is not a readable directory

Tomcat seems to be looking for a web app by the name of sean from the 
filename sean.xml.  But according to 
http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html If a Context 
Descriptor is... ...manually created, the filename need not match the web 
application name as Tomcat is concerned only with the Context 
configuration contained within the Context Descriptor file(s).

With Tomcat 4 I had my Context Descriptors outside of server.xml and 
separated by virtual hosts in individual files very similar to v5.5's 
$CATALINA_HOME/conf/[enginename]/[hostname]/ approach, but now I can't 
seem to get grasp how exactly v.5.5. wants it done.

What am I missing?

Thanks in advance,



S  e  a  n   H  a  r  r  i  s  o  n
- - -
Internet Services Administrator
Lincoln, Nebraska

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Deploying with Static Context Descriptors

2006-04-03 Thread Eric Wulff
I'm having the exact same problem and have followed a similar path
looking for a solution - but no success yet.  I'll keep the list
posted if I find anything.  I eagerly await suggestions here too of
course.

thx
Eric


On 4/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 I'm migrating web applications from Tomcat v.4 to v.5.5 and having some
 trouble adapting my old virtual hosts setup with the 5.5 recommended
 methods.

 According to http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
 In addition to nesting Context elements inside a Host element, you can
 also store them: in individual files (with a .xml extension) in the
 $CATALINA_HOME/conf/[enginename]/[hostname]/ directory

 So to make sure I know what I'm doing, I used a server.xml with this:

Engine name=Catalina defaultHost=localhost
   Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
   Host name=localhost appBase=webapps unpackWARs=true
 autoDeploy=true xmlValidation=false xmlNamespaceAware=false
 /Host
 /Engine

 And then created a file $CATALINA_HOME/conf/Catalina/localhost/sean.xml
 with my Context element, which reads,

  Context path= docBase=ROOT/Context

 But when I start Tomcat, I get surprising errors. First...

Apr 3, 2006 3:05:13 PM org.apache.catalina.startup.HostConfig
 deployDescriptor
WARNING: A docBase /var/tomcat5/webapps/ROOT inside the host appBase
 has been specified, and will be ignored

 Although Tomcat seems to be trying to read my docBase param, something is
 not right. It thinks appBase is a host.[?] Then I get...

Apr 3, 2006 3:05:13 PM org.apache.catalina.core.StandardContext
 resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
 /var/tomcat5/webapps/sean does not exist or is not a readable directory

 Tomcat seems to be looking for a web app by the name of sean from the
 filename sean.xml.  But according to
 http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html If a Context
 Descriptor is... ...manually created, the filename need not match the web
 application name as Tomcat is concerned only with the Context
 configuration contained within the Context Descriptor file(s).

 With Tomcat 4 I had my Context Descriptors outside of server.xml and
 separated by virtual hosts in individual files very similar to v5.5's
 $CATALINA_HOME/conf/[enginename]/[hostname]/ approach, but now I can't
 seem to get grasp how exactly v.5.5. wants it done.

 What am I missing?

 Thanks in advance,



 S  e  a  n   H  a  r  r  i  s  o  n
 - - -
 Internet Services Administrator
 Lincoln, Nebraska

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Deploying with Static Context Descriptors

2006-04-03 Thread Eric Wulff
ok, I solved the problem for my configuration and perhaps my solution
will help you.  I'm running tomcat 5.5.16 on win XP and java 1.5_06.

I have my webapp sitting in a directory titled ROOT instead of appName
as I had it in tomcat 5.0.28 (of course I renamed the original ROOT
directory to something else).  I have no context at Catlina/localhost.
 Instead, I have context.xml in a META-INF directory -
ROOT/META-INF/context.xml.

Context path= docBase=ROOT debug=0 reloadable=true
antiResourceLocking=false antiJARLocking=false 

Now my webapp is recognized by tomcat exactly how I want - at the
ROOT.  Hopefully this helps you.


and now for something completely different - I'm having problems with
mysql db connection now ...

ERROR cims.FilterDispatcher - EXCEPTION: getConnectionFromPool():
attempting to get connection from db: MysqlSf:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class '' for connect URL 'null'

perhaps this is due to the fact that my app is now in a directory
called ROOT instead of appName.  Anyway, I'm off to check into this
some more.

Eric


On 4/3/06, Eric Wulff [EMAIL PROTECTED] wrote:
 I'm having the exact same problem and have followed a similar path
 looking for a solution - but no success yet.  I'll keep the list
 posted if I find anything.  I eagerly await suggestions here too of
 course.

 thx
 Eric


 On 4/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
  I'm migrating web applications from Tomcat v.4 to v.5.5 and having some
  trouble adapting my old virtual hosts setup with the 5.5 recommended
  methods.
 
  According to http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
  In addition to nesting Context elements inside a Host element, you can
  also store them: in individual files (with a .xml extension) in the
  $CATALINA_HOME/conf/[enginename]/[hostname]/ directory
 
  So to make sure I know what I'm doing, I used a server.xml with this:
 
 Engine name=Catalina defaultHost=localhost
Realm className=org.apache.catalina.realm.UserDatabaseRealm
  resourceName=UserDatabase/
Host name=localhost appBase=webapps unpackWARs=true
  autoDeploy=true xmlValidation=false xmlNamespaceAware=false
  /Host
  /Engine
 
  And then created a file $CATALINA_HOME/conf/Catalina/localhost/sean.xml
  with my Context element, which reads,
 
   Context path= docBase=ROOT/Context
 
  But when I start Tomcat, I get surprising errors. First...
 
 Apr 3, 2006 3:05:13 PM org.apache.catalina.startup.HostConfig
  deployDescriptor
 WARNING: A docBase /var/tomcat5/webapps/ROOT inside the host appBase
  has been specified, and will be ignored
 
  Although Tomcat seems to be trying to read my docBase param, something is
  not right. It thinks appBase is a host.[?] Then I get...
 
 Apr 3, 2006 3:05:13 PM org.apache.catalina.core.StandardContext
  resourcesStart
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base
  /var/tomcat5/webapps/sean does not exist or is not a readable directory
 
  Tomcat seems to be looking for a web app by the name of sean from the
  filename sean.xml.  But according to
  http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html If a Context
  Descriptor is... ...manually created, the filename need not match the web
  application name as Tomcat is concerned only with the Context
  configuration contained within the Context Descriptor file(s).
 
  With Tomcat 4 I had my Context Descriptors outside of server.xml and
  separated by virtual hosts in individual files very similar to v5.5's
  $CATALINA_HOME/conf/[enginename]/[hostname]/ approach, but now I can't
  seem to get grasp how exactly v.5.5. wants it done.
 
  What am I missing?
 
  Thanks in advance,
 
 
 
  S  e  a  n   H  a  r  r  i  s  o  n
  - - -
  Internet Services Administrator
  Lincoln, Nebraska
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Deploying with Static Context Descriptors

2006-04-03 Thread Eric Wulff
ok, figured I'd reply to this post one more time because I think this
issue is directly related to the context descriptor and anyone who is
using MySQL and upgrading from tomcat 5.0.28 to 5.5.16, and likely
other versions.  You need to configure the resource factory
differently than how the docs direct for 5.0.28.  While it is clearly
documented under 5.5 docs in the JNDI section, I did not notice it in
any update/changes notes.

ok, in 5.0.28 I set up my resource factory in my context.xml a
Resource name=jdbc/yadayada type=javax.sql.datasource
auth=Container / tag followed by a ResourceParams element with
various nested parameter elements mapping name, value pairs. 
This did not work for me in 5.5.16 and (error msg is copied below). 
Instead I needed to include all my parameter names and values within
the Resource / tag itself - no ResourceParams element.  So, along
with name, type, auth, I also included driverClassName, username,
password, url, etc right in the Resource tag of the context.xml.

dig?

Eric



On 4/3/06, Eric Wulff [EMAIL PROTECTED] wrote:
 ok, I solved the problem for my configuration and perhaps my solution
 will help you.  I'm running tomcat 5.5.16 on win XP and java 1.5_06.

 I have my webapp sitting in a directory titled ROOT instead of appName
 as I had it in tomcat 5.0.28 (of course I renamed the original ROOT
 directory to something else).  I have no context at Catlina/localhost.
  Instead, I have context.xml in a META-INF directory -
 ROOT/META-INF/context.xml.

 Context path= docBase=ROOT debug=0 reloadable=true
 antiResourceLocking=false antiJARLocking=false 

 Now my webapp is recognized by tomcat exactly how I want - at the
 ROOT.  Hopefully this helps you.


 and now for something completely different - I'm having problems with
 mysql db connection now ...

 ERROR cims.FilterDispatcher - EXCEPTION: getConnectionFromPool():
 attempting to get connection from db: MysqlSf:
 org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
 driver of class '' for connect URL 'null'

 perhaps this is due to the fact that my app is now in a directory
 called ROOT instead of appName.  Anyway, I'm off to check into this
 some more.

 Eric


 On 4/3/06, Eric Wulff [EMAIL PROTECTED] wrote:
  I'm having the exact same problem and have followed a similar path
  looking for a solution - but no success yet.  I'll keep the list
  posted if I find anything.  I eagerly await suggestions here too of
  course.
 
  thx
  Eric
 
 
  On 4/3/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
   I'm migrating web applications from Tomcat v.4 to v.5.5 and having some
   trouble adapting my old virtual hosts setup with the 5.5 recommended
   methods.
  
   According to http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
   In addition to nesting Context elements inside a Host element, you can
   also store them: in individual files (with a .xml extension) in the
   $CATALINA_HOME/conf/[enginename]/[hostname]/ directory
  
   So to make sure I know what I'm doing, I used a server.xml with this:
  
  Engine name=Catalina defaultHost=localhost
 Realm className=org.apache.catalina.realm.UserDatabaseRealm
   resourceName=UserDatabase/
 Host name=localhost appBase=webapps unpackWARs=true
   autoDeploy=true xmlValidation=false xmlNamespaceAware=false
   /Host
   /Engine
  
   And then created a file $CATALINA_HOME/conf/Catalina/localhost/sean.xml
   with my Context element, which reads,
  
Context path= docBase=ROOT/Context
  
   But when I start Tomcat, I get surprising errors. First...
  
  Apr 3, 2006 3:05:13 PM org.apache.catalina.startup.HostConfig
   deployDescriptor
  WARNING: A docBase /var/tomcat5/webapps/ROOT inside the host appBase
   has been specified, and will be ignored
  
   Although Tomcat seems to be trying to read my docBase param, something is
   not right. It thinks appBase is a host.[?] Then I get...
  
  Apr 3, 2006 3:05:13 PM org.apache.catalina.core.StandardContext
   resourcesStart
  SEVERE: Error starting static Resources
  java.lang.IllegalArgumentException: Document base
   /var/tomcat5/webapps/sean does not exist or is not a readable directory
  
   Tomcat seems to be looking for a web app by the name of sean from the
   filename sean.xml.  But according to
   http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html If a Context
   Descriptor is... ...manually created, the filename need not match the web
   application name as Tomcat is concerned only with the Context
   configuration contained within the Context Descriptor file(s).
  
   With Tomcat 4 I had my Context Descriptors outside of server.xml and
   separated by virtual hosts in individual files very similar to v5.5's
   $CATALINA_HOME/conf/[enginename]/[hostname]/ approach, but now I can't
   seem to get grasp how exactly v.5.5. wants it done.
  
   What am I missing?
  
   Thanks in advance,
  
  
  
   S  e  a  n   H  a  r  r  i  s  o  n

Re: Deploying with Static Context Descriptors

2006-04-03 Thread Bob_Savard

Hi.

I just struggled with this and here's what I've determined so far.  It
depends on where your context xml file lives:

1) If your context XML file is named via the convention
$CATALINA_HOME/conf/[enginename]/[hostname]/[contextname].xml, then you're
fine.  Note that the file name is named after its context.
2) If your context XML file lives in the META-INF directory, it's called
context.xml and you need to set deployXML=true in Tomcat's server.xml
Host element.  See the Tomcat doc for the Host element.

Hope that helps.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]