找不到XMPP Spring Integration属性或字段'json' [英] XMPP Spring Integration Property or field 'json' cannot be found
问题描述
我尝试使用以下教程通过Spring Integration实现XMPP: https://grokonez.com/spring-framework/spring-integration/firebase-cloud-messaging-xmpp-server-example-receive-upstream-messages-spring-integration
I tried to implement XMPP with Spring Integration using the following tutorial: https://grokonez.com/spring-framework/spring-integration/firebase-cloud-messaging-xmpp-server-example-receive-upstream-messages-spring-integration
但是我遇到以下错误:
org.springframework.expression.spel.SpelEvaluationException: EL1008E: Property or field 'json' cannot be found on object of type 'org.jivesoftware.smack.packet.StandardExtensionElement' - maybe not public or not valid?
at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:217) ~[spring-expression-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:104) ~[spring-expression-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.expression.spel.ast.PropertyOrFieldReference.access$000(PropertyOrFieldReference.java:51) ~[spring-expression-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.expression.spel.ast.PropertyOrFieldReference$AccessorLValue.getValue(PropertyOrFieldReference.java:406) ~[spring-expression-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:90) ~[spring-expression-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:111) ~[spring-expression-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:328) ~[spring-expression-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.integration.xmpp.inbound.ChatMessageListeningEndpoint$ChatMessagePublishingStanzaListener.processStanza(ChatMessageListeningEndpoint.java:143) ~[spring-integration-xmpp-5.1.1.RELEASE.jar:5.1.1.RELEASE]
那么如何在Spring集成中接收上游消息?
So how to receive an upstream message within Spring integration?
推荐答案
您的问题是您没有显示此事的代码.看起来您似乎真的错过了上述示例基于 GCM 的事实,其中org.jivesoftware.smack.packet.Message
中的getExtension('google:mobile:data')
实际上通过getJson()
方法为我们返回了org.jivesoftware.smackx.gcm.packet.GcmPacketExtension
.
Your problem that you don't show what is your code on the matter. And looks like you really are missing the fact that the mentioned sample is based on the GCM, where getExtension('google:mobile:data')
from the org.jivesoftware.smack.packet.Message
really returns for us a org.jivesoftware.smackx.gcm.packet.GcmPacketExtension
with the getJson()
method.
在您的情况下,您好像得到了org.jivesoftware.smack.packet.StandardExtensionElement
.因此,实际上应该没有在那儿的json
.
In your case it looks like your get a org.jivesoftware.smack.packet.StandardExtensionElement
. So, that really is expected do not have a json
over there.
这篇关于找不到XMPP Spring Integration属性或字段'json'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!