J
janvesely
Guest
Hi Everyone,
First of all, I am new to Grails and new to Linux. I did try to follow all the manuals/instructions as specified but failed to get a webapp up&running.
My computer:
Ubuntu: 13.10 (the latest)
Java: java version "1.7.0_25", OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3), OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
Ok, GRAILS installation
1. I followed Ubuntu specific instructions as specified here: http://grails.org/download/ubuntu
... and failed in step 3: sudo apt-get install grails-ppa
E: Unable to locate package grails-ppa
2. I tried to install Grails using gvm and managed to get latest Grails on my machine.
3. create-app and create-controller worked, I used the very simple example
4. When I attempted to run the application using run-app, all hell broke loose about hibernateProperties (cannot resolve reference to bean) and some other fine stacktraces.
Different approach
1. I installed Grails Tool Suite from Springsource
2. The GTS comes with Grails 2.24
3. I created a new app and new controller, added the same "high-tech" code for hallo world as above
4. I selected "Run as->Grails command: run-app"
....and got flooded with stracktrace about hibernate properties and hibernate dialect (full stacktrace below).
Ok, I know Java, JEE and Hibernate. In the book I read about Grails (unless I am wrong) the author wrote that development environment just uses in memory database by default and all should work out of the box. However, when I look at the stacktrace, it does seem as if some configuration is needed. As a noob, my question is - what needs to be configured where?
First of all, I am new to Grails and new to Linux. I did try to follow all the manuals/instructions as specified but failed to get a webapp up&running.
My computer:
Ubuntu: 13.10 (the latest)
Java: java version "1.7.0_25", OpenJDK Runtime Environment (IcedTea 2.3.12) (7u25-2.3.12-4ubuntu3), OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
Ok, GRAILS installation
1. I followed Ubuntu specific instructions as specified here: http://grails.org/download/ubuntu
... and failed in step 3: sudo apt-get install grails-ppa
E: Unable to locate package grails-ppa
2. I tried to install Grails using gvm and managed to get latest Grails on my machine.
3. create-app and create-controller worked, I used the very simple example
Code:
def index() {
render "Hi"
}
Different approach
1. I installed Grails Tool Suite from Springsource
2. The GTS comes with Grails 2.24
3. I created a new app and new controller, added the same "high-tech" code for hallo world as above
4. I selected "Run as->Grails command: run-app"
....and got flooded with stracktrace about hibernate properties and hibernate dialect (full stacktrace below).
Ok, I know Java, JEE and Hibernate. In the book I read about Grails (unless I am wrong) the author wrote that development environment just uses in memory database by default and all should work out of the box. However, when I look at the stacktrace, it does seem as if some configuration is needed. As a noob, my question is - what needs to be configured where?
Code:
Caused by 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: Error creating 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 method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating 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 method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread
Caused by CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [H2]!
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 724 | run . . . in java.lang.Thread