Erro rodando aplicação dentro da IDE
21/09/2013 16:34
0
Pessoal,
Estou utilizando:
IDE: Groovy and grails ToolSuite
Grails: 2.2.0
Postgres

O estranho é que se eu rodar a aplicação por fora da IDE roda perfeitamente, mas pode dentro nada.
Vale lembrar que a versão grails do GRAILS_HOME internamente da IDE são a mesma.

Ao tentar iniciar minha aplicação, tenho a seguinte stacktrace:


SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
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: 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:hsqldb:file:prodDb;shutdown=true'
at java.lang.Thread.run(Thread.java:679)
Caused by: 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: 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:hsqldb:file:prodDb;shutdown=true'
... 1 more
Caused by: 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: 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:hsqldb:file:prodDb;shutdown=true'
... 1 more
Caused by: 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.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:hsqldb:file:prodDb;shutdown=true'
... 1 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': 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 create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:hsqldb:file:prodDb;shutdown=true'
... 1 more
Caused by: org.springframework.jdbc.support.MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:hsqldb:file:prodDb;shutdown=true'
... 1 more
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.postgresql.Driver' for connect URL 'jdbc:hsqldb:file:prodDb;shutdown=true'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
... 1 more
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:279)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
... 3 more
Tags: IDE Groovy and grails ToolSuite, No suitable driver


0
Você já verificou qual o path do jdk em uso?
Digo isso, por que esse erro me parece um bug presente na versão do jdk7 terminada em _25. Pode ser que o jdk do seu sistema seja um, e o path usado pela IDE seja outro.

Apanhei muito com problemas de jdk no ultimo mês.

[]'s
21/09/2013 18:39


0
Valeu a resposta,
Mas não é isso não... utilizo o JDK 6.
Sem contar que estou utilizando o mesmo JDK quando uso por fora da IDE e roda.
Ate pouco tempo atras a unica diferenca era o Grrovy que eu utilizava o 2.1 na IDE e 2.0 pelo terminal. Mesmo assim ja mudei para utilizar as mesmas .

Acreito que a questão seja em como eu discubro onde a IDE procura o jar do jdbc do postgre... devo ter que configurar isso internamente no eclipse sei la.... pois por fora do eclipse roda perfeitamente... o problema é que preciso debugar e por fora da IDE fica complicado...

Mais alguma idéia????? Agradeco
21/09/2013 19:52


0
Só coloando mais uma tentativa sem sucesso.
Achei isso aqui mas nada...


Do grails --refresh-dependencies compile one more time, and it will be good to go.

If the problem still persists, here's additional information to double checking:

Check if there's whitespace in your path. Grails does not work well if the path contains whitespace characters, especially on Windows.
Check your Grails installation, and make sure it's working for a simple app.
Check if your ivy cache (under ~/.grails/ or c:\<your home>\.grails) is healthy. If not, just delete it and Grails will recreate a new ivy cache for you.
If no. 1-3 couldn't help, delete ~/.grails or c:\<your home>\.grails to clean everything releated to Grails, and start over.
21/09/2013 22:13



Ainda não faz parte da comunidade???

Para se registrar, clique aqui.


Aprenda Groovy e Grails com a Formação itexto!

Newsletter Semana Groovy

Assinar

Envie seu link!


Livro de Grails


/dev/All

Os melhores blogs de TI (e em português) em um único lugar!

 
Creative Commons
RSS Grails Brasil é mantido por itexto Consultoria.
Em caso de problemas contacte Henrique Lobo Weissmann (Kico) por e-mail: kico@itexto.com.br
Todo o conteúdo presente neste site adota o Creative Commons como licença padrão.
Ver: 4.14.0
itexto