Since it's only two lines, I'll top-post as well as answer inline.

http://wiki.apache.org/tomcat/TomcatHibernate


On 3/4/2014 12:05 PM, Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Charles,

On 3/4/14, 2:56 PM, Charles Richard wrote:
On Tue, Mar 4, 2014 at 3:17 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

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.


That  is something that would be the next priority after
understanding our connection pooling issues. If upgrading Tomcat
would help with this as well, we would definitely try to
fasttrack it. We usually try to change one thing at a time on our
production environment.

A very good policy. No, I don't think this will help you with your
DataSource stuff. But you will want to get this into testing ASAP.
Honestly, you should probably be looking at Tomcat 7 or even Tomcat 8
for getting into your development and/or testing environments.

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.

I'm really not sure how that could be done either but hopefully
the developers here could help me with this.


Here's a quick wiki document I wrote a while back for that:

http://wiki.apache.org/tomcat/TomcatHibernate



They should be able to do that.

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?




We've got a WEB-INF folder in our appBase folder reference
(/ourpath/WEB-INF).



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


I guess.


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.


In our /ourpath/META-INF, there is no context.xml, just a
MANIFEST.MF file. I can create one if that's what I'm supposed to
do.

Yep, just create a new one.

- -chris

Hope that helps

Mark
/mde/

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

Reply via email to