我有一个使用grails版本2.3.8的应用程序。我已经安装了事件推送插件来将通知从服务器推送到浏览器。我的buildConfig.groovy看起来像这样
plugins {
build ":tomcat:7.0.42"
compile ":events-push:1.0.M7"
}
grails.servlet.version = "3.0"
grails.tomcat.nio=true我的听众在我的视野中,
try {
var grailsEvents = new grails.Events("${createLink(uri:'')}", {transport: "sse"});
grailsEvents.on('ActiveCallNotification', function (data) {
console.log("GOT recording!");
});
} catch (error) {
console.log("ERROR: " + error.toString());
}并从控制器触发事件,
def notifyActiveCall() {
event topic: 'ActiveCallNotification',data:"hi"
}我的活动,
events = {
'ActiveCallNotification' browser: true
}现在,当我浏览包含侦听器代码的视图时,我一次又一次地得到以下错误:
EventSource's response has a MIME type ("text/html") that is not "text/event-stream". Aborting the connection. jquery.atmosphere.js:2297
SSE failed. Downgrading to fallback transport and resending如果我在视图中注释代码,则不会发生此错误,并且显然不会考虑事件。任何帮助都将不胜感激。我使用的是铬合金。
已安装插件列表,
compile ":scaffolding:2.0.3"
compile ':cache:1.1.2'
compile ":twitter-bootstrap:3.1.1.3"
compile ':jaxrs:0.10'
compile ":quartz:1.0.1"
compile ":joda-time:1.4"
compile ":spring-security-core:2.0-RC4"
compile ":grails-melody:1.53.0"
compile ":quartz-monitor:1.0"
compile ":audit-logging:1.0.1"
compile ":executor:0.3"
runtime ":hibernate:3.6.10.13" // or ":hibernate4:4.3.5.1"
runtime ":database-migration:1.4.0"
runtime ":jquery:1.11.1"
runtime ":resources:1.2.7"发布于 2016-01-26 05:55:02
自从你的上一次评论(5月13日15:37)以来,你有没有尝试过下面的grails命令:
grails clean-all
grails refresh-dependencies您也可以手动删除位于以下位置的文件夹内容:
~/.grails它帮助我解决了类似的问题,现在已经过去了一段时间,你也可以检查插件更新,使用较新的版本可以帮助解决冲突或错误的依赖。
https://stackoverflow.com/questions/30212716
复制相似问题