Hi, all! I'm migrating an app from Grails 4 to Gra...
# questions
m
Hi, all! I'm migrating an app from Grails 4 to Grails 6. I have code below that worked in grails 4. And it didn't work in Grails 6.
Copy code
List<InformacoesJob> jobs = getJobs()
		InformacoesJob jobAExecutar = jobs.find { it.classe.canonicalName.equals(jobCanonicalName) }
		if (!jobAExecutar) return

		def jobBean = Holders.grailsApplication.getMainContext().getBean(jobAExecutar.classe.canonicalName)
error occurred while calling getBean(): org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'classeTestJob' available at io.micronaut.spring.context.factory.MicronautBeanFactory.doGetBean(MicronautBeanFactory.java:768) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:284) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:209) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1171) at br.unisantos.jobs.JobDetectorService.executar(JobDetectorService.groovy:55)
j
https://docs.grails.org/6.2.3/guide/spring.html#springdslAdditional I would check your bean configuration for classeTestJob and add it if it is missing.