You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Mukarram Baig <mu...@gmail.com> on 2013/05/27 19:04:27 UTC
Using jcifs in cxf embedded jetty in spring
I have a sample JAX-RS service being exposed via the awesome jaxrs:server
directive via cxf + spring. I wanted to configure the underlying jetty
being started to also set the username via jcifs and am resorting to
configuring it via the httpj directive from cxf again.
<httpj:engine-factory bus="cxf">
<httpj:engine host="#{inetAddress.hostName}"
port="${com.kilo.restful.port}">
<httpj:handlers>
<bean class="org.eclipse.jetty.servlet.ServletContextHandler">
<property name="servletHandler">
<bean class="org.eclipse.jetty.servlet.ServletHandler">
<property name="filters">
<list>
<bean
class="org.eclipse.jetty.servlet.FilterHolder">
<property name="name" value="NTLMFilter" />
<property name="filter">
<bean
class="jcifs.http.NtlmHttpFilter"/>
</property>
<property name="initParameters">
<map>
<entry
key="jcifs.http.domainController" value="domaincontroller.kilo.com" />
</map>
</property>
</bean>
</list>
</property>
<property name="filterMappings">
<list>
<bean
class="org.eclipse.jetty.servlet.FilterMapping">
<property name="pathSpec">
<value>/*</value>
</property>
<property name="filterName"
value="NTLMFilter" />
</bean>
</list>
</property>
</bean>
</property>
</bean>
</httpj:handlers>
</httpj:engine></httpj:engine-factory>
However, I don't see the control reaching the doFilter call of NtlmFilter
though the filter seems to get initialized alright. Have been trying to
figure out what may go wrong and have wasted the better part of my day
already.
Any pointers will help! Thanks in advance!
Ref:
http://stackoverflow.com/questions/16776974/using-jcifs-in-cxf-embedded-jetty-in-spring
Re: Using jcifs in cxf embedded jetty in spring
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 05/06/13 15:23, Mukarram Baig wrote:
> Hello Sergey,
>
> I am using the embedded jetty if that is what you meant by servlet
> container that kicks when there is no servlet container (like tomcat),
> so there is no web.xml as such. I was thinking that our httpj spring
> namespace would be helpful in getting rid of web.xml completely, right?
> Please correct me if httpj is not meant to solve configuration of the
> embedded jetty.
>
It is, but I wonder if "org.eclipse.jetty.servlet.ServletContextHandler"
effective when CXF uses Jetty in a standalone mode - I'm suspecting it
may be not.
Please check the archives, I recall users were asking how to do Spring
Security with standalone Jetty, which otherwise would require Servlet
filters being declared in web.xml, I guess you may be able to do it
similarly to whatever has been advised there.
Perhaps alternatively you can call somehow that NTLM filter directly
from CXF interceptor and then setup a Security Context on the current
CXF message
Sergey
> Thanks in advance!
>
>
> On Mon, Jun 3, 2013 at 11:18 PM, Sergey Beryozkin <sberyozkin@gmail.com
> <ma...@gmail.com>> wrote:
>
> Hi
>
> On Mon, May 27, 2013 at 6:04 PM, Mukarram Baig
> <mukarram.baig@gmail.com <ma...@gmail.com>>wrote:
>
> > I have a sample JAX-RS service being exposed via the awesome
> jaxrs:server
> > directive via cxf + spring. I wanted to configure the underlying
> jetty
> > being started to also set the username via jcifs and am resorting to
> > configuring it via the httpj directive from cxf again.
> >
> > <httpj:engine-factory bus="cxf">
> > <httpj:engine host="#{inetAddress.hostName}"
> > port="${com.kilo.restful.port}">
> > <httpj:handlers>
> > <bean
> class="org.eclipse.jetty.servlet.ServletContextHandler">
> > <property name="servletHandler">
> > <bean
> class="org.eclipse.jetty.servlet.ServletHandler">
> > <property name="filters">
> > <list>
> > <bean
> >
> > class="org.eclipse.jetty.servlet.FilterHolder">
> > <property name="name"
> > value="NTLMFilter" />
> > <property name="filter">
> > <bean
> > class="jcifs.http.NtlmHttpFilter"/>
> > </property>
> > <property name="initParameters">
> > <map>
> > <entry
> > key="jcifs.http.domainController"
> value="domaincontroller.kilo.com <http://domaincontroller.kilo.com>" />
> > </map>
> > </property>
> > </bean>
> > </list>
> > </property>
> > <property name="filterMappings">
> > <list>
> > <bean
> > class="org.eclipse.jetty.servlet.FilterMapping">
> > <property name="pathSpec">
> > <value>/*</value>
> > </property>
> > <property name="filterName"
> > value="NTLMFilter" />
> > </bean>
> > </list>
> > </property>
> > </bean>
> > </property>
> > </bean>
> > </httpj:handlers>
> > </httpj:engine></httpj:engine-factory>
> >
> >
> > However, I don't see the control reaching the doFilter call of
> NtlmFilter
> > though the filter seems to get initialized alright. Have been
> trying to
> > figure out what may go wrong and have wasted the better part of
> my day
> > already.
> >
> > Any pointers will help! Thanks in advance!
> >
> > Ref:
> >
> >
> http://stackoverflow.com/questions/16776974/using-jcifs-in-cxf-embedded-jetty-in-spring
> >
>
>
> Is Servlet Container used internally ? If yes then please add the filter
> within web.xml
>
> Cheers, Sergey
>
>
Re: Using jcifs in cxf embedded jetty in spring
Posted by Mukarram Baig <mu...@gmail.com>.
Hello Sergey,
I am using the embedded jetty if that is what you meant by servlet
container that kicks when there is no servlet container (like tomcat), so
there is no web.xml as such. I was thinking that our httpj spring namespace
would be helpful in getting rid of web.xml completely, right? Please
correct me if httpj is not meant to solve configuration of the embedded
jetty.
Thanks in advance!
On Mon, Jun 3, 2013 at 11:18 PM, Sergey Beryozkin <sb...@gmail.com>wrote:
> Hi
>
> On Mon, May 27, 2013 at 6:04 PM, Mukarram Baig <mukarram.baig@gmail.com
> >wrote:
>
> > I have a sample JAX-RS service being exposed via the awesome jaxrs:server
> > directive via cxf + spring. I wanted to configure the underlying jetty
> > being started to also set the username via jcifs and am resorting to
> > configuring it via the httpj directive from cxf again.
> >
> > <httpj:engine-factory bus="cxf">
> > <httpj:engine host="#{inetAddress.hostName}"
> > port="${com.kilo.restful.port}">
> > <httpj:handlers>
> > <bean
> class="org.eclipse.jetty.servlet.ServletContextHandler">
> > <property name="servletHandler">
> > <bean
> class="org.eclipse.jetty.servlet.ServletHandler">
> > <property name="filters">
> > <list>
> > <bean
> >
> > class="org.eclipse.jetty.servlet.FilterHolder">
> > <property name="name"
> > value="NTLMFilter" />
> > <property name="filter">
> > <bean
> > class="jcifs.http.NtlmHttpFilter"/>
> > </property>
> > <property name="initParameters">
> > <map>
> > <entry
> > key="jcifs.http.domainController" value="domaincontroller.kilo.com" />
> > </map>
> > </property>
> > </bean>
> > </list>
> > </property>
> > <property name="filterMappings">
> > <list>
> > <bean
> > class="org.eclipse.jetty.servlet.FilterMapping">
> > <property name="pathSpec">
> > <value>/*</value>
> > </property>
> > <property name="filterName"
> > value="NTLMFilter" />
> > </bean>
> > </list>
> > </property>
> > </bean>
> > </property>
> > </bean>
> > </httpj:handlers>
> > </httpj:engine></httpj:engine-factory>
> >
> >
> > However, I don't see the control reaching the doFilter call of NtlmFilter
> > though the filter seems to get initialized alright. Have been trying to
> > figure out what may go wrong and have wasted the better part of my day
> > already.
> >
> > Any pointers will help! Thanks in advance!
> >
> > Ref:
> >
> >
> http://stackoverflow.com/questions/16776974/using-jcifs-in-cxf-embedded-jetty-in-spring
> >
>
>
> Is Servlet Container used internally ? If yes then please add the filter
> within web.xml
>
> Cheers, Sergey
>
Re: Using jcifs in cxf embedded jetty in spring
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On Mon, May 27, 2013 at 6:04 PM, Mukarram Baig <mu...@gmail.com>wrote:
> I have a sample JAX-RS service being exposed via the awesome jaxrs:server
> directive via cxf + spring. I wanted to configure the underlying jetty
> being started to also set the username via jcifs and am resorting to
> configuring it via the httpj directive from cxf again.
>
> <httpj:engine-factory bus="cxf">
> <httpj:engine host="#{inetAddress.hostName}"
> port="${com.kilo.restful.port}">
> <httpj:handlers>
> <bean class="org.eclipse.jetty.servlet.ServletContextHandler">
> <property name="servletHandler">
> <bean class="org.eclipse.jetty.servlet.ServletHandler">
> <property name="filters">
> <list>
> <bean
>
> class="org.eclipse.jetty.servlet.FilterHolder">
> <property name="name"
> value="NTLMFilter" />
> <property name="filter">
> <bean
> class="jcifs.http.NtlmHttpFilter"/>
> </property>
> <property name="initParameters">
> <map>
> <entry
> key="jcifs.http.domainController" value="domaincontroller.kilo.com" />
> </map>
> </property>
> </bean>
> </list>
> </property>
> <property name="filterMappings">
> <list>
> <bean
> class="org.eclipse.jetty.servlet.FilterMapping">
> <property name="pathSpec">
> <value>/*</value>
> </property>
> <property name="filterName"
> value="NTLMFilter" />
> </bean>
> </list>
> </property>
> </bean>
> </property>
> </bean>
> </httpj:handlers>
> </httpj:engine></httpj:engine-factory>
>
>
> However, I don't see the control reaching the doFilter call of NtlmFilter
> though the filter seems to get initialized alright. Have been trying to
> figure out what may go wrong and have wasted the better part of my day
> already.
>
> Any pointers will help! Thanks in advance!
>
> Ref:
>
> http://stackoverflow.com/questions/16776974/using-jcifs-in-cxf-embedded-jetty-in-spring
>
Is Servlet Container used internally ? If yes then please add the filter
within web.xml
Cheers, Sergey