title: Jboss seam custom servlet "No active event context"
body: <p>I have jboss seam web service. I am mapping my service class in web.xml as follows </p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;pluginhandler&lt;/servlet-name&gt;
      &lt;servlet-class&gt;service.PlugInHandler&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;pluginhandler&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt; 
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I read on some blog that if you are using a custom servlet in jboss seam , then you have to add filter org.jboss.seam.servlet.SeamServletFilter to generate all the required contexts which i might need to talk to seam components </p>
  
  <pre><code>&lt;filter&gt;
      &lt;filter-name&gt;Seam Servlet Filter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.jboss.seam.servlet.SeamServletFilter&lt;/filter-class&gt;
  &lt;/filter&gt; 
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;Seam Servlet Filter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt; 
  </code></pre>
  
  <p>I have a seam component Action which I am trying to instantiate in web method , but i keep getting null pointer exception on that (when i try to invoke its method) and the root cause is "No active event context". I have attached the stack of exception as follows</p>
  
  <pre><code>    Servlet.service() for servlet pluginhandler threw exception
  java.lang.IllegalStateException: No active event context
      at org.jboss.seam.core.Manager.instance(Manager.java:250)
      at org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:55)
      at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
      at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>I do not have any idea what might be wrong. Is it some specific configuration that I am missing to use custom servlets?
  I would highly appreciate your help and time. i am using seam 2.0.1.GA and jboss version is 4.2.2.GA</p>
  
  <p>Thanks</p>