After replacing the OsgiServletRegisterer with :

<!--<bean 
class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer" 
init-method="register" destroy-method="unregister">-->
        <!--<property name="alias" value="${rest.alias}"/>-->
        <!--<property name="httpService" ref="httpService"/>-->
        <!--<property name="servlet" 
ref="dutchCustomsHtml2RssCamelServlet"/>-->
        <!--<property name="servletName" 
value="dutchCustomsHtml2RssCamelServlet"/>-->
    <!--</bean>-->

    <service id="whiteBoardServletService" ref=
"dutchCustomsHtml2RssCamelServlet" interface="javax.servlet.Servlet">
        <service-properties>
            <entry key="alias" value="${rest.alias}"/>
            <entry key="servletName" value=
"dutchCustomsHtml2RssCamelServlet"/>
        </service-properties>
    </service>

the servletEvent gets hit in Pax Web HttpServiceStartet. 

Karaf reports:

karaf@root()> http:list
ID │ Servlet                   │ Servlet-Name    │ State       │ Alias     
                  │ Url
───┼───────────────────────────┼─────────────────┼─────────────┼─────────────────────────────┼────────────────────────────────
88 │ JolokiaServlet            │ ServletModel-2  │ Undeployed  │ /jolokia   
                 │ [/jolokia/*]
88 │ JolokiaServlet            │ ServletModel-5  │ Deployed    │ /jolokia   
                 │ [/jolokia/*]
97 │ CamelHttpTransportServlet │ ServletModel-14 │ Deployed    │ /api/rest/
rss/douane-status │ [/api/rest/rss/douane-status/*]

but Camel does not dispath my HTTP GET request, i get a 404. Some 
CamelServlet thingies seem to be missing.


Am Freitag, 9. Februar 2018 08:15:24 UTC+1 schrieb Grzegorz Grzybek:
>
> Maurice - you probably can (I didn't try). I'm not sure what 
> OsgiServletRegisterer does, but with pax-http-whiteboard, you can just 
> register HttpServlet as osgi service and have it picked up and registered 
> in http service. I recommend you try the samples in 
> https://github.com/ops4j/org.ops4j.pax.web/tree/pax-web-6.1.x/samples
>
> best regards
> Grzegorz Grzybek
>
> 2018-02-07 15:28 GMT+01:00 Maurice Betzel <betze...@gmail.com 
> <javascript:>>:
>
>> Question, can i register a camel servlet on the pax web blueprint 
>> services?
>> Now i am using:
>>
>> Code hier eingeben...
>>
>> <reference id="httpService" interface="org.osgi.service.http.HttpService"/>
>>
>> <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer" 
>> init-method="register" destroy-method="unregister">
>>     <property name="alias" value="${rest.alias}"/>
>>     <property name="httpService" ref="httpService"/>
>>     <property name="servlet" ref="camelServlet"/>
>> </bean>
>>
>> <bean id="camelServlet" 
>> class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>
>>
>> <bean id="htmlParser" 
>> class="eu.abeel.platform.adapter.customs.nl.webservice.html2rss.service.internal.HtmlParser">
>>     <property name="url" value="${douane.url}"/>
>>     <property name="cssSelector" value="${douane.css.selector}"/>
>> </bean>
>>
>> <camelContext id="platform-adapter-customs-nl-webservice-html2rss" 
>> xmlns="http://camel.apache.org/schema/blueprint";>
>>
>>     <restConfiguration component="servlet" scheme="{{context.scheme}}" 
>> bindingMode="off" host="{{context.host}}" port="{{context.port}}"/>
>>
>>     <rest path="/">
>>
>>
>>
>> -- 
>> -- 
>> ------------------
>> OPS4J - http://www.ops4j.org - op...@googlegroups.com <javascript:>
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ops4j+un...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to