History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-940
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Graeme Rocher
Reporter: Sergey Nebolsin
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Grails

Error starting Grails application in Tomcat

Created: 18/Mar/07 05:56 PM   Updated: 22/Mar/07 07:54 PM
Component/s: Plugins
Affects Version/s: 0.5-RC1
Fix Version/s: 0.5-RC1

Time Tracking:
Not Specified

Environment: Tomcat 5.5, 6.0, Java 6 SE, Grails SVN HEAD


 Description  « Hide
An exception occurs during startup of Grails application in Tomcat server.

It looks like doArtefactConfiguration() method of DefaultGrailsPluginManager is called during WebApplicationContext creation (in afterPropertiesSet method of GrailsPluginManagerFactoryBean). But at this stage PluginManager is not inited, and plugins are not loaded, so exeption is produced. Maybe doArtefactConfiguration method should be called in GrailsRuntimeConfigurator after initing plugin manager?

Quote from Graeme's answer in maillist:
"the call to doArtefatConfiguration() definitely needs to happy after PluginManager is initialised, obviously this
differs in WAR mode and in run-app mode so we need to find out what will work for both"

Stacktrace:

SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: 
Invocation of init method failed; nested exception is java.lang.IllegalStateException: Must call loadPlugins() before invoking configurational methods on GrailsPluginManager
Caused by: java.lang.IllegalStateException: Must call loadPlugins() before invoking configurational methods on GrailsPluginManager
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.checkInitialised(DefaultGrailsPluginManager.java:513)
        at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.doArtefactConfiguration (DefaultGrailsPluginManager.java:667)
        at org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean.afterPropertiesSet(GrailsPluginManagerFactoryBean.java:72)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods (AbstractAutowireCapableBeanFactory.java:1062)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (AbstractAutowireCapableBeanFactory.java:420)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (DefaultSingletonBeanRegistry.java:141)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean (AbstractBeanFactory.java:156)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
        at org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java:348)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext (ContextLoader.java:246)
        at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:40)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext (ContextLoader.java:184)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java :3827)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
        at org.apache.catalina.core.ContainerBase.addChild (ContainerBase.java:741)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:825)
        at org.apache.catalina.startup.HostConfig.deployWARs (HostConfig.java:714)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1206)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent (HostConfig.java:293)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1307)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1571)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java :1580)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1560)
        at java.lang.Thread.run(Thread.java:619)


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.