Re: Problem at geronimo boot
Hi Viet, sorry, i had to tell you: the hibernate properties are set for mysql inno db and it should work for every mysql version. if you want to test it with derby you should change the hibernate dialect in the hibernate.properties file Paolo 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). --Viet On 9/5/07, Paolo Denti [EMAIL PROTECTED] wrote: Hi Kevan, you can find the deployable ear here: http://www.mediafire.com/?8mdty2cu0mm and just the webapp with sources included here: http://www.mediafire.com/?d6ml6l1hgj4 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" 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 titledecorator:title / (sitemesh decorated)/title /head body decorator:body / /body /html 5) add sitemesh filter to web.xml filter filter-namesitemesh/filter-name filter-classcom.opensymphony.module.sitemesh.filter.PageFilter/filter-class init-param param-namedebug.pagewriter/param-name param-valuefalse/param-value /init-param /filter filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping 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: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2281 http://opensource.atlassian.com/projects/spring/browse/SPR-3571 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 java.lang.NullPointerException at
Re: Problem at geronimo boot
Hi Kevan, you can find the deployable ear here: http://www.mediafire.com/?8mdty2cu0mm and just the webapp with sources included here: http://www.mediafire.com/?d6ml6l1hgj4 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" 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 titledecorator:title / (sitemesh decorated)/title /head body decorator:body / /body /html 5) add sitemesh filter to web.xml filter filter-namesitemesh/filter-name filter-classcom.opensymphony.module.sitemesh.filter.PageFilter/filter-class init-param param-namedebug.pagewriter/param-name param-valuefalse/param-value /init-param /filter filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping 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: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2281 http://opensource.atlassian.com/projects/spring/browse/SPR-3571 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 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) Strange. I had no problem with my test ear... If you could make your test app available, that would be great. --kevan
Re: Problem at geronimo boot
Paolo, 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. --Viet 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 [EMAIL PROTECTED] 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). --Viet On 9/5/07, Paolo Denti [EMAIL PROTECTED] wrote: Hi Kevan, you can find the deployable ear here: http://www.mediafire.com/?8mdty2cu0mm and just the webapp with sources included here: http://www.mediafire.com/?d6ml6l1hgj4 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 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; http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd %@ taglib uri=http://www.opensymphony.com/sitemesh/decorator;http://www.opensymphony.com/sitemesh/decoratorprefix=decorator % %@ taglib uri=http://www.opensymphony.com/sitemesh/page;http://www.opensymphony.com/sitemesh/pageprefix=page % html xmlns=http://www.w3.org/1999/xhtml;http://www.w3.org/1999/xhtmlxml:lang=en head titledecorator:title / (sitemesh decorated)/title /head body decorator:body / /body /html 5) add sitemesh filter to web.xml filter filter-namesitemesh/filter-name filter-classcom.opensymphony.module.sitemesh.filter.PageFilter /filter-class init-param param-namedebug.pagewriter/param-name param-valuefalse/param-value /init-param /filter filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping 6) execute your web controller which users jta: you should
Re: Problem at geronimo boot
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 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 titledecorator:title / (sitemesh decorated)/title /head body decorator:body / /body /html 5) add sitemesh filter to web.xml filter filter-namesitemesh/filter-name filter- classcom.opensymphony.module.sitemesh.filter.PageFilter/filter- class init-param param-namedebug.pagewriter/param-name param-valuefalse/param-value /init-param /filter filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping 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: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2281 http://opensource.atlassian.com/projects/spring/browse/SPR-3571 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 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.installM odule(AbstractWebModuleBuilder.java:288) 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. --kevan
Re: Problem at geronimo boot
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 titledecorator:title / (sitemesh decorated)/title /head body decorator:body / /body /html 5) add sitemesh filter to web.xml filter filter-namesitemesh/filter-name filter-classcom.opensymphony.module.sitemesh.filter.PageFilter/filter-class init-param param-namedebug.pagewriter/param-name param-valuefalse/param-value /init-param /filter filter-mapping filter-namesitemesh/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
Re: Problem at geronimo boot
Hi kevan, sorry i could not answer before. No, the structure is the usual one EAR: META-INF/ War WEB-INF lib hibernate.jar spring.jar(s) Viet, may be that you are not really using the transaction manager of the container ? may be you are using just some queries in autocommit mode or read-only mode ? Paolo Kevan Miller wrote: On Aug 30, 2007, at 8:12 AM, Paolo Denti wrote: thanks Viet, i also tried with your version. now it deploys perfectly but i get the same problem i have with david version. interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader full stack is java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper is not visible from class loader java.lang.reflect.Proxy.getProxyClass(Proxy.java:353) java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581) org.hibernate.jdbc.BorrowedConnectionProxy.generateProxy(BorrowedConnectionProxy.java:67) org.hibernate.jdbc.ConnectionManager.borrowConnection(ConnectionManager.java:163) org.hibernate.jdbc.JDBCContext.borrowConnection(JDBCContext.java:111) org.hibernate.impl.SessionImpl.connection(SessionImpl.java:359) Hi Paolo, What's the layout of your ear? I'm guessing it's something like: EAR: META-INF/ hibernate.jar spring.jar(s) War1 War2 In Geronimo, each of your WARs will have a unique ClassLoader. >From your stack trace, It looks like somebody (your apps, spring, hibernate, or acegi) is attempting to share Hibernate interfaces between two different WAR classloaders (i.e. assuming that there is a single instance of Hibernate classes/interfaces). Moving your hibernate.jar file into the lib/ directory of your EAR may fix your problem (do not move the spring jars into lib). So, your ear layout would look like: EAR: META-INF/... lib/hibernate.jar spring.jar(s) War1.war War2.war Let us know how this works. It sounds like Viet has a basic hibernate app working. So, /me crosses fingers... --kevan
Re: Problem at geronimo boot
On Aug 31, 2007, at 7:16 AM, Paolo Denti wrote: Hi kevan, sorry i could not answer before. No, the structure is the usual one EAR: META-INF/ War WEB-INF lib hibernate.jar spring.jar(s) Hey Paolo, No problem... So, there's a single WAR? Well, Kevan's fancy theory is sinking quickly... :( Viet, may be that you are not really using the transaction manager of the container ? may be you are using just some queries in autocommit mode or read-only mode ? I'm pretty sure the app is using the TM. --kevan
Re: Problem at geronimo boot
Paolo, I found these two related jiras that I hope will fix your problem: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2281 http://opensource.atlassian.com/projects/spring/browse/SPR-3571 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 8/31/07, Kevan Miller [EMAIL PROTECTED] wrote: On Aug 31, 2007, at 7:16 AM, Paolo Denti wrote: Hi kevan, sorry i could not answer before. No, the structure is the usual one EAR: META-INF/ War WEB-INF lib hibernate.jar spring.jar(s) Hey Paolo, No problem... So, there's a single WAR? Well, Kevan's fancy theory is sinking quickly... :( Viet, may be that you are not really using the transaction manager of the container ? may be you are using just some queries in autocommit mode or read-only mode ? I'm pretty sure the app is using the TM. The sample app that I used to test the TM is using the container's TM to read and change the DB. If you would like to see it, we recently updated the wiki for Geronimo 2.0. It's here: http://cwiki.apache.org/GMOxDOC20/jboss-to-geronimo-hibernate-migration.html It will be great if you can try the suggested solutions. Regards, Viet --kevan
Re: Problem at geronimo boot
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.installM odule(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.installModu le(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
Re: Problem at geronimo boot
I'd recommend a slight change... AbstractNameQuery query = new AbstractNameQuery (TransactionManager.class.getName ()); SetAbstractName names = kernel.listGBeans(query); if (names.size() != 1) { throw new IllegalStateException(Expected one transaction manager, not + names.size()); } AbstractName name = names.iterator().next(); TransactionManager transMg = (TransactionManager) kernel.getGBean(name); return (TransactionManager)transMg; I don't think there's a good reason to use a proxy... thanks david jencks On Aug 29, 2007, at 7:02 PM, Viet Nguyen wrote: Well I try your code Kevan, and I altered it some to get this: package org.hibernate.transaction; import java.util.Iterator; import java.util.Properties; import java.util.Set; import javax.transaction.TransactionManager ; import org.hibernate.HibernateException; import org.hibernate.transaction.TransactionManagerLookup; import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.AbstractNameQuery; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.KernelRegistry; import org.apache.geronimo.kernel.proxy.ProxyManager; public class GeronimoTransactionManagerLookup implements TransactionManagerLookup { public static final String UserTransactionName = java:comp/ UserTransaction; public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { Kernel kernel = KernelRegistry.getSingleKernel(); ProxyManager proxyManager = kernel.getProxyManager(); AbstractNameQuery query = new AbstractNameQuery (TransactionManager.class.getName ()); Set names = kernel.listGBeans(query); AbstractName name = null; for (Iterator it = names.iterator(); it.hasNext();) name = (AbstractName) it.next(); Object transMg = (Object) proxyManager.createProxy(name, TransactionManager.class); return (TransactionManager)transMg; }catch (Exception e) { e.printStackTrace(); System.out.println(); throw new HibernateException(Geronimo Transaction Manager Lookup Failed, e); } } public String getUserTransactionName() { return UserTransactionName; } } I tested it out and everything works on geronimo-jetty6-jee5-2.0.1 So I hope you can test it out Paolos. Hope this works, Viet Nguyen
Re: Problem at geronimo boot
Hi David, Kevan first of all, thanks. now it deploys ! It looks that the transactionManager is correctly looked up but ... at the first usage of the TM i get this error 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 is it related with geronimo classloading issues ? Paolo David Jencks wrote: I'd recommend a slight change... AbstractNameQuery query = new AbstractNameQuery(TransactionManager.class.getName ()); SetAbstractName names = kernel.listGBeans(query); if (names.size() != 1) { throw new IllegalStateException("Expected one transaction manager, not " + names.size()); } AbstractName name = names.iterator().next(); TransactionManager transMg = (TransactionManager) kernel.getGBean(name); return (TransactionManager)transMg; I don't think there's a good reason to use a proxy... thanks david jencks On Aug 29, 2007, at 7:02 PM, Viet Nguyen wrote: Well I try your code Kevan, and I altered it some to get this: package org.hibernate.transaction; import java.util.Iterator; import java.util.Properties; import java.util.Set; import javax.transaction.TransactionManager ; import org.hibernate.HibernateException; import org.hibernate.transaction.TransactionManagerLookup; import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.AbstractNameQuery; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.KernelRegistry; import org.apache.geronimo.kernel.proxy.ProxyManager; public class GeronimoTransactionManagerLookup implements TransactionManagerLookup { public static final String UserTransactionName = "java:comp/UserTransaction"; public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { Kernel kernel = KernelRegistry.getSingleKernel(); ProxyManager proxyManager = kernel.getProxyManager(); AbstractNameQuery query = new AbstractNameQuery(TransactionManager.class.getName ()); Set names = kernel.listGBeans(query); AbstractName name = null; for (Iterator it = names.iterator(); it.hasNext();) name = (AbstractName) it.next(); Object transMg = (Object) proxyManager.createProxy(name, TransactionManager.class); return (TransactionManager)transMg; }catch (Exception e) { e.printStackTrace(); System.out.println(); throw new HibernateException("Geronimo Transaction Manager Lookup Failed", e); } } public String getUserTransactionName() { return UserTransactionName; } } I tested it out and everything works on geronimo-jetty6-jee5-2.0.1 So I hope you can test it out Paolos. Hope this works, Viet Nguyen
Re: Problem at geronimo boot
Kevan, i tried and following the execution, the problem is in the proxyManagerClass.getMethod("createProxy", clzArray); the getMethod call fails. But looking at the javadoc i see that the signature of the ProxyManager createProxy method is Object createProxy(javax.management.ObjectName, Class) but we are inovoking proxyManagerClass.getMethod("createProxy", clzArray) where clzArray is a Class[] as if the signature were Object createProxy(javax.management.ObjectName, Class[]) Kevan Miller wrote: On Aug 28, 2007, at 11:34 AM, Paolo Denti wrote: ok, thanks. therefore the problem "should" lie in how the transactionManager is looked up, that is the method getTransactionManager of the GeronimoTransactionManagerLookup class. Right. Paolo, at a minimum, I think you need to update your GeronimoTransactionManagerLookup class to contain the following setting of TransactionMgrGBeanName: public static final String TransactionMgrGBeanName="geronimo:J2EEServer=geronimo,ServiceModule=org.apache.geronimo.configs/transaction/2.0.1/car,j2eeType=TransactionManager,name=TransactionManager"; I don't have a working hibernate environment, at the moment. If you could try this new setting, it would be great... --kevan
Re: Problem at geronimo boot
the problem is java.lang.NoSuchMethodException: org.apache.geronimo.kernel.proxy.ProxyManager.createProxy(javax.management.ObjectName, java.lang.Class) ?? are the online javadocs correct for the 2.0.1 version ? Paolo Denti wrote: no, never mind ... too many tries and i wrote this "nonsense" stuff ... the clzArray is the parameter list of the createProxyMethod ... it is correct. anyway it fails on the proxyManagerClass.getMethod("createProxy", clzArray) call. Paolo Denti wrote: Kevan, i tried and following the execution, the problem is in the proxyManagerClass.getMethod("createProxy", clzArray); the getMethod call fails. But looking at the javadoc i see that the signature of the ProxyManager createProxy method is Object createProxy(javax.management.ObjectName, Class) but we are inovoking proxyManagerClass.getMethod("createProxy", clzArray) where clzArray is a Class[] as if the signature were Object createProxy(javax.management.ObjectName, Class[]) Kevan Miller wrote: On Aug 28, 2007, at 11:34 AM, Paolo Denti wrote: ok, thanks. therefore the problem "should" lie in how the transactionManager is looked up, that is the method getTransactionManager of the GeronimoTransactionManagerLookup class. Right. Paolo, at a minimum, I think you need to update your GeronimoTransactionManagerLookup class to contain the following setting of TransactionMgrGBeanName: public static final String TransactionMgrGBeanName="geronimo:J2EEServer=geronimo,ServiceModule=org.apache.geronimo.configs/transaction/2.0.1/car,j2eeType=TransactionManager,name=TransactionManager"; I don't have a working hibernate environment, at the moment. If you could try this new setting, it would be great... --kevan
Re: Problem at geronimo boot
On 8/29/07, Paolo Denti [EMAIL PROTECTED] wrote: Kevan, i tried and following the execution, the problem is in the proxyManagerClass.getMethod(createProxy, clzArray); the getMethod call fails. But looking at the javadoc i see that the signature of the ProxyManager createProxy method is Object *createProxy*(javax.management.ObjectName, Class) but we are inovoking proxyManagerClass.getMethod(createProxy, clzArray) where clzArray is a Class[] as if the signature were Object *createProxy*(javax.management.ObjectName, Class[]) Hi Paolo, the getMethod() takes 2 parameters: 1) the method name 2) the method parameter Classes in the form of Class[]. clzArray contains {ObjectName.class,Class.class} as the createProxy() signature is defined. I think you are confusing the createProxy() method with the getMethod() method that is part of java.lang.Class. *Method getMethodhttp://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html#getMethod%28java.lang.String,%20java.lang.Class%5B%5D%29 *(String http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html name, Class http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html [] parameterTypes). I will keep looking into why the getMethod error fails. Is there a stack trace or error message? -Viet
Re: Problem at geronimo boot
yes Viet, thanks. i saw it just while i was pushing "the send" button and i went immediately to get some strong coffee :-D i already sent the reason of the getMethod failure: the createProxy method has a different signature: public Object createProxy(AbstractName target, ClassLoader loader); public Object createProxy(AbstractName target, Class type); Paolo Viet Nguyen wrote: On 8/29/07, Paolo Denti [EMAIL PROTECTED] wrote: Kevan, i tried and following the execution, the problem is in the proxyManagerClass.getMethod("createProxy", clzArray); the getMethod call fails. But looking at the javadoc i see that the signature of the ProxyManager createProxy method is Object createProxy(javax.management.ObjectName, Class) but we are inovoking proxyManagerClass.getMethod("createProxy", clzArray) where clzArray is a Class[] as if the signature were Object createProxy(javax.management.ObjectName, Class[]) Hi Paolo, the getMethod() takes 2 parameters: 1) the method name 2) the method parameter Classes in the form of Class[]. clzArray contains {ObjectName.class,Class.class} as the createProxy() signature is defined. I think you are confusing the createProxy() method with the getMethod() method that is part of java.lang.Class. Method getMethod( Stringname, Class[]parameterTypes). I will keep looking into why the getMethod error fails. Is there a stack trace or error message? -Viet
Re: Problem at geronimo boot
On Aug 29, 2007, at 7:02 AM, Paolo Denti wrote: Ok Kevan, found. browsing through the sources i see the the ProxyManager interface has changed. the signature of the createProxy methods is the following public Object createProxy(AbstractName target, ClassLoader loader); public Object createProxy(AbstractName target, Class type); now i do not know exactly how to modify the GeronimoTransactionManagerLookup in order to use new ProxyManager. Doh... Sorry. Was right in front of my face... Perhaps we should start meeting for a second cup of coffee? ;-) What a pain all this reflection, is... The following compiles. I haven't tested. Dario or Viet, could you give it a spin? Note that the this doesn't contain a package name. You'll need to add one... I'd rather the example not use the org.hibernate namespace... javac CLASSPATH setup: export CLASSPATH=geronimo-tomcat6-jee5-2.0.1/lib/geronimo- kernel-2.0.1.jar:geronimo-tomcat6-jee5-2.0.1/repository/org/apache/ geronimo/specs/geronimo-jta_1.1_spec/1.1/geronimo- jta_1.1_spec-1.1.jar:hibernate-3.2/build/hibernate3.jar New source: import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.KernelRegistry; import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.AbstractNameQuery; import org.hibernate.HibernateException; import org.hibernate.transaction.TransactionManagerLookup; import java.util.Properties; import java.util.Set; import javax.transaction.TransactionManager; public class GeronimoTransactionManagerLookup implements TransactionManagerLookup { public static final String UserTransactionName = java:comp/ UserTransaction; public TransactionManager getTransactionManager(Properties props) throws HibernateException { Kernel kernel = KernelRegistry.getSingleKernel(); AbstractNameQuery tmQuery = new AbstractNameQuery(null, null, TransactionManager.class.getName()); Set tmSet = kernel.listGBeans(tmQuery); if (tmSet.size() != 1) { throw new HibernateException(Geronimo TransactionManager Lookup Failed. Too many GBean instances); } return (TransactionManager)tmSet.toArray()[0]; } public String getUserTransactionName() { return UserTransactionName; } } --kevan Paolo Denti wrote: the problem is java.lang.NoSuchMethodException: org.apache.geronimo.kernel.proxy.ProxyManager.createProxy (javax.management.ObjectName, java.lang.Class) ?? are the online javadocs correct for the 2.0.1 version ? Paolo Denti wrote: no, never mind ... too many tries and i wrote this nonsense stuff ... the clzArray is the parameter list of the createProxyMethod ... it is correct. anyway it fails on the proxyManagerClass.getMethod(createProxy, clzArray) call. Paolo Denti wrote: Kevan, i tried and following the execution, the problem is in the proxyManagerClass.getMethod(createProxy, clzArray); the getMethod call fails. But looking at the javadoc i see that the signature of the ProxyManager createProxy method is Object createProxy(javax.management.ObjectName, Class) but we are inovoking proxyManagerClass.getMethod(createProxy, clzArray) where clzArray is a Class[] as if the signature were Object createProxy(javax.management.ObjectName, Class[]) Kevan Miller wrote: On Aug 28, 2007, at 11:34 AM, Paolo Denti wrote: ok, thanks. therefore the problem should lie in how the transactionManager is looked up, that is the method getTransactionManager of the GeronimoTransactionManagerLookup class. Right. Paolo, at a minimum, I think you need to update your GeronimoTransactionManagerLookup class to contain the following setting of TransactionMgrGBeanName: public static final String TransactionMgrGBeanName=geronimo:J2EEServer=geronimo,ServiceModul e=org.apache.geronimo.configs/transaction/2.0.1/ car,j2eeType=TransactionManager,name=TransactionManager; I don't have a working hibernate environment, at the moment. If you could try this new setting, it would be great... --kevan
Re: Problem at geronimo boot
Well I try your code Kevan, and I altered it some to get this: package org.hibernate.transaction; import java.util.Iterator; import java.util.Properties; import java.util.Set; import javax.transaction.TransactionManager; import org.hibernate.HibernateException; import org.hibernate.transaction.TransactionManagerLookup; import org.apache.geronimo.gbean.AbstractName; import org.apache.geronimo.gbean.AbstractNameQuery; import org.apache.geronimo.kernel.Kernel; import org.apache.geronimo.kernel.KernelRegistry; import org.apache.geronimo.kernel.proxy.ProxyManager; public class GeronimoTransactionManagerLookup implements TransactionManagerLookup { public static final String UserTransactionName = java:comp/UserTransaction; public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { Kernel kernel = KernelRegistry.getSingleKernel(); ProxyManager proxyManager = kernel.getProxyManager(); AbstractNameQuery query = new AbstractNameQuery( TransactionManager.class.getName()); Set names = kernel.listGBeans(query); AbstractName name = null; for (Iterator it = names.iterator(); it.hasNext();) name = (AbstractName) it.next(); Object transMg = (Object) proxyManager.createProxy(name, TransactionManager.class); return (TransactionManager)transMg; }catch (Exception e) { e.printStackTrace(); System.out.println(); throw new HibernateException(Geronimo Transaction Manager Lookup Failed, e); } } public String getUserTransactionName() { return UserTransactionName; } } I tested it out and everything works on geronimo-jetty6-jee5-2.0.1 So I hope you can test it out Paolos. Hope this works, Viet Nguyen
Re: Problem at geronimo boot
On Aug 28, 2007, at 6:04 AM, Paolo Denti wrote: Hi Kevan, i was using spring 2.0.6 following your suggestions and david's, I downloaded the tomcat version and added dep:hidden-classes dep:filterorg.springframework./dep:filter dep:filterMETA-INF/spring/dep:filter /dep:hidden-classes to geronimo-web.xml but still the deploy does not work. now i stucked just a little bit forward. I saw that no org.hibernate.transaction.TransactionManagerLookup implementations exists for geronimo. I found here (http://cwiki.apache.org/GMOxDOC10/jboss-to-geronimo- hibernate-migration.html) an implementation (GeronimoTransactionManagerLookup) that i included in the package but it looks that it does not work. 10:32:23,124 ERROR [JTATransaction] Could not find UserTransaction in JNDI javax.naming.NameNotFoundException: UserTransaction at org.apache.xbean.naming.context.AbstractContext.lookup (AbstractContext.java:163) at org.apache.xbean.naming.context.AbstractContext.lookup (AbstractContext.java:597) at javax.naming.InitialContext.lookup(InitialContext.java:351) at org.hibernate.transaction.JTATransaction.init (JTATransaction.java:60) at org.hibernate.transaction.JTATransactionFactory.createTransaction (JTATransactionFactory.java:57) at org.hibernate.jdbc.JDBCContext.getTransaction (JDBCContext.java:193) at org.hibernate.impl.SessionImpl.getTransaction (SessionImpl.java:1315) at org.hibernate.impl.SessionImpl.beginTransaction (SessionImpl.java:1325) ... Nice work, Paolo. One note: the hidden-classes should not be strictly necessary running on Tomcat, but one can never be too careful... ;-) Looks like we need to update that example for 2.0... I'm not much of a hibernate expert. Give me a bit and will get UserTransaction lookup working for you... FYI, there is a J2G (JBoss to Geronimo) migration tool under development in Geronimo. IIUC, it wouldn't help in this case, but I could be wrong... BTW, did you configure the hibernate.transaction.manager_lookup_class in your hibernate configuration? In the meantime, ask Hibernate to add an Apache Geronimo lookup class... :-) Heh. Or better yet, start using JPA! ;-) Back soon... --kevan
Re: Problem at geronimo boot
Kevan, The j2g conversion tool does not currently create any hidden-classes entries in the descriptors. So in this instance, the tool would not prove of much use. We'll put it on the list ;) Thanks, -- Jason Warner On 8/28/07, Kevan Miller [EMAIL PROTECTED] wrote: On Aug 28, 2007, at 6:04 AM, Paolo Denti wrote: Hi Kevan, i was using spring 2.0.6 following your suggestions and david's, I downloaded the tomcat version and added dep:hidden-classes dep:filterorg.springframework./dep:filter dep:filterMETA-INF/spring/dep:filter /dep:hidden-classes to geronimo-web.xml but still the deploy does not work. now i stucked just a little bit forward. I saw that no org.hibernate.transaction.TransactionManagerLookupimplementations exists for geronimo. I found here ( http://cwiki.apache.org/GMOxDOC10/jboss-to-geronimo-hibernate-migration.html) an implementation (GeronimoTransactionManagerLookup) that i included in the package but it looks that it does not work. 10:32:23,124 ERROR [JTATransaction] Could not find UserTransaction in JNDI javax.naming.NameNotFoundException: UserTransaction at org.apache.xbean.naming.context.AbstractContext.lookup( AbstractContext.java:163) at org.apache.xbean.naming.context.AbstractContext.lookup( AbstractContext.java:597) at javax.naming.InitialContext.lookup(InitialContext.java:351) at org.hibernate.transaction.JTATransaction.init( JTATransaction.java:60) at org.hibernate.transaction.JTATransactionFactory.createTransaction( JTATransactionFactory.java:57) at org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java :193) at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java :1315) at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java :1325) ... Nice work, Paolo. One note: the hidden-classes should not be strictly necessary running on Tomcat, but one can never be too careful... ;-) Looks like we need to update that example for 2.0... I'm not much of a hibernate expert. Give me a bit and will get UserTransaction lookup working for you... FYI, there is a J2G (JBoss to Geronimo) migration tool under development in Geronimo. IIUC, it wouldn't help in this case, but I could be wrong... BTW, did you configure the hibernate.transaction.manager_lookup_class in your hibernate configuration? In the meantime, ask Hibernate to add an Apache Geronimo lookup class... :-) Heh. Or better yet, start using JPA! ;-) Back soon... --kevan
Re: Problem at geronimo boot
On 8/28/07, Kevan Miller [EMAIL PROTECTED] wrote: On Aug 28, 2007, at 8:59 AM, Jason Warner wrote: Kevan, The j2g conversion tool does not currently create any hidden- classes entries in the descriptors. So in this instance, the tool would not prove of much use. We'll put it on the list ;) I was wondering what kind of help J2G might provide for migrating Hibernate configurations, not the filtering. The Spring conflict is a temporary condition that will go away once our CXF configuration gets cleaned up... --kevan I knew I was going to make that mistake. The answer remains the same, though.
Re: Problem at geronimo boot
On Aug 28, 2007, at 8:59 AM, Jason Warner wrote: Kevan, The j2g conversion tool does not currently create any hidden- classes entries in the descriptors. So in this instance, the tool would not prove of much use. We'll put it on the list ;) I was wondering what kind of help J2G might provide for migrating Hibernate configurations, not the filtering. The Spring conflict is a temporary condition that will go away once our CXF configuration gets cleaned up... --kevan
Re: Problem at geronimo boot
On 8/28/07, Paolo Denti [EMAIL PROTECTED] wrote: thanks kevan, (about jpa ... too late, and too lazy, me, not hibernate :-) yes, i of course i modified the hibernate.transaction.manager_lookup_class, pointing to the class found on the wiki (which is not really perfect in the getMethod calls ...) so, i can work on it, trying to set up a correct lookup class for geronimo if you confirm me the the jndi name for the UserTransaction in geronimo is the usual java:comp/UserTransaction I just checked this in the JNDI Viewer. The jndi name you are using should be correct. the hibernate configuration is this spring config !-- datasource -- jee:jndi-lookup id=dataSource jndi-name=jdbc/myappDS resource-ref=true / !-- Hibernate configuration -- bean id=hibernateTemplate class= org.springframework.orm.hibernate3.HibernateTemplate property name=sessionFactory ref=sessionFactory/ /bean bean id=sessionFactory class= org.springframework.orm.hibernate3.LocalSessionFactoryBean property name=dataSource ref=dataSource/ property name=hibernateProperties bean class= org.springframework.beans.factory.config.PropertiesFactoryBean property name=location value=classpath:com/myapp/data/hibernate.properties/ /bean /property property name=mappingDirectoryLocations list valueclasspath:com/myapp/data/dao/hibernate/value /list /property property name=eventListeners map entry key=merge bean class= org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener / /entry /map /property /bean hibernate.properties hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect hibernate.current_session_context_class=jta hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory hibernate.transaction.manager_lookup_class=org.hibernate.transaction.GeronimoTransactionManagerLookup hibernate.cache.use_second_level_cache=false hibernate.cache.use_query_cache=false hibernate.show_sql=true hibernate.hbm2ddl.auto=update as you can see, the datasource is looked up in jndi (it has been imported from jboss and it looks ok) and configured in geronimo-web-xml together with javamail === dep:dependencies dependency groupIdconsole.dbpool/groupId artifactIdmyappDS/artifactId version1.0/version typerar/type /dependency dependency groupIdorg.apache.geronimo.configs/groupId artifactIdjavamail/artifactId version2.0.1/version typecar/type /dependency /dep:dependencies resource-ref ref-namejdbc/myappDS/ref-name resource-linkmyappDS/resource-link /resource-ref resource-ref ref-namemail/DefaultMail/ref-name resource-linkmail/MailSession/resource-link /resource-ref and this is the updated version of the GeronimoTransactionManagerLookup class (with some modifications ...) === package org.hibernate.transaction; import java.util.Properties; import javax.management.ObjectName; import javax.transaction.TransactionManager; import org.hibernate.HibernateException; import org.hibernate.transaction.TransactionManagerLookup; public class GeronimoTransactionManagerLookup implements TransactionManagerLookup { public static final String TransactionMgrGBeanName= geronimo.server:J2EEApplication=null ,J2EEModule=geronimo/j2ee-server/2.0.1/car,J2EEServer=geronimo,j2eeType=TransactionManager,name=TransactionManager; public static final String UserTransactionName = java:comp/UserTransaction; public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { Class kernelClass = Class.forName( org.apache.geronimo.kernel.Kernel); Class kernelRegistryClass = Class.forName( org.apache.geronimo.kernel.KernelRegistry); Class proxyManagerClass = Class.forName( org.apache.geronimo.kernel.proxy.ProxyManager); ObjectName TransactionManagerName = new ObjectName(TransactionMgrGBeanName); Object kernel = kernelRegistryClass.getMethod(getSingleKernel, new Class[] {}).invoke(null, new Object[] {}); Object proxyManager = kernelClass.getMethod(getProxyManager,new Class[] {}).invoke(kernel,new Object[] {}); Class[] clzArray = {ObjectName.class,Class.class}; Object[] objArray = {TransactionManagerName, TransactionManager.class}; return (TransactionManager)proxyManagerClass.getMethod(createProxy,clzArray). invoke(proxyManager, objArray); }catch (Exception e) { throw new HibernateException(Geronimo Transaction Manager Lookup Failed, e); } } public String getUserTransactionName() { return UserTransactionName; } }
Re: Problem at geronimo boot
ok, thanks. therefore the problem "should" lie in how the transactionManager is looked up, that is the method getTransactionManager of the GeronimoTransactionManagerLookup class. Viet Nguyen wrote: On 8/28/07, Paolo Denti [EMAIL PROTECTED] wrote: thanks kevan, (about jpa ... too late, and too "lazy", me, not hibernate :-) yes, i of course i modified the hibernate.transaction.manager_lookup_class, pointing to the class found on the wiki (which is not really perfect in the getMethod calls ...) so, i can work on it, trying to set up a correct lookup class for geronimo if you confirm me the the jndi name for the UserTransaction in geronimo is the usual "java:comp/UserTransaction" I just checked this in the JNDI Viewer. The jndi name you are using should be correct. the hibernate configuration is this spring config !-- datasource -- jee:jndi-lookup id="dataSource" jndi-name="jdbc/myappDS" resource-ref="true" / !-- Hibernate configuration -- bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate" property name="sessionFactory" ref="sessionFactory"/ /bean bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" property name="dataSource" ref="dataSource"/ property name="hibernateProperties" bean class="org.springframework.beans.factory.config.PropertiesFactoryBean" property name="location" value="classpath:com/myapp/data/hibernate.properties"/ /bean /property property name="mappingDirectoryLocations" list valueclasspath:com/myapp/data/dao/hibernate/value /list /property property name="eventListeners" map entry key="merge" bean class="org.springframework.orm.hibernate3.support.IdTransferringMergeEventListener"/ /entry /map /property /bean hibernate.properties hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect hibernate.current_session_context_class=jta hibernate.transaction.factory_class=org.hibernate.transaction.JTATransactionFactory hibernate.transaction.manager_lookup_class=org.hibernate.transaction.GeronimoTransactionManagerLookup hibernate.cache.use_second_level_cache=false hibernate.cache.use_query_cache=false hibernate.show_sql=true hibernate.hbm2ddl.auto=update as you can see, the datasource is looked up in jndi (it has been imported from jboss and it looks ok) and configured in geronimo-web-xml together with javamail === dep:dependencies dependency groupIdconsole.dbpool/groupId artifactIdmyappDS/artifactId version1.0/version typerar/type /dependency dependency groupIdorg.apache.geronimo.configs/groupId artifactIdjavamail/artifactId version2.0.1/version typecar/type /dependency /dep:dependencies resource-ref ref-namejdbc/myappDS/ref-name resource-linkmyappDS/resource-link /resource-ref resource-ref ref-namemail/DefaultMail/ref-name resource-linkmail/MailSession/resource-link /resource-ref and this is the updated version of the GeronimoTransactionManagerLookup class (with some modifications ...) === package org.hibernate.transaction; import java.util.Properties; import javax.management.ObjectName; import javax.transaction.TransactionManager; import org.hibernate.HibernateException; import org.hibernate.transaction.TransactionManagerLookup; public class GeronimoTransactionManagerLookup implements TransactionManagerLookup { public static final String TransactionMgrGBeanName="geronimo.server:J2EEApplication=null,J2EEModule=geronimo/j2ee-server/2.0.1/car,J2EEServer=geronimo,j2eeType=TransactionManager,name=TransactionManager"; public static final String UserTransactionName = "java:comp/UserTransaction"; public TransactionManager getTransactionManager(Properties props) throws HibernateException { try { Class kernelClass = Class.forName("org.apache.geronimo.kernel.Kernel"); Class kernelRegistryClass = Class.forName("org.apache.geronimo.kernel.KernelRegistry"); Class proxyManagerClass = Class.forName("org.apache.geronimo.kernel.proxy.ProxyManager"); ObjectName TransactionManagerName = new ObjectName(TransactionMgrGBeanName); Object kernel = kernelRegistryClass.getMethod("getSingleKernel", new Class[] {}).invoke(null, new Object[] {}); Object proxyManager = kernelClass.getMethod("getProxyManager",new Class[] {}).invoke(kernel,new Object[] {}); Class[] clzArray = {ObjectName.class,Class.class}; Object[] objArray = {TransactionManagerName, TransactionManager.class}; return (TransactionManager)proxyManagerClass.getMethod("createProxy",clzArray). invoke(proxyManager, objArray); }catch (Exception e) { throw new HibernateException("Geronimo Transaction Manager Lookup Failed", e); } } public String getUserTransactionName() { return UserTransactionName; } } Kevan Miller wrote: On Aug 28, 2007, at 6:04 AM, Paolo Denti wrote:
Re: Problem at geronimo boot
On Aug 28, 2007, at 11:34 AM, Paolo Denti wrote: ok, thanks. therefore the problem should lie in how the transactionManager is looked up, that is the method getTransactionManager of the GeronimoTransactionManagerLookup class. Right. Paolo, at a minimum, I think you need to update your GeronimoTransactionManagerLookup class to contain the following setting of TransactionMgrGBeanName: public static final String TransactionMgrGBeanName=geronimo:J2EEServer=geronimo,ServiceModule=org. apache.geronimo.configs/transaction/2.0.1/ car,j2eeType=TransactionManager,name=TransactionManager; I don't have a working hibernate environment, at the moment. If you could try this new setting, it would be great... --kevan
Re: Problem at geronimo boot
can you post a sample app that results in this error when deployed? Vamsi On 8/28/07, Paolo Denti [EMAIL PROTECTED] 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) 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.EARConfigBuilder.buildConfiguration( EARConfigBuilder.java:567) at org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLIB$$38e56ec6.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.CorbaGBeanNameSource$$EnhancerByCGLIB$$41e10347.buildConfiguration (generated) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java :304) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java :126) at org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.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:865) at org.apache.geronimo.kernel.basic.BasicKernel.invoke( BasicKernel.java:239) at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy (AbstractDeployCommand.java:116) at
Re: Problem at geronimo boot
On Aug 27, 2007, at 2: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.installM odule(AbstractWebModuleBuilder.java:288) at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder$ $FastClassByCGLIB$$8523248f.invoke(generated) Poking around in the code a little bit it looks to me as if the only way this could happen is if there is a WEB-INF/web.xml in the war but it can't be read into a string. Could you check the structure of your war files and make sure the WEB-INF/web.xml are really files and not directories and they can be accessed properly (e.g. by unjarring them and looking at them in an editor, or looking at them in emacs) thanks david jencks
Re: Problem at geronimo boot
Yes, it is a file. anyway the application is working on jboss this is the web.xml ?xml version="1.0" encoding="UTF-8"? web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/applicationContext*.xml/param-value /context-param servlet servlet-nameMyAppweb/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class load-on-startup1/load-on-startup /servlet listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener listener listener-classorg.springframework.web.context.request.RequestContextListener/listener-class /listener servlet-mapping servlet-nameMyAppweb/servlet-name url-pattern*.htm/url-pattern /servlet-mapping filter filter-nameAcegi Filter Chain Proxy/filter-name filter-classorg.acegisecurity.util.FilterToBeanProxy/filter-class init-param param-nametargetClass/param-name param-valueorg.acegisecurity.util.FilterChainProxy/param-value /init-param /filter filter filter-namesitemesh/filter-name filter-classcom.opensymphony.module.sitemesh.filter.PageFilter/filter-class init-param param-namedebug.pagewriter/param-name param-valuetrue/param-value /init-param /filter filter-mapping filter-nameAcegi Filter Chain Proxy/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping resource-ref descriptiondatasource/description res-ref-namejdbc/MyAppDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref resource-ref descriptiondatasource/description res-ref-namemail/DefaultMail/res-ref-name res-typejavax.mail.Session/res-type res-authContainer/res-auth /resource-ref /web-app David Jencks wrote: On Aug 27, 2007, at 2: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) Poking around in the code a little bit it looks to me as if the only way this could happen is if there is a WEB-INF/web.xml in the war but it can't be read into a string. Could you check the structure of your war files and make sure the WEB-INF/web.xml are really files and not directories and they can be accessed properly (e.g. by unjarring them and looking at them in an editor, or looking at them in emacs) thanks david jencks
Re: Problem at geronimo boot
no, the application is too big and, at the moment, i cannot isolate the problem. Vamsavardhana Reddy wrote: can you post a sample app that results in this error when deployed? Vamsi On 8/28/07, Paolo Denti [EMAIL PROTECTED] 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) 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.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:567) at org.apache.geronimo.j2ee.deployment.EARConfigBuilder$$FastClassByCGLIB$$38e56ec6.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.CorbaGBeanNameSource$$EnhancerByCGLIB$$41e10347.buildConfiguration(generated) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:304) at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:126) at org.apache.geronimo.deployment.Deployer$$FastClassByCGLIB$$734a235d.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:865) at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:239) at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116) at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61) at java.lang.Thread.run(Thread.java:613) 23:16:07,311 ERROR [DirectoryHotDeployer] Unable to deploy: java.lang.NullPointerException org.apache.geronimo.common.DeploymentException: java.lang.NullPointerException at
Re: Problem at geronimo boot
kevan, if it can help, these are my descriptors web.xml == ?xml version="1.0" encoding="UTF-8"? web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" context-param param-namecontextConfigLocation/param-name param-value/WEB-INF/applicationContext*.xml/param-value /context-param servlet servlet-namemyappweb/servlet-name servlet-classorg.springframework.web.servlet.DispatcherServlet/servlet-class load-on-startup1/load-on-startup /servlet listener listener-classorg.springframework.web.context.ContextLoaderListener/listener-class /listener listener listener-classorg.springframework.web.context.request.RequestContextListener/listener-class /listener servlet-mapping servlet-namemyappweb/servlet-name url-pattern*.htm/url-pattern /servlet-mapping filter filter-nameAcegi Filter Chain Proxy/filter-name filter-classorg.acegisecurity.util.FilterToBeanProxy/filter-class init-param param-nametargetClass/param-name param-valueorg.acegisecurity.util.FilterChainProxy/param-value /init-param /filter filter filter-namesitemesh/filter-name filter-classcom.opensymphony.module.sitemesh.filter.PageFilter/filter-class init-param param-namedebug.pagewriter/param-name param-valuetrue/param-value /init-param /filter filter-mapping filter-nameAcegi Filter Chain Proxy/filter-name url-pattern/*/url-pattern /filter-mapping filter-mapping filter-namesitemesh/filter-name url-pattern/*/url-pattern /filter-mapping resource-ref res-ref-namejdbc/myappDS/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref resource-ref res-ref-namemail/DefaultMail/res-ref-name res-typejavax.mail.Session/res-type res-authContainer/res-auth res-sharing-scopeShareable/res-sharing-scope /resource-ref /web-app geronimo-web.xml (don't know if it is correct ...) === web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1" dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1" dep:moduleId dep:groupIdcom.myapp/dep:groupId dep:artifactIdmyapp/dep:artifactId dep:version10/dep:version dep:typecar/dep:type /dep:moduleId dep:dependencies dependency groupIdconsole.dbpool/groupId artifactIdmyappDS/artifactId version1.0/version typerar/type /dependency dependency groupIdorg.apache.geronimo.configs/groupId artifactIdjavamail/artifactId version2.0.1/version typecar/type /dependency /dep:dependencies dep:hidden-classes/ dep:non-overridable-classes/ /dep:environment context-root//context-root resource-ref ref-namejdbc/myappDS/ref-name resource-linkmyappDS/resource-link /resource-ref resource-ref ref-namemail/DefaultMail/ref-name resource-linkmail/MailSession/resource-link /resource-ref /web-app jboss-web.xml jboss-web resource-ref res-ref-namejdbc/myappDS/res-ref-name res-typejavax.sql.DataSource/res-type jndi-namejava:/myappDS/jndi-name /resource-ref resource-ref res-ref-namemail/DefaultMail/res-ref-name res-typejavax.mail.Session/res-type jndi-namejava:/Mail/jndi-name /resource-ref /jboss-web 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 Hi Paolo, Welcome... :-) Thanks for the info. Rather than using the hot deploy directory, could you try to deploy your ear using the deploy command? Remove your EAR fromgeronimo-jetty6-jee5-2.0.1/deploy/ Start the server (e.g.geronimo-jetty6-jee5-2.0.1/bin/geronimo.sh run) Then, in a separate term window deploy your app using the following: geronimo-jetty6-jee5-2.0.1/bin/deploy.sh your-ear-file If this fails in the same way, then we'll need to dig a little further... Well, we'll need to dig a bit further, regardless, to understand why the hot-deploy directory isn't working... --kevan thanks Paolo Geronimo Application Server started 23:16:07,293 ERROR [Deployer] Deployment failed due to java.lang.NullPointerException at
Re: Problem at geronimo boot
Are you including spring and acegi in your ear? If so, which versions? Geronimo includes 2.0.5 and if you are using a different version that may cause conflicts. You could try including dep:hidden-classes dep:filterorg.springframework./dep:filter /dep:hidden-classes in your geronimo-web.xml plan and perhaps also in geronimo- application.xml. Is your ear a single jar file or is it exploded (unpacked)? If it's unpacked maybe it is not all copied in place before the hot deployer starts trying to deploy it?? Hope this results in at least different behavior :-) thanks david jencks On Aug 27, 2007, at 4:49 PM, Paolo Denti wrote: Kevan, thanks for the welcome. - first of all, there is definitely a problem with the hot deploy 01:38:30,491 ERROR [DirectoryMonitor] Unable to scan file / Applications/geronimo-jetty6-jee5-2.0.1/deploy/lautizieEar.ear during initialization java.lang.NullPointerException at org.apache.geronimo.deployment.hot.DirectoryHotDeployer.getDeploymentT ime(DirectoryHotDeployer.java:237) at org.apache.geronimo.deployment.hot.DirectoryMonitor.initialize (DirectoryMonitor.java:240) at org.apache.geronimo.deployment.hot.DirectoryMonitor.run (DirectoryMonitor.java:213) at java.lang.Thread.run(Thread.java:613) 01:38:36,340 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.installM odule(AbstractWebModuleBuilder.java:288) ... - second, even with standard deploy, as you suggested, there is another problem. it looks related to my application but i think it is related to some classloader issue this is the stacktrace given by the deploy.sh org.apache.geronimo.kernel.config.LifecycleException: start of default/myappEar/1188257714796/car failed at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConf iguration(SimpleConfigurationManager.java:547) at org.apache.geronimo.kernel.config.SimpleConfigurationManager.startConf iguration(SimpleConfigurationManager.java:511) at org.apache.geronimo.kernel.config.SimpleConfigurationManager$ $FastClassByCGLIB$$ce77a924.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:865) at org.apache.geronimo.kernel.basic.BasicKernel.invoke (BasicKernel.java:239) at org.apache.geronimo.kernel.KernelGBean.invoke (KernelGBean.java:342) at org.apache.geronimo.kernel.KernelGBean$$FastClassByCGLIB$ $1cccefc9.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:865) at org.apache.geronimo.kernel.basic.BasicKernel.invoke (BasicKernel.java:239) at org.apache.geronimo.system.jmx.MBeanGBeanBridge.invoke (MBeanGBeanBridge.java:168) at com.sun.jmx.mbeanserver.DynamicMetaDataImpl.invoke (DynamicMetaDataImpl.java:213) at com.sun.jmx.mbeanserver.MetaDataImpl.invoke (MetaDataImpl.java:220) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke (DefaultMBeanServerInterceptor.java:815) at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke (JmxMBeanServer.java:784) at javax.management.remote.rmi.RMIConnectionImpl.doOperation (RMIConnectionImpl.java:1408) at javax.management.remote.rmi.RMIConnectionImpl.access$100 (RMIConnectionImpl.java:81) at javax.management.remote.rmi.RMIConnectionImpl $PrivilegedOperation.run(RMIConnectionImpl.java:1245) at java.security.AccessController.doPrivileged(Native Method) at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation (RMIConnectionImpl.java:1348) at javax.management.remote.rmi.RMIConnectionImpl.invoke (RMIConnectionImpl.java:782) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at sun.rmi.server.UnicastServerRef.dispatch
Re: Problem at geronimo boot
Hi Paolo, As David mentions, you're running into a Spring version conflict. This is a problem that we've discovered in our geronimo-jetty6- jee5-2.0.1 assembly. We're currently working on fixing the problem in our 2.0.2 release. There are multiple work-arounds for the problem. I've summarized 4 below. On Aug 27, 2007, at 8:37 PM, David Jencks wrote: Are you including spring and acegi in your ear? If so, which versions? Geronimo includes 2.0.5 and if you are using a different version that may cause conflicts. Actually, Geronimo includes Spring 2.0.4. You could try including dep:hidden-classes dep:filterorg.springframework./dep:filter /dep:hidden-classes I'd recommend filtering spring resources as well. Namely: dep:hidden-classes dep:filterorg.springframework./dep:filter dep:filterMETA-INF/spring/dep:filter /dep:hidden-classes in your geronimo-web.xml plan and perhaps also in geronimo- application.xml. Is your ear a single jar file or is it exploded (unpacked)? If it's unpacked maybe it is not all copied in place before the hot deployer starts trying to deploy it?? I believe that Paolo is starting the server with the EAR in the deploy directory. So, I don't think unpacking is an issue. Hope this results in at least different behavior :-) I think you have the following options to work around this issue: 1. Repackage your EAR to include Spring 2.0.4, or 2. Reconfigure your Jetty assembly to use Axis2 as the Web Services provider (this will avoid the conflicting Spring version), or 3. Download the Geronimo Tomcat assembly (http://www.apache.org/dyn/ closer.cgi/geronimo/2.0.1/geronimo-tomcat6-jee5-2.0.1-bin.tar.gz) and use that instead, or 4. Use a Geronimo deployment plan and filter Spring classes/resources (as described above). I think #3 is perhaps your simplest solution, but if you want to be use Jetty/CXF, we can get you up and running... It sounded like your started down this path from your description on TSS. As I mentioned there, you should ignore a Restricted listeners property file not found log message in the console... Regarding hot deploy -- I'll get a test EAR put together and perform some hot-deploy testing... Most of our users use the deploy command or Eclipse plug-in for deployment. Would be useful to know if you are you placing the EAR into the deploy directory as a packed file or in an unpacked format? --kevan