Closed rawi2 closed 4 years ago
I am debugging the issue. Meanwhile, you could workaround the problem by removing the following dependency:
developmentOnly("org.springframework.boot:spring-boot-devtools")
Thank you very much puneetbehl. It starts this way. I'm experiencing a problem after changes in Controllers in developer mode: Though a change and recompiling would be noted on the console, the change wouldn't be active and used until I stop Grails and run-app again. To long to wait, to really enjoy... Could this be a side effect of removing the one dependency you mentioned above?
Yes, there is some issue when the interface reloads because the Class<?> interfaceType
reference value is different from the one in the servicesByInterface
Map here: https://github.com/grails/grails-data-mapping/blob/master/grails-datastore-core/src/main/groovy/org/grails/datastore/mapping/services/DefaultServiceRegistry.groovy#L79
Right now, I am trying to focus on Grails 4.1.0 with Groovy 3 but I would need to check why it is failing now vs 4.0.3.
The reloading would not work once you remove the above dependency.
I understand that Grails 4.1.0 is a more important step. Sorry that this issue is no more "in progress". I'll go back to 4.0.3. Thanks again and I wish you much success with 4.1.0
This needs to be fixed before 4.1.0 as it would be the problem in that too. However, I am in middle of something at the moment and would look at it once I am done with the same.
Please feel free to send a PR if you could track and fix the problem.
Given the severity and expected delay in a fix, would it not make sense to remove 4.0.4 at this point in time?
Thank you all for looking into this issue. I'm not in your professional league and I don't understand what's going behind the curtains. I kept the 4.0.4 install and reverted only the dependencies of an application to the ones of 4.0.3 and it works this way; despite having 4.0.4 installed and grailsVersion=4.0.3 in gradle.properties
A potential fix would be to change the serviceMap
and servicesByInterface
key to a fully qualified class name instead of Class
in the following:
Also, you need to update the following implementation of def <T> T getService(Class<T> interfaceType) throws ServiceNotFoundException
as following:
@Override
def <T> T getService(Class<T> interfaceType) throws ServiceNotFoundException {
Service s = servicesByInterface.get(interfaceType.getName())
if(s == null) {
throw new ServiceNotFoundException("No service found for type $interfaceType")
}
return (T) s
}
would it not make sense to remove 4.0.4 at this point in time?
No, I do not think it makes sense to remove 4.0.4 at this point in time.
Is there a work-around until the next version of Grails is released? Thanks.
Please update gorm.version
property in gradle.properties to 7.0.7
I tried that once and it didn't change anything.
Changing gormVersion
property in gradle.properties didn't work (by itself) for me either but the following seems to work around the issue:
In build.gradle, dependencies block:
compile "org.grails:grails-datastore-core:$gormVersion"
compile "org.grails:grails-datastore-gorm:$gormVersion"
compile "org.grails:grails-datastore-gorm-support:$gormVersion"
compile "org.grails:grails-datastore-gorm-test:$gormVersion"
compile "org.grails:grails-datastore-gorm-validation:$gormVersion"
compile "org.grails:grails-datastore-web:$gormVersion"
(make sure gormVersion
is 7.0.7.RELEASE
in gradle.properties)
@chrisbrookes It shouold be gorm.version
.
@puneetbehl Thanks, that works. There was confusion because grails create-app
creates a skeleton app that has the following in the gradle.properties:
grailsVersion=4.0.4
gormVersion=7.0.6.RELEASE
i.e. gormVersion
not gorm.version
.
Right, I think property gormVersion
is used in build.gradle whereas gorm.version
is used to update the GORM version via BOM. See the following:
https://github.com/grails/grails-core/blob/v4.0.4/build.gradle#L60
I can not start a new test application with version 4.0.4 because init doesn't find the Service. The same with an application, which works on 4.0.3 (developer mode)
Task List
Steps to Reproduce
Expected Behaviour
Application should start
Actual Behaviour
init fails because it can not find the BookService. All the necessary files are in place
Stacktrace
Environment Information
$ java -version java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
package test class Book { String name static constraints = { } }