2017-03-05 17 views
0

Grailを学習していますが、以下のコードを作成しようとしましたが、2つのクラスを参照してアプリケーションを起動できませんでした。また、私はここで車両クラスに整数としてGrailアプリケーションを起動できません

Running application... 
2017-03-05 08:48:32.229 ERROR --- [ost-startStop-1] o.s.b.c.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'grailsCacheFilter': Cannot create inner bean '(inner bean)#692e68e0' of type [grails.plugin.cache.web.filter.simple.MemoryPageFragmentCachingFilter] while setting bean property 'filter'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name '(inner bean)#692e68e0': Unsatisfied dependency expressed through method 'setUrlMappingsHandlerMapping' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'urlMappingsHandlerMapping': Unsatisfied dependency expressed through method 'setWebRequestInterceptors' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openSessionInViewInterceptor': Cannot resolve reference to bean 'hibernateDatastore' while setting bean property 'hibernateDatastore'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateDatastore': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.grails.orm.hibernate.HibernateDatastore]: Constructor threw exception; nested exception is org.hibernate.MappingException: 
**Could not determine type for: groovy.lang.Binding, at table: vhicle, for columns: [org.hibernate.mapping.Column(binding)]** 
2017-03-05 08:48:32.392 ERROR --- [   main] o.s.boot.SpringApplication    : Application startup failed 

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat 
     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:137) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536) 
     at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) 
org.springframework.boot.SpringApplication.run(SpringApplication.java:315) 
     at grails.boot.GrailsApp.run(GrailsApp.groovy:83) 
     at grails.boot.GrailsApp.run(GrailsApp.groovy:387) 
     at grails.boot.GrailsApp.run(GrailsApp.groovy:374) 
     at grails.boot.GrailsApp$run.call(Unknown Source) 
     at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) 


FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':bootRun'. 
Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 1 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 
| Error Failed to start server (Use --stacktrace to see the full trace) 

を年を追加してい、それは例外で言うように、私のVhicle.groovy

 package com.example 

     class Vehicle { 

     Integer year 

     String name 
     Model model 
     Make make 

     static constraints = { 
      year min: 1900 
      name maxSize: 255 
     } 
     } 

     def vehicle = Vehicle.findByName('pickup') 
     if(vehicle) { 
     println vehicle.model // e.g, 'Titan' 
     println vehicle.make // e.g, 'Nissan' 
     } 

     Model.groovy 

     package com.example 

     class Model { 

     String name 

     static belongsTo = [ make: Make ] 

     static constraints = { 
      } 

     String to_String(){ 
      name 
      } 
     } 

     Here is my Make.groovy 

     package com.example 

     class Make { 

      String name 


     static constraints = { 
      } 

      String to_String(){ 
        name 
      } 
      } 

答えて

0

です:

at table: vhicle 

あなたは車をスペルミスしましたsomewhere

3

groovyファイル名vehicle.groovyのスペルが間違っていないか確認してください。 vhicle.groovyのように書くと、Vehicle.groovyになるはずです。クラス名はVehicleです。

関連する問題