When I run my Grails app and I get the following error
| Loading Grails 2.3.5
| Configuring classpath
| Configuring classpath.
| Environment set to development
| Environment set to development.
| Environment set to development..
| Environment set to development...
| Environment set to development....
| Environment set to development.....
| Packaging Grails application
| Packaging Grails application.
| Packaging Grails application..
| Packaging Grails application...
| Packaging Grails application....
| Packaging Grails application.....
| Compiling 1 source files
| Compiling 1 source files.
| Compiling 1 source files..
| Compiling 1 source files...
| Compiling 1 source files....
| Compiling 1 source files.....
| Running Grails application
| Error 2015-04-21 11:54:24,947 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool .
Message: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Line | Method
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1121 | createCommunicationsException in com.mysql.jdbc.SQLError
| 676 | readPacket . . . . . . . . . in com.mysql.jdbc.MysqlIO
| 1088 | doHandshake in ''
| 2493 | coreConnect . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO . . . . . . . . . in ''
| 834 | <init> in ''
| 47 | <init> . . . . . . . . . . . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 347 | connect in com.mysql.jdbc.NonRegisteringDriver
| 262 | run . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpecte dly>
>->> 3166 | readFully in com.mysql.jdbc.MysqlIO>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >| 600 | readPacket in ''
| 1088 | doHandshake . . . . . . . . . in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly . . . . . . in ''
| 2311 | createNewIO in ''
| 834 | <init> . . . . . . . . . . . in ''
| 47 | <init> in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance . . . . . . in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect . . . . . . . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . . . . . . in java.lang.Thread
| Error 2015-04-21 11:54:25,051 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool .
Message: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Line | Method
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1121 | createCommunicationsException in com.mysql.jdbc.SQLError
| 676 | readPacket . . . . . . . . . in com.mysql.jdbc.MysqlIO
| 1088 | doHandshake in ''
| 2493 | coreConnect . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO . . . . . . . . . in ''
| 834 | <init> in ''
| 47 | <init> . . . . . . . . . . . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 347 | connect in com.mysql.jdbc.NonRegisteringDriver
| 262 | run . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpecte dly>
>->> 3166 | readFully in com.mysql.jdbc.MysqlIO>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >| 600 | readPacket in ''
| 1088 | doHandshake . . . . . . . . . in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly . . . . . . in ''
| 2311 | createNewIO in ''
| 834 | <init> . . . . . . . . . . . in ''
| 47 | <init> in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance . . . . . . in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect . . . . . . . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . . . . . . in java.lang.Thread
| Error 2015-04-21 11:54:25,139 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool .
Message: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
Line | Method
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1121 | createCommunicationsException in com.mysql.jdbc.SQLError
| 676 | readPacket . . . . . . . . . in com.mysql.jdbc.MysqlIO
| 1088 | doHandshake in ''
| 2493 | coreConnect . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO . . . . . . . . . in ''
| 834 | <init> in ''
| 47 | <init> . . . . . . . . . . . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance . . . . . . . . . in com.mysql.jdbc.ConnectionImpl
| 347 | connect in com.mysql.jdbc.NonRegisteringDriver
| 262 | run . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpecte dly>
>->> 3166 | readFully in com.mysql.jdbc.MysqlIO>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >| 600 | readPacket in ''
| 1088 | doHandshake . . . . . . . . . in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly . . . . . . in ''
| 2311 | createNewIO in ''
| 834 | <init> . . . . . . . . . . . in ''
| 47 | <init> in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance . . . . . . in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect . . . . . . . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . . . . . . in java.lang.Thread
| Error 2015-04-21 11:54:25,169 [localhost-startStop-1] ERROR context.GrailsContextLoader - Error initializing the application: Err>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >Message: Error creating bean with name 'transactionManagerPostProcessor': Initialization of bean failed; nested exception is org .spr
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. > Line | Method>->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFac tor>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >->> 262 | run in java.util.concurrent.FutureTask>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Cannot resolve reference to bean 'lobHandlerDete cto>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >->> 262 | run in java.util.concurrent.FutureTask>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'lobHandlerDetector': Invocation of init method failed; nested exc ept>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >->> 262 | run in java.util.concurrent.FutureTask>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is com.mysql.jdbc.exceptions.jdbc4.C omm>
>The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. >->> 262 | run in java.util.concurrent.FutureTask>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by CommunicationsException: Communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
->> 411 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1121 | createCommunicationsException in com.mysql.jdbc.SQLError
| 676 | readPacket in com.mysql.jdbc.MysqlIO
| 1088 | doHandshake in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO in ''
| 834 | <init> in ''
| 47 | <init> . in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect in com.mysql.jdbc.NonRegisteringDriver
| 262 | run . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run in java.lang.Thread
Caused by EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpecte dly>
>->> 3166 | readFully in com.mysql.jdbc.MysqlIO>- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 600 | readPacket in ''
| 1088 | doHandshake in ''
| 2493 | coreConnect in com.mysql.jdbc.ConnectionImpl
| 2526 | connectOneTryOnly in ''
| 2311 | createNewIO in ''
| 834 | <init> . in ''
| 47 | <init> in com.mysql.jdbc.JDBC4Connection
| 411 | handleNewInstance in com.mysql.jdbc.Util
| 416 | getInstance in com.mysql.jdbc.ConnectionImpl
| 347 | connect . in com.mysql.jdbc.NonRegisteringDriver
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . in java.lang.Thread
| Error Forked Grails VM exited with error
| Server running. Browse to http://localhost:8080/TestDebug
and my code is the following:
dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
// cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
}
// environment specific settings
environments {
development {
dataSource {
dbCreate = "update"
url = "jdbc:mysql://localhost/nuage_v3"
driverClassName = "com.mysql.jdbc.Driver"
dialect = org.hibernate.dialect.MySQL5InnoDBDialect
username = "root"
password = "root"
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
}
}
production {
dataSource {
dbCreate = "update"
url = "jdbc:h2:prodDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
properties {
maxActive = -1
minEvictableIdleTimeMillis=1800000
timeBetweenEvictionRunsMillis=1800000
numTestsPerEvictionRun=3
testOnBorrow=true
testWhileIdle=true
testOnReturn=false
validationQuery="SELECT 1"
jdbcInterceptors="ConnectionState"
}
}
}
}
The user and password are both correct, I tried reinstalling MySQL.
I've given up on trying to solve the problem.
I reinstalled grails and mysql on a diffenrent machine and it seems to work.
sorry to have bothered you all.
Thank you.
Problem is Mysql is not running.First run apache and Mysql then run grails app.Hope it will works .Also check 80 port is free or not if not then free your 80 port.
The same problem.. All of a sudden..
MySQLWorkbench works well, but grails "Unable to create initial connections of pool"
I've been spend half a day trying to fix this, searching answers. But nothing work for me..
Related
I've been playing around with Grails-3.1.1 and creating restful services but when I use them to generate from a collection and responding using templates I get the following error:
URI /api/buildings
Class java.lang.IllegalStateException
Message
Error rendering view: Error rendering view: Cannot write a name when a name has just been written. Write a value first!
Caused by
Cannot write a name when a name has just been written. Write a value first!
I followed the example on the json-views github page
https://github.com/grails/grails-views
My index.gson file looks like this
model {
List<Building> buildingList
}
json tmpl.building(buildingList)
And my _building.gson template file like this
model {
Building building
}
json g.render(building)
If I don't use the templates all works well but then I get too little info - I want to expand on some of the object relationships instead of just returning the id. Using a show.gson template accessing the same _building.gson file does seem to work OK. The controller in question extends from RestfulController and only implements the contructor as shown below
#Transactional(readOnly = true)
class BuildingRestController extends RestfulController {
static responseFormats = ['json', 'xml']
BuildingRestController() {
super(Building)
}
}
Any ideas what is going wrong and do others have it working?
Stack trace:
Line | Method
->> 8 | writeTo in C:\Users\Colin\code\biztool\grails-app\views\buildingRest\index.gson
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Caused by ViewRenderException: Error rendering view: Cannot write a name when a name has just been written. Write a value first!
->> 8 | writeTo in C:\Users\Colin\code\biztool\grails-app\views\buildingRest\_building.gson
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Caused by IllegalStateException: Cannot write a name when a name has just been written. Write a value first!
->> 624 | writeName in grails.plugin.json.builder.StreamingJsonBuilder$StreamingJsonDelegate
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 563 | call in ''
| 149 | process . . . . . . . . in grails.plugin.json.view.api.internal.JsonGrailsViewHelper
| 74 | doCall in grails.plugin.json.view.api.internal.JsonGrailsViewHelper$_render_closure1
| 689 | cloneDelegateAndGetContent in grails.plugin.json.builder.StreamingJsonBuilder$StreamingJsonDelegate
| 681 | cloneDelegateAndGetContent in ''
| 199 | call . . . . . . . . . in grails.plugin.json.builder.StreamingJsonBuilder
| 72 | render in grails.plugin.json.view.api.internal.JsonGrailsViewHelper
| 58 | render . . . . . . . . in ''
| 8 | run in _info_app_name__buildingRest__building_gson
| 32 | doWrite . . . . . . . . in grails.plugin.json.view.JsonViewTemplate
| 30 | writeTo in grails.views.AbstractWritableScript
| 280 | render . . . . . . . . in grails.plugin.json.view.api.internal.JsonGrailsViewHelper
| 30 | invokeMethod in grails.plugin.json.view.api.internal.TemplateRenderer
| 8 | run . . . . . . . . . . in _info_app_name__buildingRest_index_gson
| 32 | doWrite in grails.plugin.json.view.JsonViewTemplate
| 30 | writeTo . . . . . . . . in grails.views.AbstractWritableScript
| 64 | renderMergedOutputModel in grails.views.mvc.GenericGroovyTemplateView
| 94 | render . . . . . . . . in grails.views.mvc.renderer.DefaultViewRenderer
| 188 | internalRespond in grails.artefact.controller.RestResponder$Trait$Helper
| 62 | respond . . . . . . . . in ''
| 64 | index in grails.rest.RestfulController
| 96 | doInTransaction . . . . in grails.transaction.GrailsTransactionTemplate$2
| 93 | execute in grails.transaction.GrailsTransactionTemplate
| 80 | doFilter . . . . . . . in grails.plugin.springsecurity.rest.RestLogoutFilter
| 53 | doFilter in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 143 | doFilter . . . . . . . in grails.plugin.springsecurity.rest.RestAuthenticationFilter
| 62 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 58 | doFilter . . . . . . . in grails.plugin.springsecurity.web.SecurityRequestHolderFilter
| 35 | doFilterInternal in CorsFilter.java
| 1142 | runWorker . . . . . . . in java.util.concurrent.ThreadPoolExecutor
| 617 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 745 | run . . . . . . . . . . in java.lang.Thread
I'm trying to get the JSR-311 plugin working with Grails 2.3.7. I'm using version 0.10, because I think 0.11 requires Grails 2.4.
I've used the generate-resource command to create an end point for my domain class Product. Two resource classes are created, ProductCollectionResource and ProductResource. I've tweaked them a bit, but essentially they look like this:
ProductCollectionResource
#Path('/api/products')
#Consumes(['application/json'])
#Produces(['application/json'])
class ProductCollectionResource {
def productResourceService
#Path('{id}')
#GET
ProductResource getResource(#PathParam('id') Long id) {
new ProductResource(productResourceService: productResourceService, id:id)
}
#GET
Response readAll(#QueryParam("max") Integer max, #QueryParam("offset") Integer offset) {
ok productResourceService.readAll(max, offset)
}
}
ProductResource
#Consumes(['application/json'])
#Produces(['application/json'])
class ProductResource {
def productResourceService
def id
#GET
Response read() {
ok productResourceService.read(id)
}
}
The readAll method in ProductCollectionResource works fine - when I hit it, I get back a list of products, however when I try to access a specific product by id (on /api/products/123), I get the following error:
Caused by MessageException: A message body writer for Java class com.myapp.ProductResource, and Java type class com.myapp.ProductResource, and MIME media type application/json was not found
->> 285 | write in com.sun.jersey.spi.container.ContainerResponse
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1479 | _handleRequest in com.sun.jersey.server.impl.application.WebApplicationImpl
| 1391 | handleRequest . . in ''
| 1381 | handleRequest in ''
| 416 | service . . . . . in com.sun.jersey.spi.container.servlet.WebComponent
| 538 | service in com.sun.jersey.spi.container.servlet.ServletContainer
| 716 | service . . . . . in ''
| 193 | process in org.grails.jaxrs.web.JaxrsContext$JaxrsServiceImpl
| 45 | handle . . . . . . in org.grails.jaxrs.JaxrsController
| 195 | doFilter in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter . . . . . in grails.plugin.cache.web.filter.AbstractFilter
| 150 | invoke in net.bull.javamelody.JspWrapper
| 285 | invoke . . . . . . in net.bull.javamelody.JdbcWrapper$DelegatingInvocationHandler
| 198 | doFilter in net.bull.javamelody.MonitoringFilter
| 176 | doFilter . . . . . in ''
| 67 | doFilter . . . . . in ''
| 53 | doFilter in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 82 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 63 | doFilter . . . . . in com.odobo.grails.plugin.springsecurity.rest.RestLogoutFilter
| 46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
| 82 | doFilter . . . . . in com.brandseye.cors.CorsFilter
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
So it looks like it's trying to marshall my ProductResource class to JSON, which I think isn't really what I want. I think it should be invoking the ProductResource.read() method, and marshalling the returned value from that method to JSON.
I have no experience in Grails whatsoever, but from a pure Jersey standpoint, look at what you got here
#Path('{id}')
#GET
ProductResource getResource(#PathParam('id') Long id) {
This is resource method (endpoint). So the ProductsResource will be treated as the response body, just like any other resource method.
You seem to be trying to use the sub-resource locator functionality, forwarding to the ProductsResource class. For that to work, the sub-resource locator (getResource) should not have an #HttpMethod annotation. That's one of the factors that differentiates a resource method from a sub-resource locator.
So just remove the #GET from the getResource method. The #GET is already established by the read() method in the ProductsResource, which is what will be called.
For more information, see the documentation for Sub-Resource Locators
I really need some help with something in Grails.
I'm new to Grails, and making a backend for a gymnasium that handles routines, measurements, etc.
The problem I have is when parsing a JSON to create a routine for a new or existing client.
The routine is composed by a list of days, of a maximum of 4 days total.
To make long story short, when the JSON request is with only 1 day, I get the IllegalArgumentException and I'm running out of ideas regarding of why.
Please help me!
Here's a sample json:
{"objetivo":"test martes","fechaRealizacion":"2015-01-20T00:00:00Z","carne":115500153,"dias":[{"numDia":"1","ejercicios":[{"descripcionTrans":"1.1","idHoja":1},{"descripcionTrans":"1.2","idHoja":2},{"descripcionTrans":"1.3","idHoja":3}]}]}
And here's is the code where I parse the JSON request:
def guardar = {
println request.JSON
jsonObj = request.JSON
Rutinas r = new Rutinas(jsonObj)
def ide = request.JSON.carne?.toLong() ?:0
r.perfilAsociado = requestService.getPerfil(ide)
r.observaciones = r.perfilAsociado.observaciones
println jsonObj
ArrayList test = jsonObj.dias
ArrayList<Dia> dias = new ArrayList<Dia>()
def testO
for(int i = 0; i < test.size(); i++) {
Dia d = test.get(i)
ArrayList<Ejercicios> ejerAdd = new ArrayList<Ejercicios>()
for(int j = 0; j < d.ejercicios.size(); j++) {
testO = [idHoja: d.ejercicios.get(j).idHoja]
Ejercicios e = Ejercicios.findByIdHoja(testO.idHoja)
ejerAdd.add(e)
}
d.ejercicios = ejerAdd
dias.add(d)
}
r.dias = dias
/**/
try {
insertRutinas(r)
insertDia(r, jsonObj)
}catch(Exception ex) {
response.status = 500
println ex
render "Internal server error"
}
response.status = 201
render r as JSON//requestService.encodeRutinas(r)
}
Edit:
The error is thrown when calling ArrayList test = jsonObj.dias
Here's the stacktrace:
| Error 2015-01-21 09:18:04,884 [http-bio-8080-exec-4] ERROR errors.GrailsExceptionResolver - IllegalArgumentException occurred when processing request: [POST] /backend-gimnasio/rutinas/guardar/
argument type mismatch. Stacktrace follows:
Message: argument type mismatch
Line | Method
->> -2 | invoke0 in sun.reflect.NativeMethodAccessorImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 57 | invoke in ''
| 43 | invoke . . . . . . . . . . . . in sun.reflect.DelegatingMethodAccessorImpl
| 606 | invoke in java.lang.reflect.Method
| 1270 | jlrMethodInvoke . . . . . . . . in org.springsource.loaded.ri.ReflectiveInterceptor
| 90 | invoke in org.codehaus.groovy.reflection.CachedMethod
| 324 | doMethodInvoke . . . . . . . . in groovy.lang.MetaMethod
| 2662 | setProperty in groovy.lang.MetaClassImpl
| 1170 | setProperty . . . . . . . . . . in groovy.lang.ExpandoMetaClass
| 3702 | setProperty in groovy.lang.MetaClassImpl
| 1741 | setProperties . . . . . . . . . in ''
| 1718 | invokeConstructor in ''
| 1526 | invokeConstructor . . . . . . . in ''
| 675 | invokeConstructor in groovy.lang.ExpandoMetaClass
| 932 | invokeConstructorOf . . . . . . in org.codehaus.groovy.runtime.InvokerHelper
| 362 | continueCastOnSAM in org.codehaus.groovy.runtime.typehandling.DefaultTypeTransformation
| 306 | continueCastOnNumber . . . . . in ''
| 262 | continueCastOnCollection in ''
| 214 | castToType . . . . . . . . . . in ''
| 599 | castToType in org.codehaus.groovy.runtime.ScriptBytecodeAdapter
| 386 | doCall . . . . . . . . . . . . in gimnasio.backend.RutinasController$_closure2
| -1 | doCall in ''
| -2 | invoke0 . . . . . . . . . . . . in sun.reflect.NativeMethodAccessorImpl
| 57 | invoke in ''
| 43 | invoke . . . . . . . . . . . . in sun.reflect.DelegatingMethodAccessorImpl
| 606 | invoke in java.lang.reflect.Method
| 1270 | jlrMethodInvoke . . . . . . . . in org.springsource.loaded.ri.ReflectiveInterceptor
| 90 | invoke in org.codehaus.groovy.reflection.CachedMethod
| 324 | doMethodInvoke . . . . . . . . in groovy.lang.MetaMethod
| 1207 | invokeMethod in groovy.lang.MetaClassImpl
| 1110 | invokeMethod . . . . . . . . . in groovy.lang.ExpandoMetaClass
| 1016 | invokeMethod in groovy.lang.MetaClassImpl
| 423 | call . . . . . . . . . . . . . in groovy.lang.Closure
| -1 | call in gimnasio.backend.RutinasController$_closure2
| 417 | call . . . . . . . . . . . . . in groovy.lang.Closure
| -1 | call in gimnasio.backend.RutinasController$_closure2
| -2 | invoke0 . . . . . . . . . . . . in sun.reflect.NativeMethodAccessorImpl
| 57 | invoke in ''
| 43 | invoke . . . . . . . . . . . . in sun.reflect.DelegatingMethodAccessorImpl
| 606 | invoke in java.lang.reflect.Method
| 1270 | jlrMethodInvoke . . . . . . . . in org.springsource.loaded.ri.ReflectiveInterceptor
| 154 | invoke in org.codehaus.groovy.grails.web.servlet.mvc.MixedGrailsControllerHelper
| 375 | handleAction . . . . . . . . . in org.codehaus.groovy.grails.web.servlet.mvc.AbstractGrailsControllerHelper
| 252 | executeAction in ''
| 205 | handleURI . . . . . . . . . . . in ''
| 126 | handleURI in ''
| 72 | handleRequest . . . . . . . . . in org.codehaus.groovy.grails.web.servlet.mvc.SimpleGrailsController
| 50 | handle in org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter
| 347 | doDispatch . . . . . . . . . . in org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet
| 870 | doService in org.springframework.web.servlet.DispatcherServlet
| 961 | processRequest . . . . . . . . in org.springframework.web.servlet.FrameworkServlet
| 863 | doPost in ''
| 646 | service . . . . . . . . . . . . in javax.servlet.http.HttpServlet
| 837 | service in org.springframework.web.servlet.FrameworkServlet
| 727 | service . . . . . . . . . . . . in javax.servlet.http.HttpServlet
| 303 | internalDoFilter in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter . . . . . . . . . . . in ''
| 52 | doFilter in org.apache.tomcat.websocket.server.WsFilter
| 241 | internalDoFilter . . . . . . . in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter in ''
| 198 | doFilter . . . . . . . . . . . in grails.plugin.cache.web.filter.PageFragmentCachingFilter
| 63 | doFilter in grails.plugin.cache.web.filter.AbstractFilter
| 344 | invokeDelegate . . . . . . . . in org.springframework.web.filter.DelegatingFilterProxy
| 261 | doFilter in ''
| 241 | internalDoFilter . . . . . . . in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter in ''
| 101 | doFilter . . . . . . . . . . . in org.springframework.web.filter.OncePerRequestFilter
| 241 | internalDoFilter in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter . . . . . . . . . . . in ''
| 101 | doFilter in org.springframework.web.filter.OncePerRequestFilter
| 241 | internalDoFilter . . . . . . . in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter in ''
| 101 | doFilter . . . . . . . . . . . in org.springframework.web.filter.OncePerRequestFilter
| 241 | internalDoFilter in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter . . . . . . . . . . . in ''
| 748 | invoke in org.apache.catalina.core.ApplicationDispatcher
| 486 | processRequest . . . . . . . . in ''
| 411 | doForward in ''
| 338 | forward . . . . . . . . . . . . in ''
| 178 | forwardRequestForUrlMappingInfo in org.codehaus.groovy.grails.web.mapping.UrlMappingUtils
| 144 | forwardRequestForUrlMappingInfo in ''
| 135 | forwardRequestForUrlMappingInfo in ''
| 216 | doFilterInternal . . . . . . . in org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter
| 107 | doFilter in org.springframework.web.filter.OncePerRequestFilter
| 241 | internalDoFilter . . . . . . . in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter in ''
| 330 | doFilter . . . . . . . . . . . in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 118 | invoke in org.springframework.security.web.access.intercept.FilterSecurityInterceptor
| 84 | doFilter . . . . . . . . . . . in ''
| 342 | doFilter in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 113 | doFilter . . . . . . . . . . . in org.springframework.security.web.access.ExceptionTranslationFilter
| 342 | doFilter in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 113 | doFilter . . . . . . . . . . . in org.springframework.security.web.access.ExceptionTranslationFilter
| 342 | doFilter in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| -1 | call . . . . . . . . . . . . . in javax.servlet.FilterChain$doFilter
| 108 | processFilterChain in com.odobo.grails.plugin.springsecurity.rest.RestTokenValidationFilter
| -1 | this$3$processFilterChain . . . in ''
| 77 | doFilter in ''
| 342 | doFilter . . . . . . . . . . . in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 53 | doFilter in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
| 342 | doFilter . . . . . . . . . . . in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 146 | doFilter in org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter
| 342 | doFilter . . . . . . . . . . . in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 154 | doFilter in org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter
| 342 | doFilter . . . . . . . . . . . in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| -1 | call in javax.servlet.FilterChain$doFilter
| 122 | doFilter . . . . . . . . . . . in com.odobo.grails.plugin.springsecurity.rest.RestAuthenticationFilter
| 342 | doFilter in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 199 | doFilter . . . . . . . . . . . in org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter
| 49 | doFilter in grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter
| 342 | doFilter . . . . . . . . . . . in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 82 | doFilter in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
| 342 | doFilter . . . . . . . . . . . in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| -1 | call in javax.servlet.FilterChain$doFilter
| 63 | doFilter . . . . . . . . . . . in com.odobo.grails.plugin.springsecurity.rest.RestLogoutFilter
| 342 | doFilter in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 87 | doFilter . . . . . . . . . . . in org.springframework.security.web.context.SecurityContextPersistenceFilter
| 342 | doFilter in org.springframework.security.web.FilterChainProxy$VirtualFilterChain
| 192 | doFilterInternal . . . . . . . in org.springframework.security.web.FilterChainProxy
| 160 | doFilter in ''
| 344 | invokeDelegate . . . . . . . . in org.springframework.web.filter.DelegatingFilterProxy
| 261 | doFilter in ''
| 241 | internalDoFilter . . . . . . . in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter in ''
| 69 | doFilterInternal . . . . . . . in org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter
| 107 | doFilter in org.springframework.web.filter.OncePerRequestFilter
| 241 | internalDoFilter . . . . . . . in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter in ''
| 67 | doFilterInternal . . . . . . . in org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter
| 107 | doFilter in org.springframework.web.filter.OncePerRequestFilter
| 241 | internalDoFilter . . . . . . . in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter in ''
| 88 | doFilterInternal . . . . . . . in org.springframework.web.filter.CharacterEncodingFilter
| 107 | doFilter in org.springframework.web.filter.OncePerRequestFilter
| 344 | invokeDelegate . . . . . . . . in org.springframework.web.filter.DelegatingFilterProxy
| 261 | doFilter in ''
| 241 | internalDoFilter . . . . . . . in org.apache.catalina.core.ApplicationFilterChain
| 208 | doFilter in ''
| 220 | invoke . . . . . . . . . . . . in org.apache.catalina.core.StandardWrapperValve
| 122 | invoke in org.apache.catalina.core.StandardContextValve
| 171 | invoke . . . . . . . . . . . . in org.apache.catalina.core.StandardHostValve
| 103 | invoke in org.apache.catalina.valves.ErrorReportValve
| 116 | invoke . . . . . . . . . . . . in org.apache.catalina.core.StandardEngineValve
| 408 | service in org.apache.catalina.connector.CoyoteAdapter
| 1070 | process . . . . . . . . . . . . in org.apache.coyote.http11.AbstractHttp11Processor
| 611 | process in org.apache.coyote.AbstractProtocol$AbstractConnectionHandler
| 316 | run . . . . . . . . . . . . . . in org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
| 61 | run in org.apache.tomcat.util.threads.TaskThread$WrappingRunnable
^ 745 | run . . . . . . . . . . . . . . in java.lang.Thread
Using Grails Database Migration Plugin 1.4 I want have the following structure of my existing database:
class StickerGroup {
}
Now I added the class Company and updated the class StickerGroup:
class StickerGroup {
static constraints = { company nullable: true, unique: true }
static belongsTo = [company: Company]
}
class Company {
static hasOne = [stickerGroup: StickerGroup]
}
I created the migration file and then I perform grails dbm-update. After that I get the following error log:
2015-01-20 15:03:49,549 [main] ERROR liquibase - Change Set 2015-01-20-update-Company.groovy::1421762562430-2::mg (generated) failed. Error: Error executing SQL ALTER TABLE `sticker_group` ADD `company_id` VARCHAR(10) NOT NULL UNIQUE: Duplicate entry '' for key 'company_id'
Message: Error executing SQL ALTER TABLE `sticker_group` ADD `company_id` VARCHAR(10) NOT NULL UNIQUE: Duplicate entry '' for key 'company_id'
Line | Method
->> 62 | execute in liquibase.executor.jvm.JdbcExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 104 | execute in ''
| 1091 | execute . . . . . in liquibase.database.AbstractDatabase
| 1075 | executeStatements in ''
| 317 | execute . . . . . in liquibase.changelog.ChangeSet
| 27 | visit in liquibase.changelog.visitor.UpdateVisitor
| 58 | run . . . . . . . in liquibase.changelog.ChangeLogIterator
| 114 | update in liquibase.Liquibase
| 26 | doCall . . . . . in DbmUpdate$_run_closure1_closure2
| 59 | doCall in _DatabaseMigrationCommon_groovy$_run_closure2_closure11
| 133 | executeInSession in grails.plugin.databasemigration.MigrationUtils
| 51 | doCall in _DatabaseMigrationCommon_groovy$_run_closure2
^ 25 | doCall . . . . . in DbmUpdate$_run_closure1
Caused by MySQLIntegrityConstraintViolationException: Duplicate entry '' for key 'company_id'
->> 377 | handleNewInstance in com.mysql.jdbc.Util
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 360 | getInstance in ''
| 971 | createSQLException in com.mysql.jdbc.SQLError
| 3887 | checkErrorPacket in com.mysql.jdbc.MysqlIO
| 3823 | checkErrorPacket in ''
| 2435 | sendCommand in ''
| 2582 | sqlQueryDirect . in ''
| 2526 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2484 | execSQL . . . . . in ''
| 848 | execute in com.mysql.jdbc.StatementImpl
| 742 | execute . . . . . in ''
| 92 | doInStatement in liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback
| 55 | execute . . . . . in liquibase.executor.jvm.JdbcExecutor
| 104 | execute in ''
| 1091 | execute . . . . . in liquibase.database.AbstractDatabase
| 1075 | executeStatements in ''
| 317 | execute . . . . . in liquibase.changelog.ChangeSet
| 27 | visit in liquibase.changelog.visitor.UpdateVisitor
| 58 | run . . . . . . . in liquibase.changelog.ChangeLogIterator
| 114 | update in liquibase.Liquibase
| 26 | doCall . . . . . in DbmUpdate$_run_closure1_closure2
| 59 | doCall in _DatabaseMigrationCommon_groovy$_run_closure2_closure11
| 133 | executeInSession in grails.plugin.databasemigration.MigrationUtils
| 51 | doCall in _DatabaseMigrationCommon_groovy$_run_closure2
^ 25 | doCall . . . . . in DbmUpdate$_run_closure1
liquibase.exception.MigrationFailedException: Migration failed for change set 2015-01-20-update-Company.groovy::1421762562430-2::mg (generated):
Reason: liquibase.exception.DatabaseException: Error executing SQL ALTER TABLE `sticker_group` ADD `company_id` VARCHAR(10) NOT NULL UNIQUE: Duplicate entry '' for key 'company_id':
Caused By: Error executing SQL ALTER TABLE `sticker_group` ADD `company_id` VARCHAR(10) NOT NULL UNIQUE: Duplicate entry '' for key 'company_id':
Caused By: Duplicate entry '' for key 'company_id'
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58)
at liquibase.Liquibase.update(Liquibase.java:114)
at DbmUpdate$_run_closure1_closure2.doCall(DbmUpdate:26)
at _DatabaseMigrationCommon_groovy$_run_closure2_closure11.doCall(_DatabaseMigrationCommon_groovy:59)
at grails.plugin.databasemigration.MigrationUtils.executeInSession(MigrationUtils.groovy:133)
at _DatabaseMigrationCommon_groovy$_run_closure2.doCall(_DatabaseMigrationCommon_groovy:51)
at DbmUpdate$_run_closure1.doCall(DbmUpdate:25)
Caused by: liquibase.exception.DatabaseException: Error executing SQL ALTER TABLE `sticker_group` ADD `company_id` VARCHAR(10) NOT NULL UNIQUE: Duplicate entry '' for key 'company_id'
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104)
at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091)
at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317)
... 8 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '' for key 'company_id'
at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
at com.mysql.jdbc.Util.getInstance(Util.java:360)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:971)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3887)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3823)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2526)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2484)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:848)
at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:742)
at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
... 12 more
How can I fix this error?
I have switched from Grails 2.2.4 to Grails 2.4.3 and experienced bad problems with my IntelliJ IDEA 13.1.4 IDE.
After creating a clean Grails 2.4.3 project and adding a clean controller class I start the project via "run-app" in IntelliJ IDEA. Afterwards I change something in the controller and I get the following exceptions:
2014-09-29 18:45:41,801 [Thread-11] ERROR plugins.AbstractGrailsPluginManager - Plugin
[controllers:2.4.3] could not reload changes to file [D:\VS\Eclipse Workspace\xx\grails-app\controllers\com\xx\backoffice\MaintenanceController.groovy]: Cannot get property 'cacheOperationSource' on null object
Message: Cannot get property 'cacheOperationSource' on null object
Line | Method
->> 184 | doCall in CacheGrailsPlugin$_closure4
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.....................Error
|
2014-09-29 18:45:43,276 [FileSystemWatcher: files=#175 cl=groovy.lang.GroovyClassLoader#177f04d9] ERROR agent.Watcher - FileWatcher caught serious error, see cause
Message: loader (instance of org/springsource/loaded/ChildClassLoader): attempted duplicate class definition for name: "com/xx/MaintenanceController$$DOrGoSVQ"
Line | Method
->> 791 | defineClass in java.lang.ClassLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 634 | defineClass in ''
^ 722 | run . . . . in java.lang.Thread
My BuildConfig.groovy:
grails.servlet.version = "3.0" // Change depending on target container compliance (2.5 or 3.0)
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
grails.project.work.dir = "target/work"
grails.project.target.level = 1.6
grails.project.source.level = 1.6
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.reload.enabled = true
forkConfig = [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false]
grails.project.fork = [
// configure settings for compilation JVM, note that if you alter the Groovy version forked compilation is required
// compile: [maxMemory: 256, minMemory: 64, debug: false, maxPerm: 256, daemon:true],
// configure settings for the test-app JVM, uses the daemon by default
test: forkConfig,
// configure settings for the run-app JVM
run: forkConfig,
// configure settings for the run-war JVM
war: forkConfig,
// configure settings for the Console UI JVM
console: forkConfig
]
grails.project.dependency.resolver = "maven" // or ivy
grails.dependency.cache.dir = "${userHome}/.m2/repository"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// specify dependency exclusions here; for example, uncomment this to disable ehcache:
// excludes 'ehcache'
}
log "info" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
checksums true // Whether to verify checksums on resolve
legacyResolve false // whether to do a secondary resolve on plugin installation, not advised and here for backwards compatibility
repositories {
inherits true // Whether to inherit repository definitions from plugins
grailsPlugins()
grailsHome()
mavenLocal()
grailsCentral()
mavenCentral()
// uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
// runtime 'mysql:mysql-connector-java:5.1.29'
// runtime 'org.postgresql:postgresql:9.3-1101-jdbc41'
test "org.grails:grails-datastore-test-support:1.0-grails-2.4"
runtime 'mysql:mysql-connector-java:5.1.32'
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.55"
// plugins for the compile step
compile ":scaffolding:2.1.2"
compile ':cache:1.1.8'
compile ":asset-pipeline:1.9.6"
compile ":shiro:1.2.1"
compile ":less-asset-pipeline:1.10.0"
compile ":jquery-ui:1.10.4"
// plugins needed at runtime but not for compilation
runtime ":hibernate4:4.3.5.5" // or
//runtime ":hibernate:3.6.10.17"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
// Uncomment these to enable additional asset-pipeline capabilities
//compile ":sass-asset-pipeline:1.9.0"
//compile ":less-asset-pipeline:1.10.0"
//compile ":coffee-asset-pipeline:1.8.0"
//compile ":handlebars-asset-pipeline:1.3.0.3"
}
}
I did some research and found out that I have to disable the forked mode as IDEA has problems with that. Therefor I disabled this feature in the BuildConfig.groovy with the grails.project.fork = false option.
Now I can't start the app via "run-app" because of the following exceptions:
2014-09-29 18:48:56,144 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
Message: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Line | Method
->> 1094 | createSQLException in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 997 | createSQLException in ''
| 983 | createSQLException in ''
| 928 | createSQLException in ''
| 959 | createSQLException in ''
| 949 | createSQLException in ''
| 432 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 7467 | realClose in com.mysql.jdbc.ResultSetImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 923 | close in ''
| 801 | convertShowWarningsToSQLWarnings in com.mysql.jdbc.SQLError
| 4445 | scanForAndThrowDataTruncation in com.mysql.jdbc.MysqlIO
| 2923 | sqlQueryDirect . . in ''
| 2820 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2769 | execSQL . . . . . in ''
| 1569 | executeQuery in com.mysql.jdbc.StatementImpl
| 4210 | loadServerVariables in com.mysql.jdbc.ConnectionImpl
| 3604 | initializePropsFromServer in ''
| 2542 | connectOneTryOnly in ''
| 2309 | createNewIO in ''
| 834 | <init> . . . . . . in ''
| 46 | <init> in com.mysql.jdbc.JDBC4Connection
| 408 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Error |
2014-09-29 18:48:56,203 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
Message: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Line | Method
->> 1094 | createSQLException in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 997 | createSQLException in ''
| 983 | createSQLException in ''
| 928 | createSQLException in ''
| 959 | createSQLException in ''
| 949 | createSQLException in ''
| 432 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 7467 | realClose in com.mysql.jdbc.ResultSetImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 923 | close in ''
| 801 | convertShowWarningsToSQLWarnings in com.mysql.jdbc.SQLError
| 4445 | scanForAndThrowDataTruncation in com.mysql.jdbc.MysqlIO
| 2923 | sqlQueryDirect . . in ''
| 2820 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2769 | execSQL . . . . . in ''
| 1569 | executeQuery in com.mysql.jdbc.StatementImpl
| 4210 | loadServerVariables in com.mysql.jdbc.ConnectionImpl
| 3604 | initializePropsFromServer in ''
| 2542 | connectOneTryOnly in ''
| 2309 | createNewIO in ''
| 834 | <init> . . . . . . in ''
| 46 | <init> in com.mysql.jdbc.JDBC4Connection
| 408 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Error |
2014-09-29 18:48:56,251 [localhost-startStop-1] ERROR pool.ConnectionPool - Unable to create initial connections of pool.
Message: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Line | Method
->> 1094 | createSQLException in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 997 | createSQLException in ''
| 983 | createSQLException in ''
| 928 | createSQLException in ''
| 959 | createSQLException in ''
| 949 | createSQLException in ''
| 432 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 7467 | realClose in com.mysql.jdbc.ResultSetImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 923 | close in ''
| 801 | convertShowWarningsToSQLWarnings in com.mysql.jdbc.SQLError
| 4445 | scanForAndThrowDataTruncation in com.mysql.jdbc.MysqlIO
| 2923 | sqlQueryDirect . . in ''
| 2820 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2769 | execSQL . . . . . in ''
| 1569 | executeQuery in com.mysql.jdbc.StatementImpl
| 4210 | loadServerVariables in com.mysql.jdbc.ConnectionImpl
| 3604 | initializePropsFromServer in ''
| 2542 | connectOneTryOnly in ''
| 2309 | createNewIO in ''
| 834 | <init> . . . . . . in ''
| 46 | <init> in com.mysql.jdbc.JDBC4Connection
| 408 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . . . . . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . . . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Error |
2014-09-29 18:48:56,269 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error initializing the application: 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 java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Message: 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 java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
Line | Method
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by 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 java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by 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 java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by 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 java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by 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 java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by MetaDataAccessException: Error while extracting DatabaseMetaData; nested exception is java.sql.SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 334 | innerRun in java.util.concurrent.FutureTask$Sync
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 166 | run in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run . . . in java.lang.Thread
Caused by SQLException: java.lang.NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 1094 | createSQLException in com.mysql.jdbc.SQLError
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 997 | createSQLException in ''
| 983 | createSQLException in ''
| 928 | createSQLException in ''
| 959 | createSQLException in ''
| 949 | createSQLException in ''
| 432 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
Caused by NoSuchMethodError: com.mysql.jdbc.StatementImpl.removeOpenResultSet(Ljava/sql/ResultSet;)V
->> 7467 | realClose in com.mysql.jdbc.ResultSetImpl
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 923 | close in ''
| 801 | convertShowWarningsToSQLWarnings in com.mysql.jdbc.SQLError
| 4445 | scanForAndThrowDataTruncation in com.mysql.jdbc.MysqlIO
| 2923 | sqlQueryDirect in ''
| 2820 | execSQL in com.mysql.jdbc.ConnectionImpl
| 2769 | execSQL . in ''
| 1569 | executeQuery in com.mysql.jdbc.StatementImpl
| 4210 | loadServerVariables in com.mysql.jdbc.ConnectionImpl
| 3604 | initializePropsFromServer in ''
| 2542 | connectOneTryOnly in ''
| 2309 | createNewIO in ''
| 834 | <init> . in ''
| 46 | <init> in com.mysql.jdbc.JDBC4Connection
| 408 | handleNewInstance in com.mysql.jdbc.Util
| 419 | getInstance in com.mysql.jdbc.ConnectionImpl
| 344 | connect . in com.mysql.jdbc.NonRegisteringDriver
| 334 | innerRun in java.util.concurrent.FutureTask$Sync
| 166 | run . . . in java.util.concurrent.FutureTask
| 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 603 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^ 722 | run in java.lang.Thread
My DataSource.groovy:
dataSource {
pooled = true
jmxExport = true
driverClassName = "com.mysql.jdbc.Driver"
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = false
// cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
singleSession = true // configure OSIV singleSession mode
flush.mode = 'manual' // OSIV session flush mode outside of transactional context
reload = false
}
// environment specific settings
environments {
development {
dataSource {
pooled = true
dbCreate = "update"
url = "jdbc:mysql://localhost:3306/xxx?autoreconnect=true"
driverClassName = "com.mysql.jdbc.Driver"
properties {
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
username = ""
password = ""
}
}
test {
pooled = true
dbCreate = "update"
url = "jdbc:mysql://localhost:3306/xxx?autoreconnect=true"
driverClassName = "com.mysql.jdbc.Driver"
properties {
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
username = ""
password = ""
}
production {
dataSource {
pooled = true
dbCreate = "update"
url = "jdbc:mysql://localhost:3306/xxx?autoreconnect=true"
driverClassName = "com.mysql.jdbc.Driver"
properties {
// See http://grails.org/doc/latest/guide/conf.html#dataSource for documentation
jmxEnabled = true
initialSize = 5
maxActive = 50
minIdle = 5
maxIdle = 25
maxWait = 10000
maxAge = 10 * 60000
timeBetweenEvictionRunsMillis = 5000
minEvictableIdleTimeMillis = 60000
validationQuery = "SELECT 1"
validationQueryTimeout = 3
validationInterval = 15000
testOnBorrow = true
testWhileIdle = true
testOnReturn = false
jdbcInterceptors = "ConnectionState"
defaultTransactionIsolation = java.sql.Connection.TRANSACTION_READ_COMMITTED
}
username = ""
password = ""
}
}
}
Any idea how I could solve these problems?
Please take a look at this post: Grails 2.4.3 fails to reload controller or service
If it doesn´t help please provide your BuildConfig.groovy