You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Benson Margulies <bi...@basistech.com> on 2007/10/13 22:49:24 UTC

disappearing endpoint with seemingly harmless HTTP configuration.

When I use the following http jetty engine configuration, my endpoint(s)
disappear. The ${staticResourceBase} is '/test'. This might be related
to CXF-1110, except that I don't have the DefaultHandler listed here.

The webapp seems to be the culprit, but it's not clear to me why it
should have that effect.

The endpoint's address is /Test.


<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:sec="http://cxf.apache.org/configuration/security"
 xmlns:http="http://cxf.apache.org/transports/http/configuration"
 xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
 xsi:schemaLocation="http://cxf.apache.org/configuration/security
          http://cxf.apache.org/schemas/configuration/security.xsd
            http://cxf.apache.org/transports/http/configuration
            http://cxf.apache.org/schemas/configuration/http-conf.xsd
            http://cxf.apache.org/transports/http-jetty/configuration
            http://cxf.apache.org/schemas/configuration/http-jetty.xsd
            http://www.springframework.org/schema/beans
 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

 <httpj:engine-factory bus="cxf">
  <httpj:engine port="8808">
   <httpj:handlers>
    <bean class="org.mortbay.jetty.handler.RequestLogHandler">
      <property name="requestLog">
        <bean class="org.mortbay.jetty.NCSARequestLog">
         <property name="filename" value="jetty.log"/>
        </bean>
      </property>
    </bean>
    <bean class="org.mortbay.jetty.webapp.WebAppContext">
      <constructor-arg value="${jsunitPathname}"/>
      <constructor-arg value="/jsunit"/>
    </bean>
    <bean class="org.mortbay.jetty.handler.ContextHandler">
     <property name="contextPath" value="/${staticResourceBase}" />
     <property name="handler">
      <bean class="org.mortbay.jetty.handler.ResourceHandler">
       <property name="baseResource">
        <bean class="org.mortbay.resource.FileResource">
         <constructor-arg value="${staticResourceURL}" />
        </bean>
        </property>
      </bean>
     </property>
    </bean>
   </httpj:handlers>
  </httpj:engine>
 </httpj:engine-factory>
</beans>

RE: disappearing endpoint with seemingly harmless HTTP configuration.

Posted by "Jiang, Ning (Willem)" <Ni...@iona.com>.
Hi Benson,

I can reproduce your issue and just did a quick fix for it.
We can't add the DefaultHandler before the CXF context handler, because Jetty's handler list is a fist set fist work list.
If we add the CXF context handler after the DefaultHander,  the DefaultHandler will block all the requests to CXF endpoints.

My fixing is just filting the DefaultHandler from the handler list and adding it after the CXF context handler is set to the Jetty server.
And the http_jetty systest is passed.

Willem.

-----Original Message-----
From: Benson Margulies [mailto:bim2007@basistech.com]
Sent: Sun 10/14/2007 4:53
To: cxf-dev@incubator.apache.org
Subject: RE: disappearing endpoint with seemingly harmless HTTP configuration.
 
Please ignore this, I was confused. CXF-1110, however, seems to be real.

