Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
heroku grails引导错误_Grails_Heroku - Fatal编程技术网

heroku grails引导错误

heroku grails引导错误,grails,heroku,Grails,Heroku,好吧,当我尝试在heroku上使用以下代码使用我的应用程序时: heroku ps === web (1X): `java $JAVA_OPTS -jar server/webapp-runner.jar $RUNNER_OPTS --port $PORT target/*.war` web.1: up 2014/01/15 12:03:40 (~ 35s ago) heroku logs ←[36m2014-01-15T11:02:17.943114+00:00 app[web.1]:←[0

好吧,当我尝试在heroku上使用以下代码使用我的应用程序时:

heroku ps
=== web (1X): `java $JAVA_OPTS -jar server/webapp-runner.jar $RUNNER_OPTS --port
$PORT target/*.war`
web.1: up 2014/01/15 12:03:40 (~ 35s ago)

heroku logs
←[36m2014-01-15T11:02:17.943114+00:00 app[web.1]:←[0m Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into user (version, cognome, data_registrazione, data_ultima_visita, email, nome, password, id) values ('0', 'pagliaro', '2014-01-15 11:02:02.721000 +00:00:00', '2014-01-15 11:02:02.721000 +00:00:00', 'cotra@hotmail.com', 'carmine', 'carmine', '13') was aborted.  Call getNextException to see the cause.
←[36m2014-01-15T11:02:17.943114+00:00 app[web.1]:←[0m   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
←[36m2014-01-15T11:02:17.943114+00:00 app[web.1]:←[0m   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
←[36m2014-01-15T11:02:17.943114+00:00 app[web.1]:←[0m 2014-01-15 11:02:17,942 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: Could not execute JDBC batch update←[36m2014-01-15T11:02:17.943114+00:00 app[web.1]:←[0m   at java.util.concurrent.FutureTask.run(FutureTask.java:166)
←[36m2014-01-15T11:02:17.943114+00:00 app[web.1]:←[0m   at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586)
←[36m2014-01-15T11:02:17.943114+00:00 app[web.1]:←[0m   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811)
←[36m2014-01-15T11:02:17.943313+00:00 app[web.1]:←[0m   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)
←[36m2014-01-15T11:02:17.943313+00:00 app[web.1]:←[0m   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725)
←[36m2014-01-15T11:02:17.943313+00:00 app[web.1]:←[0m   ... 5 more
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m   at java.util.concurrent.FutureTask.run(FutureTask.java:166)
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m 2014-01-15 11:02:17,950 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing Grails: Could not execute JDBC batch update
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m   at java.lang.Thread.run(Thread.java:679)
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into user (version, cognome, data_registrazione, data_ultima_visita, email, nome, password, id) values ('0', 'pagliaro', '2014-01-15 11:02:02.721000 +00:00:00', '2014-01-15 11:02:02.721000 +00:00:00', 'cotra@hotmail.com', 'carmine', 'carmine', '13') was aborted.  Call getNextException to see the cause.
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m   at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586)
←[36m2014-01-15T11:02:17.951250+00:00 app[web.1]:←[0m   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811)
←[36m2014-01-15T11:02:17.951453+00:00 app[web.1]:←[0m   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)
←[36m2014-01-15T11:02:17.951453+00:00 app[web.1]:←[0m   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725)
←[36m2014-01-15T11:02:17.951453+00:00 app[web.1]:←[0m   ... 5 more
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:18 AM org.apache.catalina.core.StandardContext listenerStart
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m   at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:125)
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m   at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
←[36m2014-01-15T11:02:18.123014+00:00 app[web.1]:←[0m   at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m   at java.util.concurrent.FutureTask.run(FutureTask.java:166)
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m   at java.lang.Thread.run(Thread.java:679)
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m Caused by: org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m   ... 5 more
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m Caused by: java.sql.BatchUpdateException: Batch entry 0 insert into user (version, cognome, data_registrazione, data_ultima_visita, email, nome, password, id) values ('0', 'pagliaro', '2014-01-15 11:02:02.721000 +00:00:00', '2014-01-15 11:02:02.721000 +00:00:00', 'cotra@hotmail.com', 'carmine', 'carmine', '13') was aborted.  Call getNextException to see the cause.
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m   at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2586)
←[36m2014-01-15T11:02:18.123199+00:00 app[web.1]:←[0m   at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1811)
←[36m2014-01-15T11:02:18.123376+00:00 app[web.1]:←[0m   at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:407)
←[36m2014-01-15T11:02:18.123376+00:00 app[web.1]:←[0m   at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2725)
←[36m2014-01-15T11:02:18.123376+00:00 app[web.1]:←[0m   ... 5 more
←[36m2014-01-15T11:02:18.137665+00:00 app[web.1]:←[0m SEVERE: Error listenerStart
←[36m2014-01-15T11:02:18.137665+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:18 AM org.apache.catalina.core.StandardContext startInternal
←[36m2014-01-15T11:02:18.899520+00:00 app[web.1]:←[0m INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [255] milliseconds.
←[36m2014-01-15T11:02:18.899520+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:18 AM org.apache.catalina.util.SessionIdGenerator createSecureRandom
←[36m2014-01-15T11:02:18.951493+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:18 AM org.apache.catalina.core.StandardContext startInternal
←[36m2014-01-15T11:02:18.951493+00:00 app[web.1]:←[0m SEVERE: Context [] startup failed due to previous errors
←[36m2014-01-15T11:02:19.312325+00:00 app[web.1]:←[0m SEVERE: Context [] failed in [org.apache.catalina.core.StandardContext] lifecycle. Allowing Tomcat to shutdown.
←[36m2014-01-15T11:02:19.372549+00:00 app[web.1]:←[0m INFO: Closing Spring root WebApplicationContext
←[36m2014-01-15T11:02:19.372549+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:19 AM org.apache.catalina.core.ApplicationContext log
←[36m2014-01-15T11:02:20.339546+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:20 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
←[36m2014-01-15T11:02:20.340004+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:20 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
←[36m2014-01-15T11:02:20.340004+00:00 app[web.1]:←[0m SEVERE: The web application [] registered the JDBC driver [org.postgresql.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
←[36m2014-01-15T11:02:20.339546+00:00 app[web.1]:←[0m SEVERE: The web application [] registered the JDBC driver [org.h2.Driver] but failed to unregister it when
the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
←[36m2014-01-15T11:02:20.529184+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:20 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
←[36m2014-01-15T11:02:20.529808+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:20 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
←[36m2014-01-15T11:02:20.529808+00:00 app[web.1]:←[0m SEVERE: The web application [] appears to have started a thread named [net.sf.ehcache.CacheManager@6e6bb83] but has failed to stop it. This is very likely to create a memory leak.
←[36m2014-01-15T11:02:20.529184+00:00 app[web.1]:←[0m SEVERE: The web application [] appears to have started a thread named [PoolCleaner[1190000432:1389783669731]] but has failed to stop it. This is very likely to create a memory leak.
←[36m2014-01-15T11:02:22.895509+00:00 app[web.1]:←[0m Jan 15, 2014 11:02:22 AM org.apache.coyote.AbstractProtocol start
←[36m2014-01-15T11:02:22.895509+00:00 app[web.1]:←[0m INFO: Starting ProtocolHandler ["http-nio-27068"]
 ←[36m2014-01-15T11:02:24.607697+00:00 heroku[web.1]:←[0m Process exited with status 0
←[36m2014-01-15T11:02:24.621923+00:00 heroku[web.1]:←[0m State changed from up to crashed
←[33m2014-01-15T11:02:23.547203+00:00 heroku[router]:←[0m at=error code=H13 desc="Connection closed without response" method=GET path=/favicon.ico host=quiet-mountain-7475.herokuapp.com fwd="212.189.150.207" dyno=web.1 connect=1ms service=10043ms status=503 bytes=0
←[36m2014-01-15T11:03:35.509975+00:00 heroku[web.1]:←[0m State changed from crashed to starting
←[36m2014-01-15T11:03:41.997055+00:00 heroku[web.1]:←[0m Starting process with command `java -Xmx384m -Xss512k -XX:+UseCompressedOops -jar server/webapp-runner.jar $RUNNER_OPTS --port 9702 target/*.war`
←[36m2014-01-15T11:03:43.084014+00:00 app[web.1]:←[0m Picked up JAVA_TOOL_OPTIONS:  -Djava.rmi.server.useCodebaseOnly=true
←[36m2014-01-15T11:03:43.374328+00:00 app[web.1]:←[0m Adding Context  for target/smat-0.1.war
←[36m2014-01-15T11:03:43.969693+00:00 app[web.1]:←[0m INFO: Initializing ProtocolHandler ["http-nio-9702"]
←[36m2014-01-15T11:03:43.969693+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:43 AM org.apache.coyote.AbstractProtocol init
←[36m2014-01-15T11:03:43.997117+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:43 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
←[36m2014-01-15T11:03:43.997117+00:00 app[web.1]:←[0m INFO: Using a shared selector for servlet write/read
←[36m2014-01-15T11:03:43.999623+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:43 AM org.apache.catalina.core.StandardService startInternal
←[36m2014-01-15T11:03:43.999623+00:00 app[web.1]:←[0m INFO: Starting service Tomcat
←[36m2014-01-15T11:03:43.999801+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:43 AM org.apache.catalina.core.StandardEngine startInternal
←[36m2014-01-15T11:03:43.999801+00:00 app[web.1]:←[0m INFO: Starting Servlet Engine: Apache Tomcat/7.0.40
←[36m2014-01-15T11:03:44.492597+00:00 heroku[web.1]:←[0m State changed from starting to up
←[36m2014-01-15T11:03:45.566828+00:00 app[web.1]:←[0m INFO: No global web.xml found
←[36m2014-01-15T11:03:45.566828+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:45 AM org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
←[36m2014-01-15T11:03:57.632903+00:00 app[web.1]:←[0m INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/core is already defined
←[36m2014-01-15T11:03:57.632903+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:57 AM org.apache.catalina.startup.TaglibUriRule body
←[36m2014-01-15T11:03:57.721705+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:57 AM org.apache.catalina.startup.TaglibUriRule body
←[36m2014-01-15T11:03:57.721705+00:00 app[web.1]:←[0m INFO: TLD skipped. URI: http://java.sun.com/jsp/jstl/fmt is already defined
←[36m2014-01-15T11:03:58.264002+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:58 AM org.apache.catalina.startup.TaglibUriRule body
←[36m2014-01-15T11:03:58.263099+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:58 AM org.apache.catalina.startup.TaglibUriRule body
←[36m2014-01-15T11:03:58.263099+00:00 app[web.1]:←[0m INFO: TLD skipped. URI: http://www.springframework.org/tags is already defined
←[36m2014-01-15T11:03:58.264002+00:00 app[web.1]:←[0m INFO: TLD skipped. URI: http://www.springframework.org/tags/form is already defined
←[36m2014-01-15T11:03:59.457413+00:00 app[web.1]:←[0m INFO: No Spring WebApplicationInitializer types detected on classpath
←[36m2014-01-15T11:03:59.457413+00:00 app[web.1]:←[0m Jan 15, 2014 11:03:59 AM org.apache.catalina.core.ApplicationContext log
←[36m2014-01-15T11:04:00.319796+00:00 app[web.1]:←[0m Jan 15, 2014 11:04:00 AM org.apache.catalina.core.ApplicationContext log
←[36m2014-01-15T11:04:00.319796+00:00 app[web.1]:←[0m INFO: Initializing Spring root WebApplicationContext
←[36m2014-01-15T11:04:18.242112+00:00 app[web.1]:←[0m 2014-01-15 11:04:18,241 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport  - ERROR: syntax error at or near "user"
←[36m2014-01-15T11:04:18.242034+00:00 app[web.1]:←[0m 2014-01-15 11:04:18,231 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport  - Unsuccessful: create table user (id int8 not null, version int8 not null, cognome varchar(255) not null, data_registrazione timestamp not null, data_ultima_visita timestamp not null, email varchar(255) not null, nome varchar(255) not null, password varchar(255) not null, primary key (id))
←[36m2014-01-15T11:04:18.242112+00:00 app[web.1]:←[0m   Position: 14
←[36m2014-01-15T11:04:18.969316+00:00 app[web.1]:←[0m   Position: 92
←[36m2014-01-15T11:04:18.969316+00:00 app[web.1]:←[0m 2014-01-15 11:04:18,969 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport  - Unsuccessful: alter table ruolo_users add constraint FKA8A9FED8A0B81B3B foreign key (user_id) references user
←[36m2014-01-15T11:04:18.969316+00:00 app[web.1]:←[0m 2014-01-15 11:04:18,969 [localhost-startStop-1] ERROR hbm2ddl.SchemaExport  - ERROR: syntax error at or near "user"
我有上面的问题

当我在没有该代码的情况下尝试时,效果很好。

“user”在Postgres中是一个保留字,请参阅

任何名为“user”的表或列都需要重命名或转义。您可以使用backtick字符进行转义,这将导致Hibernate使用当前数据库的正确方法进行转义。因此,名为User的域类需要转义表名:

new Ruolo(nome:"user").save()
new User(cognome:"pagliaro", dataRegistrazione: new Date(), dataUltimaVisita: new    Date() ,email:"cotra@hotmail.com", nome:"carmine", password:"carmine").save().addToRoles(ruolo)
名为“user”的属性需要转义列名:

class User {
   ...
   static mapping = {
      table '`user`' // or 'users'
   }
}
但是请注意,在这个类中,您不需要转义名称:

class SomeOtherClass {
   String user
   ...
   static mapping = {
      user column: '`user`'
   }
}

因为这将使用外键,并且列名将是“user_id”。

使用另一个错误上面的代码比较:error context.ContextLoader-context初始化失败←[36m2014-01-15T14:00:11.658850+00:00应用程序[web.1]:←[0m org.springframework.beans.factory.BeanCreationException:创建名为“grailsApplication”的bean时出错,该bean在ServletContext资源[/WEB-INF/applicationContext.xml]:init方法的发票失败;嵌套异常为java.lang.NoClassDefFoundError:sma t/User$\u clinit\u closure2
class YetAnotherClass {
   User user
   ...
}