3 Replies Latest reply on May 21, 2008 3:11 PM by Tom Nichols

    Problem with Seam application context

    Kris Verheire Newbie

      Hi there,


      I'm trying to get access to the seam context in my custom Servlet. I've followed the tutorial by adding the context-filter to the components.xml file.


      Yet I keep getting the No application context active problem when I call Component.getInstance(name). could someone check my config below and tell me what I am doing wrong ?


      It's probably something trivial but I can't seem to get it.


      my components.xml


      
      <?xml version="1.0" encoding="UTF-8"?>
      
      <components xmlns="http://jboss.com/products/seam/components"
      
        xmlns:core="http://jboss.com/products/seam/core"
      
        xmlns:framework="http://jboss.com/products/seam/framework"
      
        xmlns:web="http://jboss.com/products/seam/web"
      
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      
        xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd 
      
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd 
      
                       http://jboss.com/products/seam/framework http://jboss.com/products/seam/framework-1.2.xsd">
      
        
      
        <core:init jndi-pattern="belgacom-my1x07-front/#{ejbName}/local" debug="true"/>
      
      
        <core:manager conversation-timeout="120000"/>
      
        
      
        <web:redirect-filter url-pattern="*.seam"/>  
      
        
      
        <web:context-filter url-pattern="/results"/>
      
        
      
      </components>
      
      
      




      web.xml (the part that matters)


      
      <listener>
      
            <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
      
         </listener>
      
          
      
          <filter>
      
              <filter-name>Seam Filter</filter-name>
      
              <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
      
          </filter>
      
      
          <filter-mapping>
      
              <filter-name>Seam Filter</filter-name>
      
              <url-pattern>/*</url-pattern>
      
          </filter-mapping>
      
      <servlet> 
      
            <servlet-name>ResultImage servlet</servlet-name>
      
            <servlet-class>be.belgacom.my1x07.front.web.util.GraphicResultsServlet</servlet-class>
      
         </servlet>
      
          
      
         <servlet-mapping>
      
            <servlet-name>ResultImage servlet</servlet-name>
      
            <url-pattern>/results</url-pattern>
      
         </servlet-mapping>
      
      




      a piece of xhtml calling the servlet


      
      <img src="/results?conversationId=#{conversation.id}&amp;view=overview&amp;result=${counter.index}" />
      
      



      Thx in advance.
      Verheire Kris.