>From this Blueprint the ListenerMapping should be exposed before the 
>ServletMapping.

Several thoughts:
* I would suggest to test this with a simple bundle containing a couple of 
"reference-list" on ListenerMapping and ServletMapping to be sure
* Maybe the bean handling the ListenerMapping is asynchronous (configuration?)
* Your ListenerMapping has a setter to the shiroListener bean so may lead to a 
NPE (which can be caught somewhere and not traced!)

JP

-----Message d'origine-----
De : kuvalda [mailto:[email protected]] 
Envoyé : jeudi 3 mars 2016 09:55
À : [email protected]
Objet : RE: PAX-WEB ServletMapping service sometimes starts before 
ServletContextListenerMapping

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xsi:schemaLocation="
            http://www.osgi.org/xmlns/blueprint/v1.0.0
https://osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";>

        <bean id="shiroListener"
class="org.apache.shiro.web.env.EnvironmentLoaderListener" />

        <service id="shiroListenerMapping"
                
interface="org.ops4j.pax.web.extender.whiteboard.ListenerMapping">
                <bean
                
class="org.ops4j.pax.web.extender.whiteboard.runtime.DefaultListenerMapping">
                        <property name="listener" ref="shiroListener" />
                </bean>
        </service>

        <bean id="defaultUI" 
class="biz.lorien.platform.cookbook.vaadin.DefaultUI"
                scope="prototype" />
        <bean id="comradesUI"
class="biz.lorien.platform.cookbook.vaadin.ComradesUI"
                scope="prototype" />

        <bean id="beanIdMapper"
                
class="biz.lorien.platform.framework.vaadin.mapper.SuffixBeanIdMapper">
                <argument value="UI" />
        </bean>

        <bean id="vaadinServlet"
                
class="biz.lorien.platform.framework.vaadin.BlueprintVaadinServlet">
                <argument ref="blueprintContainer" />
                <argument value="defaultUI" />
                <argument ref="beanIdMapper" />
        </bean>

        <service 
interface="org.ops4j.pax.web.extender.whiteboard.ServletMapping"
                depends-on="shiroListenerMapping">
                <bean
                
class="org.ops4j.pax.web.extender.whiteboard.runtime.DefaultServletMapping">
                        <property name="loadOnStartup" value="1" />
                        <property name="servlet" ref="vaadinServlet" />
                        <property name="alias" value="/example" />
                        <property name="urlPatterns">
                                <array>
                                        <value>/example/*</value>
                                </array>
                        </property>
                </bean>
        </service>
</blueprint>


CLEMENT Jean-Philippe wrote
> May you share your Blueprint file(s)?
> 
> JP





-----
Pavel
--
View this message in context: 
http://karaf.922171.n3.nabble.com/PAX-WEB-ServletMapping-service-sometimes-starts-before-ServletContextListenerMapping-tp4045660p4045670.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to