XMPP Spring Integration Property or field 'json' cannot be found

巧了我就是萌 提交于 2019-12-12 01:24:40

问题


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

However I am getting the following error:

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]

So how to receive an upstream message within Spring integration?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/54160191/xmpp-spring-integration-property-or-field-json-cannot-be-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!