title: sl4j error in weblogic when deploying grails application war
body: <p>I create a WAR for my grails application and when I deploy it in Weblogic 12c server I get the following Exception</p>
  
  <pre><code>&lt;Mar 27, 2012 12:38:55 PM PDT&gt; &lt;Warning&gt; &lt;HTTP&gt; &lt;BEA-101162&gt; &lt;User defined listener org.codehaus.groovy.grails.web.context.GrailsC
  ontextLoaderListener failed: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/Strin
  g;ILjava/lang/String;Ljava/lang/Throwable;)V.
  java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/la
  ng/Throwable;)V
          at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
          at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
          at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
          at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:582)
          at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
          Truncated. see log file for complete stacktrace
  &gt;
  &lt;Mar 27, 2012 12:38:55 PM PDT&gt; &lt;Error&gt; &lt;HTTP&gt; &lt;BEA-101165&gt; &lt;Could not load user defined filter in web.xml: org.codehaus.groovy.gra
  ils.web.sitemesh.GrailsPageFilter.
  com.opensymphony.module.sitemesh.factory.FactoryException: Could not initialize DecoratorMapper : org.codehaus.groovy.grails.web.s
  itemesh.GrailsLayoutDecoratorMapper: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener reg
  istered?
          at com.opensymphony.module.sitemesh.factory.BaseFactory.pushDecoratorMapper(BaseFactory.java:117)
          at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadDecoratorMappers(Grails5535Factory.java:235)
          at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadConfig(Grails5535Factory.java:98)
          at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.&lt;init&gt;(Grails5535Factory.java:66)
          at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.init(GrailsPageFilter.java:79)
          Truncated. see log file for complete stacktrace
  &gt;
  &lt;Mar 27, 2012 12:38:55 PM PDT&gt; &lt;Error&gt; &lt;HTTP&gt; &lt;BEA-101165&gt; &lt;Could not load user defined filter in web.xml: org.codehaus.groovy.gra
  ils.web.mapping.filter.UrlMappingsFilter.
  java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
          at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationConte
  xtUtils.java:84)
          at org.codehaus.groovy.grails.web.util.WebUtils.lookupHandlerInterceptors(WebUtils.java:97)
          at org.codehaus.groovy.grails.web.mapping.filter.UrlMappingsFilter.initFilterBean(UrlMappingsFilter.java:77)
          at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:179)
          at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:576)
          Truncated. see log file for complete stacktrace
  &gt;
  &lt;Mar 27, 2012 12:38:55 PM PDT&gt; &lt;Error&gt; &lt;HTTP&gt; &lt;BEA-101165&gt; &lt;Could not load user defined filter in web.xml: org.codehaus.groovy.gra
  ils.web.servlet.mvc.GrailsWebRequestFilter.
  java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
          at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationConte
  xtUtils.java:84)
          at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.initialize(GrailsWebRequestFilter.java:98)
          at org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.initFilterBean(GrailsWebRequestFilter.java:94)
          at org.springframework.web.filter.GenericFilterBean.init(GenericFilterBean.java:179)
          at weblogic.servlet.internal.FilterManager$FilterInitAction.run(FilterManager.java:576)
          Truncated. see log file for complete stacktrace
  &gt;
  &lt;Mar 27, 2012 12:38:55 PM PDT&gt; &lt;Error&gt; &lt;HTTP&gt; &lt;BEA-101216&gt; &lt;Servlet: "grails" failed to preload on startup in Web application: "gr
  a.war".
  java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/la
  ng/Throwable;)V
          at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:301)
          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
          at javax.servlet.GenericServlet.init(GenericServlet.java:240)
          at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
          Truncated. see log file for complete stacktrace
  &gt;
  &lt;Mar 27, 2012 12:39:03 PM PDT&gt; &lt;Error&gt; &lt;Deployer&gt; &lt;BEA-149265&gt; &lt;Failure occurred in the execution of deployment request with ID "1
  332877104876" for task "0". Error is: "weblogic.application.ModuleException: [HTTP:101216]Servlet: "grails" failed to preload on s
  tartup in Web application: "gra.war".
  java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/la
  ng/Throwable;)V
          at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:301)
          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
          at javax.servlet.GenericServlet.init(GenericServlet.java:240)
          at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
          at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:250)
          at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
          at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
          at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
          at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94)
          at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82)
          at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
          at weblogic.servlet.internal.StubLifecycleHelper.&lt;init&gt;(StubLifecycleHelper.java:60)
          at weblogic.servlet.internal.StubLifecycleHelper.&lt;init&gt;(StubLifecycleHelper.java:34)
          at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:638)
          at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:579)
          at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1874)
          at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1848)
          at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1738)
          at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740)
          at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1704)
          at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
          at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
          at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:212)
          at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:111)
          at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
          at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
          at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)
          at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
          at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)
          at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:48)
          at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
          at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
          at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:582)
          at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:148)
          at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:114)
          at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:335)
          at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
          at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
          at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
          at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
          at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCa
  llbackDeliverer.java:195)
          at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallback
  Deliverer.java:13)
          at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliv
  erer.java:68)
          at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
          at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
          at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
  "
  weblogic.application.ModuleException: [HTTP:101216]Servlet: "grails" failed to preload on startup in Web application: "gra.war".
  java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/la
  ng/Throwable;)V
          at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:301)
          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
          at javax.servlet.GenericServlet.init(GenericServlet.java:240)
          at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
          at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:250)
          at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
          at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
          at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
          at weblogic.servlet.internal.StubSecurityHelper.initServletInstance(StubSecurityHelper.java:94)
          at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:82)
          at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:74)
          at weblogic.servlet.internal.StubLifecycleHelper.&lt;init&gt;(StubLifecycleHelper.java:60)
          at weblogic.servlet.internal.StubLifecycleHelper.&lt;init&gt;(StubLifecycleHelper.java:34)
          at weblogic.servlet.internal.ServletStubImpl.initStubLifecycleHelper(ServletStubImpl.java:638)
          at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:579)
          at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1874)
          at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1848)
          at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1738)
          at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740)
          at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1704)
          at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
          at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
          at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:212)
          at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:111)
          at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
          at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
          at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)
          at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
          at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)
          at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:48)
          at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
          at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
          at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:582)
          at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:148)
          at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:114)
          at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:335)
          at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
          at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
          at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
          at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
          at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCa
  llbackDeliverer.java:195)
          at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallback
  Deliverer.java:13)
          at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliv
  erer.java:68)
          at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
          at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
          at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
  
          at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1706)
          at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
          at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
          at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
          Truncated. see log file for complete stacktrace
  Caused By: java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/Stri
  ng;Ljava/lang/Throwable;)V
          at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:301)
          at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
          at javax.servlet.GenericServlet.init(GenericServlet.java:240)
          at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:299)
          Truncated. see log file for complete stacktrace
  &gt;
  &lt;Mar 27, 2012 12:39:04 PM PDT&gt; &lt;Error&gt; &lt;Deployer&gt; &lt;BEA-149202&gt; &lt;Encountered an exception while attempting to commit the 1 task for
   the application "gra".&gt;
  &lt;Mar 27, 2012 12:39:04 PM PDT&gt; &lt;Warning&gt; &lt;Deployer&gt; &lt;BEA-149004&gt; &lt;Failures were detected while initiating deploy task for applicat
  ion "gra".&gt;
  &lt;Mar 27, 2012 12:39:04 PM PDT&gt; &lt;Warning&gt; &lt;Deployer&gt; &lt;BEA-149078&gt; &lt;Stack trace for message 149004
  weblogic.application.ModuleException: [HTTP:101216]Servlet: "grails" failed to preload on startup in Web application: "gra.war".
  java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;Ljava/la
  ng/Throwable;)V
          at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
          at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:301)
  </code></pre>
  
  <p>The Entire Trace is really long but basically as I am seeing it, it looks like some isuue with Sl4j api. Not sure what is the cause since the application runs fine when I do run-app directly without WAR and even with the WAR delpoyed in Tomcat Server v6</p>
  
  <p>Thanks in advance</p>