2

We're experiencing slightly strange webapp deployment behaviour under Tomcat 5.5.27 on Linux (both on CentOS in production and Ubuntu 10.04 for development).

App A and app B are almost identical (exactly the same libraries, a copied Maven project), App B differs only in that its JPA entities are annotated to access a different table within the same schema (the JNDI database references are identical).

When the apps are deployed into either environment, app B will not start. However:

  1. Manually starting the stalled app, from the Tomcat admin console, works fine (???).
  2. After any attempt to restart Tomcat, the alphabetically later app fails to start. Point #1 still remains valid (???)
  3. Logging is configured (log4j), however, we get nothing from [the yet-to-start] app B's logging, nor errors from Tomcat's 'catalina.out' log file (NB. logging is working once the apps are up and running).

I've done a reasonably thorough search for information (Apache/Tomcat bugzilla, Google) but I've found nothing of real use. Other posts have sighted the use of the antijarlocking and antiresourcelocking attributes on the server's 'context.xml' 'Context' node, but there is also a suggestion that this is unecessary/inaffective under Linux (hasn't appeared to work here, either).

Any ideas?

Cheers

Rich

P.S. Upgrading from Tomcat 5.5.x isn't an option, currently (IT support etc.).

Community
  • 1
  • 1
Big Rich
  • 5,864
  • 1
  • 40
  • 64

1 Answers1

5

There is a similar behavior to spring applications on tomcat. -- They require that the webAppRootKey is unique for each application. -- If not the applications behave like you described, so in case of Spring apps, make sure that App-A has an other webAppRootKey then App-B.

<context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>myRootKey</param-value>
</context-param>

@See http://groups.google.com/group/riotfamily/browse_thread/thread/9a0edf69575d3ab6?pli=1

Ralph
  • 118,862
  • 56
  • 287
  • 383
  • Ralph, I'll have a look into this and let you know how I get on. It's notable that you mention Spring as, yes, these are a Spring-based applications ;-) . Also, thanks for the speedy reply. – Big Rich Dec 17 '10 at 15:07
  • does what it says on the tin! Yep, that works. Strangely, I have a vague recolection that we have set this webAppRootKey on another project, sometime in the last 4-5 years (really ;-) ). Thanks again. – Big Rich Dec 17 '10 at 15:38