Servlet Filter Generator Problem ...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Servlet Filter Generator Problem ...

dschalle
Hi,

I tried to add a servlet filter according to the instruction in a previous thread:

   http://mail-archive.objectweb.org/ops-users/2005-11/msg00010.html

In web.xml I added:

   <filter>
      <filter-name>ops-main-servlet</filter-name>
      <filter-class>org.orbeon.oxf.servlet.OXFServletFilter</filter-class>

      <!-- Set main processor -->
      <init-param>
         <param-name>oxf.main-processor.name</param-name>
         <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value>
      </init-param>
      <init-param>
         <param-name>oxf.main-processor.input.config</param-name>
         <param-value>oxf:/filters/session.xpl</param-value>
      </init-param>

      <!-- Set error processor -->
      <init-param>
         <param-name>oxf.error-processor.name</param-name>
         <param-value>{http://www.orbeon.com/oxf/processors}pipeline</param-value>
      </init-param>
      <init-param>
         <param-name>oxf.error-processor.input.config</param-name>
         <param-value>oxf:/config/error.xpl</param-value>
      </init-param>
   </filter>

   <filter-mapping>
      <filter-name>ops-main-servlet</filter-name>
      <url-pattern>/*</url-pattern>
   </filter-mapping>

The pipeline session.xpl contains a simple test, so I see if the filter is being called:

<p:config
   xmlns:p="http://www.orbeon.com/oxf/pipeline"
   xmlns:oxf="http://www.orbeon.com/oxf/processors">

   <p:processor name="oxf:servlet-filter-generator">
      <p:output name="data" id="request-body"/>
   </p:processor>

   <p:processor name="oxf:null-serializer">
      <p:input name="data" href="#request-body" debug="true"/>
   </p:processor>

</p:config>

When I bring up the website, I get the following exception:

15:54:49,863 INFO  [STDOUT] 2006-08-23 15:54:49,858 ERROR org.orbeon.oxf.webapp.ProcessorService null - Exception at oxf:/filters/session.xpl, line 7, column 44, description reading processor output
org.orbeon.oxf.common.OXFException: Filtered resource did not call getWriter() or getOutputStream().
        at org.orbeon.oxf.processor.StreamInterceptor.parse(StreamInterceptor.java:113)
        at org.orbeon.oxf.processor.ServletResponseWrapper.parse(ServletResponseWrapper.java:162)
        at org.orbeon.oxf.processor.ServletResponseWrapper.parse(ServletResponseWrapper.java:158)
        at org.orbeon.oxf.processor.ServletFilterGenerator$1.readImpl(ServletFilterGenerator.java:63)
        at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:987)
...

Is there anything I'm doing wrong or is there a bug in ServletResponseWrapper?

Thanks,

Dirk



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Servlet Filter Generator Problem ...

Erik Bruchez
Administrator
Dirk,

 > I tried to add a servlet filter according to the instruction in a
 > previous thread:

[...]

 > When I bring up the website, I get the following exception:
 >
 > 15:54:49,863 INFO  [STDOUT] 2006-08-23 15:54:49,858 ERROR
org.orbeon.oxf.webapp.ProcessorService null - Exception at
oxf:/filters/session.xpl, line 7, column 44, description reading
processor output
 > org.orbeon.oxf.common.OXFException: Filtered resource did not call
getWriter() or getOutputStream().
 >         at
org.orbeon.oxf.processor.StreamInterceptor.parse(StreamInterceptor.java:113)
 >         at
org.orbeon.oxf.processor.ServletResponseWrapper.parse(ServletResponseWrapper.java:162)
 >         at
org.orbeon.oxf.processor.ServletResponseWrapper.parse(ServletResponseWrapper.java:158)
 >         at
org.orbeon.oxf.processor.ServletFilterGenerator$1.readImpl(ServletFilterGenerator.java:63)
 >         at
org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:987)
 > ...
 >
 > Is there anything I'm doing wrong or is there a bug in
ServletResponseWrapper?

This means that your filter doesn't receive anything from the filtered
resource. So the key is to figure out why this is the case. What is
the resource loaded by the URL you entered? Try to figure out if it
produces any output at all, and if not why it doesn't.

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws