Search code examples
javaspringhibernatedockergrails

Grails application error on startup


I have a Grails app, but when I start it I get the following Exception.

ERROR --- [main] o.s.boot.SpringApplication: Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplicationPostProcessor' defined in Dito.DocumentEngine.Application: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [grails.boot.config.GrailsApplicationPostProcessor]: Factory method 'grailsApplicationPostProcessor' threw exception; nested exception is org.grails.core.exceptions.GrailsConfigurationException: XML parsing error loading core plugins: Premature end of file. 
        at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599) 
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1173) 
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1067) 
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) 
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) 
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) 
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) 
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) 
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) 
        at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:115) 
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:686) 
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:524) 
        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 Dito.DocumentEngine.Application.main(Application.groovy:8)

There are similar question but none seem to work as those are not the same problem.

Below this error I get the next exception

Execution failed for task ':bootRun'. 
Process 'command '/usr/lib/jvm/java-8-openjdk-amd64/bin/java'' finished with non-zero exit value 1 

I am running the application from a Docker container.

Thanks for any help I can get.


Solution

  • Not sure why but I was missing a /gradle directory in my app's root folder. Apparently it was deleted with something I did.

    Copied it from another project we had and that solved the issue.