Wicket 气氛初始化异常 [英] Wicket atmosphere initialization exception

查看:53
本文介绍了Wicket 气氛初始化异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下设置:检票口:6.1.0检票口气氛:0.4

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

(通过 Maven)

在 Application.init() 上,我在 EventBus 的实例化过程中得到 NullPointerException

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

    new EventBus(this);

异常:

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

这是因为方法

    public synchronized static BroadcasterFactory getDefault()

传递 null(受保护的静态成员工厂"未初始化).

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

如何正确使用 Wicket/Atmosphere?我忘记初始化了吗?我开始将 Wicket 作为 ServletFilter.

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?

谢谢

推荐答案

根据 这封电子邮件来自 users-wicket 列表,您应该在您的 web.xml 中设置 AtmosphereServlet 并为其提供一个大气.xml 配置文件,告诉大气如何加载 WicketFilter 而不是直接在 web.xml 中配置 WicketFilter.

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.

上面引用的电子邮件有 web.xml 和大气.xml 配置,可以帮助您进行此设置.

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

这篇关于Wicket 气氛初始化异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