在linux上运行autobahn python会产生exceptions.AttributeError:路由器实例没有属性'broker'

时间:2014-08-22 22:05:31

标签: python linux twisted autobahn

我试图在linux机器(ubuntu服务器64位)上使用twisted运行一个高速公路WAMP应用程序。

我注意到在开发/测试时我需要在使用wamp.Application之后安装pywin32,但这当然不适用于linux环境。

以前我一直在这台机器上运行autobahn websocket程序,但现在切换到使用autobahn.twisted.wamp.Application

时会出现此错误

任何有助于解决此问题的帮助,以便我可以帮助运行应用程序。

我的导入是:

from twisted.internet.defer import returnValue
from autobahn.twisted.wamp import Application

我得到以下堆栈跟踪:

2014-08-23 09:54:15+1200 [WampWebSocketServerProtocol,0,127.0.0.1] RX WAMP HELLO
 Message (realm = realm1, roles = [<autobahn.wamp.role.RoleSubscriberFeatures in
stance at 0x9bd79ec>, <autobahn.wamp.role.RolePublisherFeatures instance at 0x9b
d7aec>, <autobahn.wamp.role.RoleCallerFeatures instance at 0x9bd7b6c>, <autobahn
.wamp.role.RoleCalleeFeatures instance at 0x9bd7fac>], authmethods = None, authi
d = None)
2014-08-23 09:54:15+1200 [WampWebSocketServerProtocol,0,127.0.0.1] Unhandled err
or in Deferred:
2014-08-23 09:54:15+1200 [WampWebSocketServerProtocol,0,127.0.0.1] Unhandled Err
or
        Traceback (most recent call last):
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/websocket.p
y", line 90, in onMessage
            self._session.onMessage(msg)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/protocol.py
", line 1267, in onMessage
            self._add_future_callbacks(d, success, failed)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/twisted/wamp.py"
, line 72, in _add_future_callbacks
            return future.addCallbacks(callback, errback)
          File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py
", line 295, in addCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py
", line 577, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/protocol.py
", line 1250, in success
            welcome(self._realm, res.authid, res.authrole, res.authmethod, res.a
uthprovider)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/protocol.py
", line 1221, in welcome
            self._router = self._router_factory.get(realm)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/router.py",
 line 173, in get
            self._routers[realm] = self.router(self, realm, self._options)
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/router.py",
 line 52, in __init__
            self._broker = self.broker(self, self._options)
        exceptions.AttributeError: Router instance has no attribute 'broker'

1 个答案:

答案 0 :(得分:0)

似乎高速公路上可能存在一个错误,因为:

pip install autobahn --upgrade

似乎已经使用高速公路修复了这个版本:0.8.14

对于在询问之前缺乏更新感到抱歉:)