when i am trying to drop all objects from a database using Liquibase, its getting error. After running in debug mode i found that its trying to drop sequence after dropping table. So get a error ' sequence not exists'.
I am running in a schema named "1", But in public schema it build successfully(not trying to drop sequences).
Here is my ANT target:
<target name="dropAll" depends="prepare" >
<dropAllDatabaseObjects
driver="${db.driver}"
url="${db.url}"
username="${db.username}"
password="${db.password}"
defaultSchemaName="${db.schema}"
promptOnNonLocalDatabase="yes"
classpathref="classpath"
/>
</target>
Here is the log error:
[dropAllDatabaseObjects] Executing EXECUTE database command: DROP TABLE "1"."database_change_log" CASCADE
[dropAllDatabaseObjects] Executing EXECUTE database command: DROP TABLE "1"."database_change_log_lock" CASCADE
[dropAllDatabaseObjects] Executing EXECUTE database command: DROP TABLE "1"."party" CASCADE
[dropAllDatabaseObjects] Executing EXECUTE database command: DROP SEQUENCE "1"."party_id_seq" CASCADE
[dropAllDatabaseObjects] Release Database Lock
[dropAllDatabaseObjects] Executing UPDATE database command: UPDATE "1".databasechangeloglock SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID =1
[dropAllDatabaseObjects] Successfully released change log lock
BUILD FAILED
D:\Liquibase 3.3.2-ems\common-model\build.xml:90: Unable to drop all objects from database.
at liquibase.integration.ant.DropAllTask.executeWithLiquibaseClassloader(DropAllTask.java:31)
at liquibase.integration.ant.BaseLiquibaseTask.execute(BaseLiquibaseTask.java:82)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: ERROR: sequence "party_id_seq" does not exist
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:316)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:122)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:112)
at liquibase.database.AbstractJdbcDatabase.dropDatabaseObjects(AbstractJdbcDatabase.java:753)
at liquibase.Liquibase.dropAll(Liquibase.java:743)
at liquibase.Liquibase.dropAll(Liquibase.java:730)
at liquibase.integration.ant.DropAllTask.executeWithLiquibaseClassloader(DropAllTask.java:28)
... 17 more
Caused by: org.postgresql.util.PSQLException: ERROR: sequence "party_id_seq"does not exist
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2198)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1927)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:561)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:405)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:397)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:314)
... 24 more
Related
Looks like something got corrupted with our H2 database. Here is the output of server.log upon startup. Is there any way to recover the data, or are we better off starting fresh?
2018-02-26 13:24:03,867 INFO [main] server: Starting server
2018-02-26 13:24:04,602 INFO [main] server: Starting database in directory E:\ProgramData\perfino
2018-02-26 13:24:05,381 ERROR [main] server: Cannot connect to database or access schema version
org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: rowcount remaining=1 SYS" [50000-176]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:344)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.convert(DbException.java:294)
at org.h2.engine.Database.openDatabase(Database.java:291)
at org.h2.engine.Database.<init>(Database.java:254)
at org.h2.engine.Engine.openSession(Engine.java:57)
at org.h2.engine.Engine.openSession(Engine.java:164)
at org.h2.engine.Engine.createSessionAndValidate(Engine.java:142)
at org.h2.engine.Engine.createSession(Engine.java:125)
at org.h2.engine.Engine.createSession(Engine.java:27)
at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:331)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:107)
at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:91)
at org.h2.Driver.connect(Driver.java:74)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.perfino.c.a.a(ejt:207)
at com.perfino.c.a.a(ejt:138)
at com.perfino.server.ServerMain.main(ejt:248)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
at com.exe4j.runtime.WinLauncher$2.run(WinLauncher.java:96)
Caused by: java.lang.RuntimeException: rowcount remaining=1 SYS
at org.h2.message.DbException.throwInternalError(DbException.java:241)
at org.h2.table.RegularTable.addIndex(RegularTable.java:284)
at org.h2.engine.Database.open(Database.java:705)
at org.h2.engine.Database.openDatabase(Database.java:260)
... 21 more
There is no data recovery tool for H2. If you have a backup of the database, I would recommend switching to the backup.
To reset the database, go to the database directory and remove the files perfino.h2.db and perfino.trace.db while the server is stopped.
The configuration data is located in config.h2.db and will be preserved.
I'm trying to upgrade my Grails app from 3.1.10 to 3.2.5, to use new GORM etc, but startup fails when reaching database-migrations.
I get:
INFO 2/9/17 2:08 PM: liquibase: Can not use class org.grails.plugins.databasemigration.liquibase.GormDatabase as a Liquibase service because it does not have a no-argument constructor
ERROR org.springframework.boot.SpringApplication - Application startup failed
org.springframework.transaction.HeuristicCompletionException: Heuristic completion: outcome state is rolled back; nested exception is org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction
at org.grails.transaction.ChainedTransactionManager.commit(ChainedTransactionManager.java:183)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:150)
at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93)
at grails.transaction.GrailsTransactionTemplate$execute.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.grails.plugins.databasemigration.DatabaseMigrationTransactionManager.withTransaction(DatabaseMigrationTransactionManager.groovy:31)
at org.grails.plugins.databasemigration.DatabaseMigrationTransactionManager$withTransaction.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin$_doWithApplicationContext_closure2.doCall(DatabaseMigrationGrailsPlugin.groovy:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2068)
at org.codehaus.groovy.runtime.dgm$164.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin.doWithApplicationContext(DatabaseMigrationGrailsPlugin.groovy:63)
at org.grails.plugins.DefaultGrailsPlugin.doWithApplicationContext(DefaultGrailsPlugin.java:523)
at org.grails.plugins.AbstractGrailsPluginManager.doPostProcessing(AbstractGrailsPluginManager.java:224)
at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy:246)
at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at grails.boot.GrailsApp.run(GrailsApp.groovy:83)
at grails.boot.GrailsApp.run(GrailsApp.groovy:388)
at grails.boot.GrailsApp.run(GrailsApp.groovy:375)
at grails.boot.GrailsApp$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at saasapi.Application.main(Application.groovy:8)
Caused by: org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:704)
at org.grails.transaction.MultiTransactionStatus.commit(MultiTransactionStatus.java:73)
at org.grails.transaction.ChainedTransactionManager.commit(ChainedTransactionManager.java:156)
... 56 common frames omitted
I have updated or added to my build.gradle the following dependencies:
buildscript {
...
dependencies {
....
classpath "org.grails.plugins:hibernate5:6.0.4"
classpath 'org.grails.plugins:database-migration:3.0.0'
}
}
dependencies {
...
runtime 'mysql:mysql-connector-java:5.1.40'
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.1.Final"
compile "org.hibernate:hibernate-ehcache:5.1.1.Final"
runtime 'org.grails.plugins:database-migration:3.0.0'
compile 'org.liquibase:liquibase-core:3.5.3'
compile 'org.grails.plugins:mongodb'
}
People have seen liquibase error "PM: liquibase: Can not use class org.grails.plugins.databasemigration.liquibase.GormDatabase as a Liquibase service because it does not have a no-argument constructor" previously in these Github issues:
https://github.com/grails-plugins/grails-database-migration/issues/81
https://github.com/grails-plugins/grails-database-migration/issues/64#issuecomment-256739113
But for them it wasn't a breaking error.
When I tried to update to Grails 3.2.3, then I also saw that liquibase error message, but otherwise everything else worked (migration logs were also not visible). Maybe the problem lies there, that Grails 3.2.3 uses Spring Boot 1.4.1, but Grails 3.2.5 uses Spring Boot 1.4.4.
Anyways I'm lost and I'm hoping that somebody can help me.
EDIT: I used database-migrations plugin to set up my database tables and I'm using it for changing it now as well. Also I have enabled database-migrations on startup.
EDIT2: It seems that the problem itself is not so much related to database migrations
I use multiple datasources (relevant parts from application.yml):
hibernate:
cache:
queries: false
use_second_level_cache: true
use_query_cache: false
region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory
dataSources:
dataSource:
pooled: true
jmxExport: true
driverClassName: com.mysql.jdbc.Driver
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
dbCreate: none
properties:
testOnBorrow: true
validationQuery: SELECT 1
myOtherDataSource:
pooled: true
jmxExport: true
driverClassName: net.sourceforge.jtds.jdbc.Driver
dialect: org.hibernate.dialect.SQLServerDialect
dbCreate: none
environments:
development:
dataSources:
dataSource:
url: jdbc:mysql://localhost/my_default_db?useUnicode=yes&characterEncoding=UTF-8&autoReconnect=true
username: my_user
password: my_pass
myOtherDataSource:
driverClassName: com.mysql.jdbc.Driver
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
url: jdbc:mysql://localhost/my_other_db?useUnicode=yes&characterEncoding=UTF-8&autoReconnect=true&failOverReadOnly=false&maxReconnects=10
username: my_user
password: my_pass
Also I can start my app, when there's no database migrations at startup, but then I get different errors related to db:
ERROR org.hibernate.engine.jdbc.spi.SqlExceptionHelper - PooledConnection has already been closed.
ERROR org.grails.web.errors.GrailsExceptionResolver - SQLException occurred when processing request: [GET] /my-endpoint
......
Caused by: org.hibernate.exception.GenericJDBCException: could not prepare statement
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:182)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:148)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1934)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1903)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1881)
at org.hibernate.loader.Loader.doQuery(Loader.java:925)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:342)
at org.hibernate.loader.Loader.doList(Loader.java:2622)
at org.hibernate.loader.Loader.doList(Loader.java:2605)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2434)
at org.hibernate.loader.Loader.list(Loader.java:2429)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:109)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1787)
at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
at org.grails.orm.hibernate.query.AbstractHibernateQuery.listForCriteria(AbstractHibernateQuery.java:700)
at org.grails.orm.hibernate.query.AbstractHibernateQuery.list(AbstractHibernateQuery.java:690)
at org.grails.datastore.gorm.finders.FindAllByFinder.invokeQuery(FindAllByFinder.java:54)
at org.grails.datastore.gorm.finders.FindAllByFinder$1.doInSession(FindAllByFinder.java:48)
at org.grails.datastore.mapping.core.DatastoreUtils.execute(DatastoreUtils.java:318)
at org.grails.datastore.gorm.finders.AbstractFinder.execute(AbstractFinder.java:42)
at org.grails.datastore.gorm.finders.FindAllByFinder.doInvokeInternal(FindAllByFinder.java:45)
at org.grails.datastore.gorm.finders.DynamicFinder.invoke(DynamicFinder.java:174)
at org.grails.datastore.gorm.finders.DynamicFinder.invoke(DynamicFinder.java:374)
at org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2.doCall(GormStaticApi.groovy:169)
.....
Caused by: java.sql.SQLException: PooledConnection has already been closed.
at org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy$LazyConnectionInvocationHandler.invoke(LazyConnectionDataSourceProxy.java:376)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:240)
at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(TransactionAwareDataSourceProxy.java:240)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:146)
at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:172)
... 66 common frames omitted
I've created an issue for this, with an example application reproducing this behaviour: https://github.com/grails/grails-core/issues/10477
[Update]:
I finally figured it out. Grails will create a platformtransactionmanager for each configuration under dataSources and one for the default dataSource. In your example this looks like [dataSource,myOtherDataSource,dataSource]. This is obviously not what should happen. In the GORM documentation is specified that you should use:
dataSource:
..
dataSources:
myOtherDataSource:
This will work. Grails creates two platformtransactionmanagers and this is the correct behaviour.
But Databasemigration expects all datasources to be in the dataSources config block, so it can't find the default datasource.
I've created a patch for this and will create a pullrequest for this as soon as another related bug is fixed;
Grails doesn't publish the default DataSource with the name 'dataSource' in the applicationContext in a Multi DataSource configuration.
I've added this to the issue https://github.com/grails/grails-core/issues/10477
[Update 2]:
I've created two pull requests to solve this issue:
grails-plugins/grails-database-migration/pull/123
and
grails/grails-core/pull/10478
These solved the issue on my system. I couldn't post two links because I don't have enough reputation according to stackoverflow :S
I have nearly the same setup as you have and no problems by me.The most significant changes I have is that I am using 5.1.3 Final of hibernate-core and ehcache and org.grails.plugins:hibernate5:6.0.6. I don't have a mongodb dependency.
Do you have multiple datasources?
Does it start without running any migration file?
I have the nearly same problem with Grails-3.2.5/3.2.6.
Please try Grails-3.2.4 and see the problem still occurs or not.
Using multiple datasources I have the same issue. It only happens on the default Datasource, it looks like the GrailsTemplate it trying to restore a previous state and failing to do so, because the transaction was committed.
org.springframework.transaction.HeuristicCompletionException: Heuristic completion: outcome state is rolled back; nested exception is org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction
at org.grails.transaction.ChainedTransactionManager.commit(ChainedTransactionManager.java:183)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:150)
at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:93)
at grails.transaction.GrailsTransactionTemplate$execute.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.grails.plugins.databasemigration.DatabaseMigrationTransactionManager.withTransaction(DatabaseMigrationTransactionManager.groovy:31)
at org.grails.plugins.databasemigration.DatabaseMigrationTransactionManager$withTransaction.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin$_doWithApplicationContext_closure2.doCall(DatabaseMigrationGrailsPlugin.groovy:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1426)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1024)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2030)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2015)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2068)
at org.codehaus.groovy.runtime.dgm$164.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.grails.plugins.databasemigration.DatabaseMigrationGrailsPlugin.doWithApplicationContext(DatabaseMigrationGrailsPlugin.groovy:63)
at org.grails.plugins.DefaultGrailsPlugin.doWithApplicationContext(DefaultGrailsPlugin.java:523)
at org.grails.plugins.AbstractGrailsPluginManager.doPostProcessing(AbstractGrailsPluginManager.java:224)
at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy:246)
at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:383)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:337)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:882)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:372)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at grails.boot.GrailsApp.run(GrailsApp.groovy:83)
at grails.boot.GrailsApp.run(GrailsApp.groovy:388)
at grails.boot.GrailsApp.run(GrailsApp.groovy:375)
at grails.boot.GrailsApp$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at scd.Application.main(Application.groovy:8)
Caused by: org.springframework.transaction.IllegalTransactionStateException: Transaction is already completed - do not call commit or rollback more than once per transaction
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:704)
at org.grails.transaction.MultiTransactionStatus.commit(MultiTransactionStatus.java:73)
at org.grails.transaction.ChainedTransactionManager.commit(ChainedTransactionManager.java:156)
... 56 common frames omitted
I have a problem during the migration of a TFS 2010 instance to Visual Studio Online. The error is:
OH-SCM-009: Error occurred while sync. TF14059: Unable to process the pending changes requested. The set of pending renames would cause a name collision for $/.../Releases/Release 2.1/.../.../Properties/Resources.Designer.cs.
The Changeset mentioned in the failure log dialog does not even include this file or a rename for any parent folder. The pending changes in the workspace created by the OpsHub tools contains 480 changes; the source changeset contains not even 50 changes...
How can I solve this issue?
The log at this point (I replaced sensitive information in the path with ...)
10/26/2015 15:44:50,991 ERROR [DefaultQuartzScheduler_Worker-7] (com.opshub.eai.SyncEaiProcess) - Error in executing process definition : SCM Default Integration Workflow at node callMethod
OpsHub-012013: Process execution failed on node: callMethod, in process definition: 'SCM Default Integration Workflow'; nested exception is : script evaluation exception
com.opshub.exceptions.eai.EAIProcessEngineException: OpsHub-012013: Process execution failed on node: callMethod, in process definition: 'SCM Default Integration Workflow'; nested exception is : script evaluation exception
at com.opshub.eai.ProcessEngine.executeTask(ProcessEngine.java:116)
at com.opshub.eai.ProcessEngine.executeProcess(ProcessEngine.java:44)
at com.opshub.eai.SyncEaiProcess.syncEvent(SyncEaiProcess.java:198)
at com.opshub.eai.SyncEaiProcess.sync(SyncEaiProcess.java:123)
at com.opshub.eai.OIMEventGenerator.process(OIMEventGenerator.java:247)
at com.opshub.jobs.core.OHJob.execute(OHJob.java:87)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525)
Caused by: org.jbpm.graph.def.DelegationException: script evaluation exception
at org.jbpm.graph.action.Script.eval(Script.java:139)
at org.jbpm.graph.action.Script.eval(Script.java:73)
at org.jbpm.graph.action.Script.execute(Script.java:62)
at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:259)
at org.jbpm.graph.def.GraphElement.executeActions(GraphElement.java:215)
at org.jbpm.graph.def.GraphElement.fireAndPropagateEvent(GraphElement.java:185)
at org.jbpm.graph.def.GraphElement.fireEvent(GraphElement.java:169)
at org.jbpm.graph.def.Transition.take(Transition.java:138)
at org.jbpm.graph.def.Node.leave(Node.java:393)
at org.jbpm.graph.exe.Token.signal(Token.java:192)
at org.jbpm.graph.exe.Token.signal(Token.java:140)
at org.jbpm.graph.exe.ProcessInstance.signal(ProcessInstance.java:270)
at com.opshub.eai.ProcessEngine.executeTask(ProcessEngine.java:102)
... 7 more
Caused by: com.opshub.eai.core.exceptions.OIMSCMAdapterException: OH-SCM-009: Error occurred while sync. TF14059: Unable to process the pending changes requested. The set of pending renames would cause a name collision for $/.../Releases/Release 2.1/.../.../Properties/Resources.Designer.cs.
at com.opshub.eai.core.adapters.OIMSCMAdapter.sync(OIMSCMAdapter.java:371)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at bsh.Reflect.invokeMethod(Unknown Source)
at bsh.Reflect.invokeObjectMethod(Unknown Source)
at bsh.Name.invokeMethod(Unknown Source)
at bsh.BSHMethodInvocation.eval(Unknown Source)
at bsh.BSHPrimaryExpression.eval(Unknown Source)
at bsh.BSHVariableDeclarator.eval(Unknown Source)
at bsh.BSHTypedVariableDeclaration.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at bsh.Interpreter.eval(Unknown Source)
at org.jbpm.graph.action.Script.eval(Script.java:130)
... 19 more
Caused by: java.lang.RuntimeException: TF14059: Unable to process the pending changes requested. The set of pending renames would cause a name collision for $/.../Releases/Release 2.1/.../.../Properties/Resources.Designer.cs.
at com.opshub.eai.tfssource.adapter.TFSVersionControlConnector.checkInAll(TFSVersionControlConnector.java:165)
at com.opshub.eai.tfssource.adapter.TFSSourceAdapter.checkIn(TFSSourceAdapter.java:239)
at com.opshub.eai.tfssource.adapter.TFSSourceAdapter$$EnhancerByCGLIB$$40eba2e5.CGLIB$checkIn$4(<generated>)
at com.opshub.eai.tfssource.adapter.TFSSourceAdapter$$EnhancerByCGLIB$$40eba2e5$$FastClassByCGLIB$$ceeeacdd.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
at com.opshub.eai.core.adapters.caching.AdapterCacheHandler.intercept(AdapterCacheHandler.java:119)
at com.opshub.eai.tfssource.adapter.TFSSourceAdapter$$EnhancerByCGLIB$$40eba2e5.checkIn(<generated>)
at com.opshub.eai.core.adapters.OIMSCMAdapter.sync(OIMSCMAdapter.java:287)
... 34 more
Caused by: TF14059: Unable to process the pending changes requested. The set of pending renames would cause a name collision for $/.../Releases/Release 2.1/.../.../Properties/Resources.Designer.cs.
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.opshub.tfs.test.BasicHttpBinding_ITFSWebServiceStub.checkinAllStatus(BasicHttpBinding_ITFSWebServiceStub.java:5115)
at com.opshub.eai.tfssource.adapter.TFSVersionControlConnector.checkInAll(TFSVersionControlConnector.java:154)
... 41 more
The following solved the problem:
Stop the migrations and close the migration utility.
Cleanup the tfs client cache from the machine where Migration Utility is installed by deleting the content of following folder(s):
%localappdata%\Microsoft\Team Foundation\3.0\Cache\
%localappdata%\Microsoft\Team Foundation\4.0\Cache\
%localappdata%\Microsoft\Team Foundation\5.0\Cache\
%localappdata%\Microsoft\Team Foundation\5.0\Cache\
Connect to your VSO endpoint from visual studio and delete all the workspace whose name starts with "OH-X..XX".
Now start the migration utility as well as the migration and retry the failures.
Thanks #OpsHub support.
Operating System: Windows 2012
Neo4j Version: 1.8.2 Enterprise
I am having trouble using the Neo4jBackup.bat script to backup the Neo4j server. I am running the following command from an Administrator command prompt:
.\Neo4jBackup.bat -full -from single://127.0.0.1 -to E:\Neo4j-Backup
When I run this command, I receive the following output and stack trace:
Performing full backup from 'single://127.0.0.1'
Exception in thread "main" java.lang.RuntimeException: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at org.neo4j.index.impl.lucene.LuceneDataSource.newIndexWriter(LuceneDataSource.java:685)
at org.neo4j.index.impl.lucene.LuceneDataSource.syncGetIndexSearcher(LuceneDataSource.java:574)
at org.neo4j.index.impl.lucene.LuceneDataSource.getIndexSearcher(LuceneDataSource.java:540)
at org.neo4j.index.impl.lucene.LuceneDataSource.makeSureAllIndexesAreInstantiated(LuceneDataSource.java:893)
at org.neo4j.index.impl.lucene.LuceneDataSource.listStoreFiles(LuceneDataSource.java:833)
at org.neo4j.com.ServerUtil.rotateLogsAndStreamStoreFiles(ServerUtil.java:129)
at org.neo4j.backup.BackupImpl.fullBackup(BackupImpl.java:41)
at org.neo4j.backup.BackupClient$BackupRequestType$1.call(BackupClient.java:73)
at org.neo4j.backup.BackupClient$BackupRequestType$1.call(BackupClient.java:69)
at org.neo4j.com.Server$4.run(Server.java:427)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: The filename, directory name, or volume label syntax is incorrect
at java.io.WinNTFileSystem.canonicalize0(Native Method)
at java.io.Win32FileSystem.canonicalize(Unknown Source)
at java.io.File.getCanonicalPath(Unknown Source)
at org.apache.lucene.store.FSDirectory.getCanonicalPath(FSDirectory.java:129)
at org.apache.lucene.store.FSDirectory.<init>(FSDirectory.java:143)
at org.apache.lucene.store.MMapDirectory.<init>(MMapDirectory.java:93)
at org.apache.lucene.store.FSDirectory.open(FSDirectory.java:180)
at org.apache.lucene.store.FSDirectory.open(FSDirectory.java:172)
at org.neo4j.index.impl.lucene.LuceneDataSource$DirectoryGetter$1.getDirectory(LuceneDataSource.java:914)
at org.neo4j.index.impl.lucene.LuceneDataSource.newIndexWriter(LuceneDataSource.java:664)
... 15 more
What am I doing wrong? The Neo4j settings related to backup are set to:
online_backup_enabled=true
online_backup_port=6362
Your assistance is appreciated. Thank you.
Amir.
Could you try using valid URI syntax for the backup location, like
.\Neo4jBackup.bat -full -from single://127.0.0.1 -to /E:/Neo4j-Backup
Does that work?
Try running the command like this
Neo4jBackup.bat -full -from single://127.0.0.1 -to E:/Neo4j-Backup
I have an relatively old Grails app that uses ant to build the application. In the test server it build without any problems, but when I try to run it on my PC, I get a consistent error:
Caused by: jar:file:/C:/ant/apache-ant-1.8.0/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146)
at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:432)
... 63 more
I have found that the error happens in the following part of the build:
<macrodef name="grails">
<attribute name="script"/>
<attribute name="args" default="" />
<sequential>
<grailsTask script="#{script}" args="#{args}" classpathref="grails.classpath">
<compileClasspath refid="compile.classpath"/>
<testClasspath refid="test.classpath"/>
<runtimeClasspath refid="app.classpath"/>
</grailsTask>
</sequential>
</macrodef>
If I comment out , there are no more errors.
For further refererence, here's the whole error dump:
G:\chp\src\hewittportlet\build.xml:131: The following error occurred while executing this line:
G:\chp\src\hewittportlet\build.xml:53: Unable to start Grails: java.lang.reflect.InvocationTargetExc
eption
at grails.ant.GrailsTask.runGrails(GrailsTask.java:124)
at grails.ant.GrailsTask.execute(GrailsTask.java:78)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
at org.apache.tools.ant.Main.runBuild(Main.java:801)
at org.apache.tools.ant.Main.startAnt(Main.java:218)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.execute(GrailsBuildHelper.java:9
4)
at grails.ant.GrailsTask.runGrails(GrailsTask.java:113)
... 31 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.execute(GrailsBuildHelper.java:8
8)
... 32 more
Caused by: The following error occurred while executing this line:
jar:file:/C:/ant/apache-ant-1.8.0/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed t
o create task or type componentdef
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:434)
at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:281)
at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:790)
at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:260)
at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:237)
at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:216)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:414)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:186)
at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:154)
at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:89)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.gant.GantBinding.initializeGantBinding(GantBinding.groovy:109)
at org.codehaus.gant.GantBinding.this$4$initializeGantBinding(GantBinding.groovy)
at org.codehaus.gant.GantBinding$this$4$initializeGantBinding.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:
44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:1
43)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:1
47)
at org.codehaus.gant.GantBinding.<init>(GantBinding.groovy:42)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRu
nner.java:355)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:
279)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:
205)
... 37 more
Caused by: jar:file:/C:/ant/apache-ant-1.8.0/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Proble
m: failed to create task or type componentdef
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146)
at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:432)
... 63 more
Total time: 34 seconds
Grails isn't compatible with Ant 1.8 - you need to use 1.7.x.
I found the source of the problem.
The problem was not the version of Ant, but rather the version of Grails and missing scripts. This application was using a deprecated version of Grails (version 1.1.1).
The following code, which I'm re-listing for everybody's conveniences, is invoking a script. However, in this particular application, the script had been removed, which caused Grails' build process to crash:
<macrodef name="grails">
<attribute name="script"/>
<attribute name="args" default="" />
<sequential>
<grailsTask script="#{script}" args="#{args}" classpathref="grails.classpath">
<compileClasspath refid="compile.classpath"/>
<testClasspath refid="test.classpath"/>
<runtimeClasspath refid="app.classpath"/>
</grailsTask>
</sequential>
</macrodef>
The solution was simple: to upgrade Grails to a more recent version, such as 1.3.5. The build worked without problems after that, even though some scripts were missing.
I would speculate that this new behavior allowed to generate scripts during the scaffolding, but at the same time give the freedom to the developer to remove unwanted or unnecessary scripts.
Thanks to Burth Beckwith for his insights.
Luis Colorado