-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Charles,

On 3/4/14, 2:10 PM, Charles Richard wrote:
> The tomcat version is 6.0.30.

You should look at the changelog and security reports. I think you're
going to want to upgrade.

> Can we still use Hibernate in our Spring application if we
> configure the Data Source through a context.xml?

Yup. You just need to tell Hibernate that you already have a
DataSource. I'm not exactly sure how to do that, but I'm confident it
can be done. You posted only the DataSource configuration itself and
it didn't have a name (other than the "id"). You'll need to figure out
how to get Hibernate to use an existing (external) DataSource rather
than configuring it yourself as you have done.

> We are not using a context.xml right now, can I use the
> context.xml in $TOMCAT_HOME/conf?

No! That's the system-wide defaults for all web applications deployed
to the container. You want META-INF/context.xml within your WAR file
(or exploded WAR-dir).

> Our server.xml, the config is as follows:
> 
> <Host name="www.oursite.com" appBase="/ourpath" unpackWARs="true"
> autoDeploy="true"> <Context path="" docBase="" reloadable="true"
> />

You should not have a <Context> element at all in your server.xml.
It's a wonder that your application even works with a path of "" and a
docBase of "". I'll bet you have a WEB-INF directory directly in your
webapps/ directory, right?

Sounds like you've got a mess on your hands.

Move that <Context> into META-INF/context.xml, remove the "docBase"
and "path" attributes, and then add a <Resource> as a child to
configure your DataSource. You'll also need to move your JDBC driver
from WEB-INF/lib into Tomcat's lib/ directory.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTFibgAAoJEBzwKT+lPKRYyzQP/RNazj5VESUpXcPqblaGV0Yt
PD7s3BmTNkYhrkKk2MMCIvLThySKtVUsKxEH6UfsCpKoJCUUR8mfmLCd+edTwIFK
EEm/4XfaxNcY4wh0OcVPKO7onVaJJ012rFkh74s8sGfThr9+wiyiBc43+vs9YwJ7
LpRBLxNuQp2d8HpMAqc87k1AS6A/nYdL8rCfOBQxDZ9c3/8e957P0+5Lf86u/ePj
1ckPrh/LUX3fy+JDaNOyGK2+9jg2E5g+QsZt/x4Wd6p30UnPdYDHd9pxibmyxOhb
Guj5Y8ZW5+4OfQ5l2oGGYzyawIiM5HXgdB6FoRZGOG3SvEwWtI+uUBOGRR8oAGTY
Bjm5/I0Y6gC9m2g24nAo5VSJu4cMvj7icsT557xGcIMIQyoAFaLziG8IyVzTlTjV
IlCijFxfMFzv/imMMQFcKbLSD6LfyRqQtxPbK+K0CKYGkZnsVasL+24RDr5L61SK
of/2WSR4rMnd+wcMR9LZJXJhR3X8I8MSdCk1535WssG3kjvQWqD7nHYCjRcWrdXs
pXMZaoNFcoby+fkl1omqF9XLUC3Bi4sslJPopnef+pvyzroY/jxznJqas8HnMWyK
RtIrDsWF+aU5k5o+y1SikOl4pZgQ/abwD4r0eGiSqD0vdnHpiX4MOg3UL1so+yQ5
we5YkJL9UklDrYT7mARZ
=6gLB
-----END PGP SIGNATURE-----

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

Reply via email to