Erro ao dar grails -upgrade
22/09/2009 00:00
0
Olá pessoal, o meu netbeans disse que a minha aplicação precisava atualizar para hibernate 1.1.1
No entanto após fazer isso não deu certo ...
Deu esse erro...


Environment set to development
[groovyc] Compiling 1 source file to C:\Documents and Settings\rmoraes\.grails\1.1\projects\cvhweb\classes
[copy] Copying 1 file to C:\Documents and Settings\rmoraes\.grails\1.1\projects\cvhweb\classes
Running Grails application..
2009-09-22 09:16:14,078 [main] ERROR context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': 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': Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
at java.security.AccessController.doPrivileged(Native Method)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:145)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:269)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
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': Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
at java.security.AccessController.doPrivileged(Native Method)
... 21 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
at java.security.AccessController.doPrivileged(Native Method)
... 22 more
Caused by: java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
... 23 more
2009-09-22 09:16:14,312 [main] ERROR mortbay.log - Failed startup of context org.mortbay.jetty.webapp.WebAppContext@16ca3d5{/cvhweb,M:\VeilingNET\projeto\cvhweb/web-app}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': 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': Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
at java.security.AccessController.doPrivileged(Native Method)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:145)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:269)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
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': Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
at java.security.AccessController.doPrivileged(Native Method)
... 21 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
at java.security.AccessController.doPrivileged(Native Method)
... 22 more
Caused by: java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
... 23 more
2009-09-22 09:16:14,375 [main] ERROR mortbay.log - Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': 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': Invocation of init method failed; nested exception is java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType:
java.lang.ClassCastException: org.hibernate.type.StringType cannot be cast to org.hibernate.type.VersionType
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessController.doPrivileged(Native Method)
at grails.web.container.EmbeddableServer$start.call(Unknown Source)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy:145)
at _GrailsRun_groovy$_run_closure5_closure11.doCall(_GrailsRun_groovy)
at _GrailsSettings_groovy$_run_closure10.doCall(_GrailsSettings_groovy:269)
at _GrailsRun_groovy$_run_closure5.doCall(_GrailsRun_groovy:137)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:104)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:58)
at RunApp$_run_closure1.doCall(RunApp.groovy:33)
at gant.Gant$_dispatch_closure4.doCall(Gant.groovy:324)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy:334)
at gant.Gant$_dispatch_closure6.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:344)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:334)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.processTargets(Gant.groovy:495)
at gant.Gant.processTargets(Gant.groovy:480)
Server running. Browse to http://localhost:8080/cvhweb
Tags: Grails


0
Já tive este tipo de problema.

Execute o comando grails -clean e tente novamente.


0
Agora deu o error 404 no projeto... o que faço?
22/09/2009 00:00


0
Erro 404 ao executar grails -upgrade?


Se você estiver saindo do Grails 1.0 para o 1.1, isto pode acontecer, porque o arquivo index.gsp, que estava em /web-app foi movido para /grails-app/views

Verifique se o arquivo index.gsp está neste outro diretório.

Outro ponto a observar diz respeito ao arquivo /grails-app/conf/UrlMappings.groovy.

Verifique como ele mapeia o endereço "/".

Lembre-se, você pode customizar este arquivo se quiser, tal como fiz no exemplo abaixo:

class UrlMappings {
static mappings = {
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
"/"(controller:"entrada", action:"index")
"500"(view:'/error')
}
}


Como pode ver neste exemplo, eu fiz com que ao acessar a raiz da aplicação, fosse feito o redirecionamento para a action index do meu controlador entrada.

Provavelmente parte do seu problema estará ai.


0
Acho melhor eu começar do zero... como posso fazer a atualização do grails passo-a-passo...
22/09/2009 00:00


0
baixa a última versão e em seguida a instale em seu computador.


0
O meu arquivo UrlMapping está assim:

class UrlMappings {
static mappings = {
"/$controller/$action?/$id?"{
constraints {
// apply constraints here
}
}
"/"(view:"/index")
"500"(view:'/error')
}
}


e o arquivo index.gsp está na pasta grails-app/view/...
Qual o problema?
22/09/2009 00:00


0
O arquivo index.gsp está em /grails-app/views ?

se não estiver, este é o problema.


0
Então o arquivo está sim nessa pasta... o que está errado?
22/09/2009 00:00


0
É gerado algum stacktrace no servidor?


0
Agora fiz as alterações mas mesmo assim mostra o erro 503 ... pelo menos mudou o erro...
22/09/2009 00:00



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