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">
            <pattern>/*</pattern>
        </decorator>
    </decorators>
3) add "decorators" folder to WEB-INF
4) add default.jsp to decorators folder
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
    <%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <head>
            <title><decorator:title />
(sitemesh decorated)</title>
        </head>
        <body>
            <decorator:body />
        </body>
    </html>
5) add sitemesh filter to web.xml
    <filter>
        <filter-name>sitemesh</filter-name>
        <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
        <init-param>
            <param-name>debug.pagewriter</param-name>
            <param-value>false</param-value>
        </init-param>
    </filter>
....
    <filter-mapping>
        <filter-name>sitemesh</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
6) execute your web controller which users jta: you should get an exception

Paolo

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
java.lang.NullPointerException
        at org.apache.geronimo.deployment.CopyResourceContext.addFile(CopyResourceContext.java:144)
        at org.apache.geronimo.deployment.DeploymentContext.addFile(DeploymentContext.java:461)
        at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.installModule(AbstractWebModuleBuilder.java:288)
        at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder$$FastClassByCGLIB$$8523248f.invoke(<generated>)


Kevan Miller wrote:

On Aug 27, 2007, at 5:47 PM, Paolo Denti wrote:

Hi, i am a brand new geronimo user (or at least i am trying to be)
I am trying to deploy already existing applications (EARs), already working on jboss, without any particular deployment descriptior, on geronimo.
I always get NPEs at geronimo startup. below you can find the stacktrace.
it happens if i deploy with geronimo running or if i deploy with geronimo stopped and then start geronimo.

environment is
- geronimo 2.0.1 with jetty
- os x 10.4.10
- jdk 1.5.0_07
- JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

thanks
Paolo

Geronimo Application Server started
23:16:07,293 ERROR [Deployer] Deployment failed due to
java.lang.NullPointerException
        at org.apache.geronimo.deployment.CopyResourceContext.addFile(CopyResourceContext.java:144)
        at org.apache.geronimo.deployment.DeploymentContext.addFile(DeploymentContext.java:461)
        at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.installModule(AbstractWebModuleBuilder.java:288)
        at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder$$FastClassByCGLIB$$8523248f.invoke(<generated>)
        at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
        at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
        at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
        at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:830)
        at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
        at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
        at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
        at org.apache.geronimo.j2ee.deployment.ModuleBuilder$$EnhancerByCGLIB$$ab38932.installModule(<generated>)
        at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.installModule(SwitchingModuleBuilder.java:153)
        at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder$$FastClassByCGLIB$$d0c31844.invoke(<generated>)
    

Hi Paolo,
Backing up to your original problem, I've run some hot-deploy tests (deploying an EAR with WARS, etc), and didn't see a problem. If you can make your app available, I'm sure somebody would take a look at it. 

Alternatively, you can debug the createModule() method in either the Tomcat or Jetty ModuleBuilders:

modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java or
modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java

The builder should be setting specDD to contain the entire contents of the deployment descriptor. It seems that we aren't finding that file. Since your manual deploy is working, it seems that the DD must exist and be in the right place. Perhaps some error is occurring during the hot deployment process...

--kevan
 


Reply via email to