没有在jetty 9.2.3上设置mongodb会话管理器上的SessionIdManager

时间:2017-11-08 18:22:43

标签: java mongodb jetty jetty-9

我有一个带有mongodb的码头9.2.3配置

我配置了mongo连接

 <New id="mongodb" class="com.mongodb.Mongo">
    <Arg>
        <New class="java.util.ArrayList">
            <Call name="add">
                <Arg>
                    <New class="com.mongodb.ServerAddress">
                        <Arg type="java.lang.String">localhost</Arg>
                        <Arg type="int">27017</Arg>
                    </New>
                </Arg>
            </Call>
            <!-- Add more Call statements here as desired --> </New>
    </Arg>

    <Call name="getDB">
        <Arg>HttpSessions</Arg>
        <Call id="sessionDocument" name="getCollection">
            <Arg>sessions</Arg>
        </Call>
    </Call>
    <!-- If you want to configure Jetty to be able to read through the slaves, call the following: -->
    <Call name="slaveOk"/>
</New>

<Set name="sessionIdManager">
    <New id="mongoIdMgr" class="org.eclipse.jetty.nosql.mongodb.MongoSessionIdManager">
        <Arg>
            <Ref id="Server"/>
        </Arg>
        <Arg>
            <Ref id="sessionDocument"/>
        </Arg>
        <Set name="workerName"><Property name="jetty.nosqlSession.workerName" default="node1"/></Set>
        <Set name="scavengePeriod"><Property name="jetty.nosqlSession.scavenge" default="1800"/></Set>
    </New>
</Set>

然后在我的WEB-INF / jetty-web.xml中设置会话处理程序。

当我在jetty服务器上部署战争并启动码头时,我有以下例外:

java.lang.NoSuchMethodException: class org.eclipse.jetty.nosql.mongodb.MongoSessionManager.setSessionIdManager(class org.eclipse.jetty.nosql.mongodb.MongoSessionIdManager)
at org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:582)

我不明白,因为setSessionIdManager有SessionIdManager接口而MongoSessionIdManager实现了SessionIdManager

任何建议都将不胜感激

由于

0 个答案:

没有答案