Hi,
I want to access the MgnlContext within my modules's stop() method.
Unfortunately I get the following Exception telling me that the Context is not
initialized:
2013-05-27 11:00:00,955 ERROR info.magnolia.context.MgnlContext
: MgnlContext is not initialized. This could happen if the request does not go
through the Magnolia default filters.
java.lang.IllegalStateException: MgnlContext is not set for this thread
at info.magnolia.context.MgnlContext.getInstance(MgnlContext.java:297)
at
info.magnolia.context.MgnlContext.getHierarchyManager(MgnlContext.java:125)
at de.exa.RBLModule.stop(RBLModule.java:88)
at
info.magnolia.module.ModuleManagerImpl.stopModule(ModuleManagerImpl.java:399)
at
info.magnolia.module.ModuleManagerImpl.stopModules(ModuleManagerImpl.java:469)
at
info.magnolia.init.MagnoliaServletContextListener.contextDestroyed(MagnoliaServletContextListener.java:197)
at
info.magnolia.cms.servlets.MgnlServletContextListener.contextDestroyed(MgnlServletContextListener.java:59)
at
org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4244)
at
org.apache.catalina.core.StandardContext.stop(StandardContext.java:4879)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1106)
at org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1106)
at org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:468)
at
org.apache.catalina.core.StandardService.stop(StandardService.java:604)
at org.apache.catalina.core.StandardServer.stop(StandardServer.java:788)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:662)
at org.apache.catalina.startup.Catalina.start(Catalina.java:629)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Is there any way to access the MgnlContext during module shutdown? I need to
use the context in order to save nodes from the JCR.
Thank you very much for your time and help,
Jonas
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=f9899beb-334d-4cb2-99b6-65c2c52a709e
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------