I have written two little hello world applications using Grails (V2.0.0.RC1), and I want to deploy them using Glassfish (v3.1).
If I deploy it either one of the applications all by itself on Glassfish the application works just fine, and I can access it either at http://t1-0.1
or at http://t2-0.1
. If instead, however, I deploy one of the applications, and then deploy the other (so that both are available to people visiting my web site), then the second deployment command gives me the following error message:
c:>asadmin deploy t2-0.1.war
remote failure: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Errorcreating bean with name 'hibernateProperties': Cannot resolve reference to bean'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init methodfailed; nested exception is org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Database may be already in use: "Locked by another process". Possible solutions: closeall other connection(s); use the server mode; SQL statement:null/1349c415392c6dc06a3e7086cd1bb075c7881fc0650 [90020-147]). Please see server.log for more details.
What's going on here? I presume that there is something peculiar about Grails and its use of Hibernate (since otherwise Glassfish wouldn't complain about allowing me to have two applications that work together). But maybe I'm misreading the error message? Does anybody have any recommendations?