tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: some clarification about context.
Date Thu, 03 Jan 2013 03:28:49 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Mauro,

On 1/2/13 9:52 AM, Mauro wrote:
> Here is my_app.xml:
> 
> <Context path="/myapp> <Resource name="jdbc/myapp" auth="Container"
> type="javax.sql.DataSource" maxActive="100" maxIdle="30"
> maxWait="10000" username="mauro" password="xxx"
> driverClassName="org.postgresql.Driver" 
> url="jdbc:postgresql://svsopsql01.mydomain.com:5432/my_app"/> 
> </Context>

You should not be setting the "path" attribute of the <Context>: the
path will be determined from the name of the file. Are you placing
your WAR file (or exploded WAR directory) in your <Host>'s deployment
directory (typically CATALINA_BASE/webapps)? If not, you'll have to
specify the docBase attribute in your <Context>.

Unless you have a copy/paste error, the above is invalid XML because
you haven't closed the "path" attribute's value.

Everything else looks good to me.

> and here is my_app1.xml
> 
> <Context path="/myapp1> <Resource name="jdbc/myapp1"
> auth="Container" type="javax.sql.DataSource" maxActive="100"
> maxIdle="30" maxWait="10000" username="mauro" password="xxx"
> driverClassName="org.postgresql.Driver" 
> url="jdbc:postgresql://svsopsql01.mydomain.com:5432/my_app1"/> 
> </Context>

Same comments as above.

> Here is the message error of the first application:
> 
> org.jruby.rack.RackInitializationException: The driver encountered
> an unknown error: Cannot create JDBC driver of class 
> 'org.postgresql.Driver' for connect URL

You mentioned that you put your Postgres driver in CATALINA_BASE/lib.
Do you also have those drivers in the WEB-INF/lib directory of either
'my_app' or 'my_app1'?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEAREIAAYFAlDk+vEACgkQ9CaO5/Lv0PB/bwCggAAiuB8oEXI9TR4vc9dwXMDU
u/YAn2k3S7anrY8SKZLMjSG/QxBf7ajG
=udjH
-----END PGP SIGNATURE-----

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


Mime
View raw message