Wicket atmosphere initialization exception

依然范特西╮ 提交于 2019-12-08 07:51:36

问题


I have the following setup: wicket: 6.1.0 wicket-atmosphere: 0.4

(via Maven)

On Application.init() I get a NullPointerException during instantiation of EventBus

    new EventBus(this);

Exception:

    java.lang.NullPointerException
at org.apache.wicket.atmosphere.EventBus.<init>(EventBus.java:105)

This is caused because the method

    public synchronized static BroadcasterFactory getDefault()

delivers null (the protected static member "factory" is not initialized).

How do I use Wicket/Atmosphere properly? Did I forget something to initialize? I'm starting Wicket as a ServletFilter.

<filter>
    <filter-name>AtmosphereTest</filter-name>
    <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
    <init-param>
        <param-name>applicationClassName</param-name>
        <param-value>com.atmosphere.wicket.Application</param-value>
    </init-param>
    <init-param>
        <param-name>configuration</param-name>
        <param-value>development</param-value>
    </init-param>
    <init-param>
        <param-name>ignorePaths</param-name>
        <param-value>/css,/js,/images,/icons</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>AtmosphereTest</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

I don't have a atmosphere configuration, do I need one?

Thanks


回答1:


According to this email from the users-wicket list, you should set up the AtmosphereServlet in your web.xml and supply it with an atmosphere.xml configuration file that tells atmosphere how to load the WicketFilter instead of configuring WicketFilter directly in your web.xml.

I haven't used atmosphere, so I can't really vouch for this, but it sounds sensible.

The email referenced above has web.xml and atmosphere.xml configurations that might help you get this set up.



来源:https://stackoverflow.com/questions/13100508/wicket-atmosphere-initialization-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!