Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App fail to start with dataservice #1396

Closed
magnomp opened this issue Nov 4, 2020 · 1 comment
Closed

App fail to start with dataservice #1396

magnomp opened this issue Nov 4, 2020 · 1 comment

Comments

@magnomp
Copy link

magnomp commented Nov 4, 2020

Steps to Reproduce

  1. Create a new Grails app with grails create-app XXX
  2. Create a domain class like:
    `package dataservicetest

class MyDomain {
String name
}`

  1. Create dataservice under grails-app/services like:
    `package dataservicetest

import grails.gorm.services.Service

@service(MyDomain)
interface MyDomainDataservice {
}`

  1. Run with gradlew bootRun

Expected Behaviour

App should run as any fresh new grails app

Actual Behaviour

App start fails with
> :bootRun org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testeDataService': Invocation of init method failed; nested exception is org.grails.datastore.mapping.services.ServiceNotFoundException: No service found for type interface teste.TesteDataService at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1771) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:841) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) at grails.boot.GrailsApp.run(GrailsApp.groovy:99) at grails.boot.GrailsApp.run(GrailsApp.groovy:485) at grails.boot.GrailsApp.run(GrailsApp.groovy:472) at teste.Application.main(Application.groovy:11) 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:498) at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) Caused by: org.grails.datastore.mapping.services.ServiceNotFoundException: No service found for type interface teste.TesteDataService at org.grails.datastore.mapping.services.DefaultServiceRegistry.getService(DefaultServiceRegistry.groovy:81) at org.grails.datastore.mapping.core.AbstractDatastore.getService(AbstractDatastore.java:102) at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:280) at org.springframework.beans.factory.config.MethodInvokingBean.invokeWithTargetException(MethodInvokingBean.java:123) at org.grails.datastore.mapping.config.DatastoreServiceMethodInvokingFactoryBean.invokeWithTargetException(DatastoreServiceMethodInvokingFactoryBean.groovy:30) at org.springframework.beans.factory.config.MethodInvokingFactoryBean.afterPropertiesSet(MethodInvokingFactoryBean.java:108) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1830) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1767) ... 22 common frames omitted

Environment Information

  • Operating System: Windows 10 x64
  • GORM Version: 7
  • Grails Version (if using Grails): 4.0.4
  • JDK Version: 1.8.0_251

Example Application

https://github.com/magnomp/dataservice-issue-demo

@puneetbehl
Copy link
Contributor

Please update to GORM 7.0.7 in the gradle.properties as:

gorm.version=7.0.7.RELEASE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants