Grails > Grails ORM (GORM) : エラー編

更新日 2014-12-06
広告

Cannot load JDBC driver classエラー

MySQL以外のデータベースを使う場合は、BuildConfig.groovyに設定を追加する必要があります。設定を行わずにGrailsを起動すると、以下のようなエラーが発生します。
Message: 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 'lobHandlerDetector' while setting bean 
property 'lobHandler'; nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested
 exception is org.springframework.jdbc.support.MetaDataAccessException: Error while 
extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException:
 Cannot load JDBC driver class 'org.postgresql.Driver'

no signature of method エラー

以下のコマンドでGroovyConsoleを起動し、saveメソッドやgetメソッドを実行したときに、no signature of methodというエラーが表示される場合があります。
grails> console
no signature of method
というエラーが表示される場合、Hibernateなどのライブラリを正しくロードできていないことが原因です。以下のコマンドでGroovyConsoleを起動し、試してみましょう。
$ grails console

Cannot laod JDBC driver class エラー

GroovyConsoleの起動時に、以下のようなエラーが出る場合があります。
grails> console
 Cannot load JDBC driver class 'com.mysql.jdbc.Driver' (Use --stacktrace to see the full trace)
この場合、一度 grails clean を実行してみると、GroovyConsoleが正しく起動する場合があります。
広告
お問い合わせは sweng.tips@gmail.com まで。
inserted by FC2 system