Mmmhhhhh, not sure of that. i can deploy and run successfully the application on the tomcat version if i comment out the sitemesh filter mapping in web.xml even if i get the filenotfoundexception during shutdown.


Viet Nguyen wrote:

I was able to reproduce this problem with your test app. I also found out that any EAR deployed at the root context (using tomcat) will have the same problem. It is not hibernate/spring/sitemesh specific. It may be a bug in Geronimo. The problem occurs because when the server is shut down, the sessions are not being saved properly. You can try to get this error with the following:
1. deploy an EAR at the root context (in tomcat)
2. stop the server (you should get a FileNotFoundException) <-- this is the cause of the problem
3. start the server
4. try to view the web app at the root context (there should be problems viewing it)

As you mentioned, this only happens with EARs, the WAR equivalent works fine.

I will keep digging.


p.s. if you want your app to work on tomcat, you have to redeploy the app on the server. When you visit the website it should be working. But like I said, if you stop the server, there will be a FileNotFoundException.

On 9/5/07, Viet Nguyen <> wrote:
Hi Paolo,

Which DB are you using? I could not get this to work on the derby db that comes with Geronimo because it doesn't support some keywords (e.g. AUTO_INCREMENT), but when I used MySQL everything works fine (with or without the commenting of the filters in the web.xml and on both jetty and tomcat containers).


On 9/5/07, Paolo Denti < > wrote:
Hi Kevan,
you can find the deployable ear here:
and just the webapp with sources included here:

in order to deploy the app, you need a connection pools named TestDS, pointing to an existing db, nothing more (a table named test will be automatically created in that db).
deploy and just browse to http://localhost:8080/index.htm on the tomcat version to get the problem

about the Viet links, those links are jmx related, and i cannot solve the problem just
setting MBeanExporter's "exposeManagedResourceClassLoader" property to "true"

moreover, seeing in which conditions it happens (for example point 4) it looks more a geronimo problem, being related to the web context.

Kevan Miller wrote:

On Sep 3, 2007, at 3:33 AM, Paolo Denti wrote:

Hi Kevan, Viet

i prepared a basic spring/hibernate application using jta on geronimo. it works.
then i tried to add all the components i am using in my "bad" application, one by one, and, finally, i found it:
it was very difficult because the problem happens under an incredible particular set of conditions in AND:
1) the most important: sitemesh is used to render pages
2) you deploy an ear (deploying just the war, it works always)
3) you use the tomcat version of geronimo (with the jetty version, it works always; i discovered it at the end of all tests !!)
4) the web app in the ear has the root context (in the sub contexts, it works always)

just commenting the sitemesh filter mapping in web.xml, everything works. if i apply sitemesh filter, i get
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper

 is not visible from class loader
i can make it available for everybody if needed.
otherwise, if you prefer, just try to modify Viet app. in this way:
1) add "sitemesh-2.3.jar" to WEB-INF/lib
2) add "decorators.xml" to WEB-INF
    <decorators defaultdir="/WEB-INF/decorators">
        <decorator name="default" page="default.jsp">
3) add "decorators" folder to WEB-INF
4) add default.jsp to decorators folder
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "" >
    <%@ taglib uri="" prefix="decorator" %>
    <%@ taglib uri="" prefix="page" %>
    <html xmlns="" xml:lang="en">
            <title><decorator:title />
(sitemesh decorated)</title>
            <decorator:body />
5) add sitemesh filter to web.xml
6) execute your web controller which users jta: you should get an exception

Paolo -- wow! Thanks a bunch for tracking down this detail. This is terrific.

Did you try either of the suggestions that Viet proposed?

On Aug 31, 2007, at 8:40 AM, Viet Nguyen wrote:
I found these two related jiras that I hope will fix your problem:

People have suggested two solutions:
1. switch to using Hibernate 3.2.0 (hibernate "solution")
2. set MBeanExporter's "exposeManagedResourceClassLoader" property to "true" (spring workaround)

On Sep 3, 2007, at 3:33 AM, Paolo Denti wrote:

p.s. about the hot deploy, i cannot hot deploy even my small test application

Geronimo Application Server started
00:54:24,935 ERROR [Deployer] Deployment failed due to
        at org.apache.geronimo.deployment.CopyResourceContext.addFile(
        at org.apache.geronimo.deployment.DeploymentContext.addFile(
        at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.installModule(
        at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder$$FastClassByCGLIB$$8523248f.invoke(<generated>)

Strange. I had no problem with my test ear... If you could make your test app available, that would be great.