> -----Original Message-----
> From: Benson Margulies [mailto:bim2007@basistech.com]
> Sent: Saturday, October 13, 2007 4:49 PM
> To: cxf-dev@incubator.apache.org
> Subject: disappearing endpoint with seemingly harmless HTTP
configuration.
> 
> When I use the following http jetty engine configuration, my
endpoint(s)
> disappear. The ${staticResourceBase} is '/test'. This might be related
> to CXF-1110, except that I don't have the DefaultHandler listed here.
> 
> The webapp seems to be the culprit, but it's not clear to me why it
> should have that effect.
> 
> The endpoint's address is /Test.
> 
> 
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns:sec="http://cxf.apache.org/configuration/security"
>  xmlns:http="http://cxf.apache.org/transports/http/configuration"
>
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
> xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
>  xsi:schemaLocation="http://cxf.apache.org/configuration/security
>           http://cxf.apache.org/schemas/configuration/security.xsd
>             http://cxf.apache.org/transports/http/configuration
>             http://cxf.apache.org/schemas/configuration/http-conf.xsd
>             http://cxf.apache.org/transports/http-jetty/configuration
>             http://cxf.apache.org/schemas/configuration/http-jetty.xsd
>             http://www.springframework.org/schema/beans
> 
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
> 
>  <httpj:engine-factory bus="cxf">
>   <httpj:engine port="8808">
>    <httpj:handlers>
>     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
>       <property name="requestLog">
>         <bean class="org.mortbay.jetty.NCSARequestLog">
>          <property name="filename" value="jetty.log"/>
>         </bean>
>       </property>
>     </bean>
>     <bean class="org.mortbay.jetty.webapp.WebAppContext">
>       <constructor-arg value="${jsunitPathname}"/>
>       <constructor-arg value="/jsunit"/>
>     </bean>
>     <bean class="org.mortbay.jetty.handler.ContextHandler">
>      <property name="contextPath" value="/${staticResourceBase}" />
>      <property name="handler">
>       <bean class="org.mortbay.jetty.handler.ResourceHandler">
>        <property name="baseResource">
>         <bean class="org.mortbay.resource.FileResource">
>          <constructor-arg value="${staticResourceURL}" />
>         </bean>
>         </property>
>       </bean>
>      </property>
>     </bean>
>    </httpj:handlers>
>   </httpj:engine>
>  </httpj:engine-factory>
> </beans>


RE: disappearing endpoint with seemingly harmless HTTP configuration.

Posted by Benson Margulies <bi...@basistech.com>.
Please ignore this, I was confused. CXF-1110, however, seems to be real.

> -----Original Message-----
> From: Benson Margulies [mailto:bim2007@basistech.com]
> Sent: Saturday, October 13, 2007 4:49 PM
> To: cxf-dev@incubator.apache.org
> Subject: disappearing endpoint with seemingly harmless HTTP
configuration.
> 
> When I use the following http jetty engine configuration, my
endpoint(s)
> disappear. The ${staticResourceBase} is '/test'. This might be related
> to CXF-1110, except that I don't have the DefaultHandler listed here.
> 
> The webapp seems to be the culprit, but it's not clear to me why it
> should have that effect.
> 
> The endpoint's address is /Test.
> 
> 
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xmlns:sec="http://cxf.apache.org/configuration/security"
>  xmlns:http="http://cxf.apache.org/transports/http/configuration"
>
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
> xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
>  xsi:schemaLocation="http://cxf.apache.org/configuration/security
>           http://cxf.apache.org/schemas/configuration/security.xsd
>             http://cxf.apache.org/transports/http/configuration
>             http://cxf.apache.org/schemas/configuration/http-conf.xsd
>             http://cxf.apache.org/transports/http-jetty/configuration
>             http://cxf.apache.org/schemas/configuration/http-jetty.xsd
>             http://www.springframework.org/schema/beans
> 
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
> 
>  <httpj:engine-factory bus="cxf">
>   <httpj:engine port="8808">
>    <httpj:handlers>
>     <bean class="org.mortbay.jetty.handler.RequestLogHandler">
>       <property name="requestLog">
>         <bean class="org.mortbay.jetty.NCSARequestLog">
>          <property name="filename" value="jetty.log"/>
>         </bean>
>       </property>
>     </bean>
>     <bean class="org.mortbay.jetty.webapp.WebAppContext">
>       <constructor-arg value="${jsunitPathname}"/>
>       <constructor-arg value="/jsunit"/>
>     </bean>
>     <bean class="org.mortbay.jetty.handler.ContextHandler">
>      <property name="contextPath" value="/${staticResourceBase}" />
>      <property name="handler">
>       <bean class="org.mortbay.jetty.handler.ResourceHandler">
>        <property name="baseResource">
>         <bean class="org.mortbay.resource.FileResource">
>          <constructor-arg value="${staticResourceURL}" />
>         </bean>
>         </property>
>       </bean>
>      </property>
>     </bean>
>    </httpj:handlers>
>   </httpj:engine>
>  </httpj:engine-factory>
> </beans>