Comments (12)
Hi, Can u specify the Slack event for which u got this error? Maybe the model isn't according to the response slack is returning to the bot. Slack doesn't have a very detailed documentation regarding the respective models.
Changing the model will fix this error.
from jbot.
Do you mean the code that caused this?
I've cut out the non-important bits of code
@Controller(events = EventType.MESSAGE, pattern = "^\\Qgame\\E(?:\\w?)(.*)$")
public void test(WebSocketSession session, Event event, Matcher matcher) {
String query = matcher.group(1);
StringBuilder response;
Message myReply;
response = new StringBuilder("Found ....");
myReply = new Message(response.toString());
myReply.setThreadTs(event.getTs());
reply(session, event, myReply);
from jbot.
Nope, not your code. The Slack response and the model structure doesn't match. The error shows a deserialization error.
from jbot.
Ok, not sure what you want?
from jbot.
Just add private String ts;
in Message.java
to resolve your issue. And do add getters and setters as well. Or just wait for 5 mins and take a pull, I will be adding them. Thanks for reporting the issue.
from jbot.
Great thanks, I was trying to work out your code and see what was causing the issue (I've some experience with Jackson), but couldn't work it out as fast as you ;)
from jbot.
No problem. Have modified the code, you can check. It should work unless Slack has no other new properties added to the event.
from jbot.
Sorry for the delay, was making sure I got the lastest build, but I'm, still getting an error:
2017-02-06 16:00:53.810 ERROR 8440 --- [ient-SecureIO-1] me.ramswaroop.jbot.core.slack.Bot : Error handling response from Slack: {"type":"message","message":{"type":"message","user":"U3QCGKKNU","text":"game Sushi Go","thread_ts":"1486396857.000434","reply_count":1,"replies":[{"user":"U41LKC0NA","ts":"1486396859.000435"}],"ts":"1486396857.000434"},"subtype":"message_replied","hidden":true,"channel":"G3RU2Q5MG","event_ts":"1486396859.357009","ts":"1486396859.000436"}.
Exception:
com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of me.ramswaroop.jbot.core.slack.models.Message: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
at [Source: {"type":"message","message":{"type":"message","user":"U3QCGKKNU","text":"game Sushi Go","thread_ts":"1486396857.000434","reply_count":1,"replies":[{"user":"U41LKC0NA","ts":"1486396859.000435"}],"ts":"1486396857.000434"},"subtype":"message_replied","hidden":true,"channel":"G3RU2Q5MG","event_ts":"1486396859.357009","ts":"1486396859.000436"}; line: 1, column: 30] (through reference chain: me.ramswaroop.jbot.core.slack.models.Event["message"])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.DeserializationContext.instantiationException(DeserializationContext.java:1456) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.DeserializationContext.handleMissingInstantiator(DeserializationContext.java:1012) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1205) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:314) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:148) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:499) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:101) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:276) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:140) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3798) ~[jackson-databind-2.8.5.jar:2.8.5]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2842) ~[jackson-databind-2.8.5.jar:2.8.5]
at me.ramswaroop.jbot.core.slack.Bot.handleTextMessage(Bot.java:159) ~[jbot-3.0.3-SNAPSHOT.jar:3.0.3-SNAPSHOT]
at me.ramswaroop.jbot.core.slack.BotWebSocketHandler.handleTextMessage(BotWebSocketHandler.java:32) [jbot-3.0.3-SNAPSHOT.jar:3.0.3-SNAPSHOT]
at org.springframework.web.socket.handler.AbstractWebSocketHandler.handleMessage(AbstractWebSocketHandler.java:43) [spring-websocket-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.web.socket.handler.WebSocketHandlerDecorator.handleMessage(WebSocketHandlerDecorator.java:75) [spring-websocket-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.web.socket.handler.LoggingWebSocketHandlerDecorator.handleMessage(LoggingWebSocketHandlerDecorator.java:56) [spring-websocket-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.handleTextMessage(StandardWebSocketHandlerAdapter.java:110) [spring-websocket-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter.access$000(StandardWebSocketHandlerAdapter.java:42) [spring-websocket-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:81) [spring-websocket-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.springframework.web.socket.adapter.standard.StandardWebSocketHandlerAdapter$3.onMessage(StandardWebSocketHandlerAdapter.java:78) [spring-websocket-4.3.5.RELEASE.jar:4.3.5.RELEASE]
at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:399) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:500) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:295) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:131) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.WsFrameClient.processSocketRead(WsFrameClient.java:73) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.WsFrameClient.access$300(WsFrameClient.java:31) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:131) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.WsFrameClient$WsFrameClientCompletionHandler.completed(WsFrameClient.java:114) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.AsyncChannelWrapperSecure$WrapperFuture.complete(AsyncChannelWrapperSecure.java:463) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at org.apache.tomcat.websocket.AsyncChannelWrapperSecure$ReadTask.run(AsyncChannelWrapperSecure.java:332) [tomcat-embed-websocket-8.5.6.jar:8.5.6]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]
from jbot.
Sorry, the push didn't go. Please take a pull now, it should work.
from jbot.
@Omertron Hey, did it work for you?
from jbot.
@ramswaroop Yes, this works now.
Thanks for the fix
from jbot.
Hi @rampatra I am trying to create slack code by using your code but i am getting this above error. can you please help me to resolve it?
from jbot.
Related Issues (20)
- Is there any guidance on how to use this for AWS Lambda? HOT 1
- Unescape text sent from JBot
- failed with the error "http_client_error" HOT 1
- /webhook is not exposed HOT 3
- jbot-example - SlackBot class Conversion bug HOT 1
- Websocket session closing HOT 4
- not working with if bot is created using slack application
- Slackbot does not function and I see that No web socket url returned by Slack HOT 3
- Slackbot is down with java.lang.IllegalStateException: Message will not be sent because the WebSocket session has been closed HOT 11
- Error while extracting response for type [class me.ramswaroop.jbot.core.slack.models.Event]
- Not able to post replies HOT 1
- Persistent Menu
- Simple menu with slackBot
- How to get the email id of an user who is interacting with the bot in reply to slack?
- Recently slack bots using RTM api are not working and stops responding. An issue is raised to slack but no resolution yet since two weeks. Can you help with an example of slack socket mode app with spring boot? HOT 1
- Schedule Meeting time accepts any string. Needs time validation
- Chatbot is not working in your page HOT 1
- How to use jbot in a standalone application without spring boot
- Any interest in a PR that will bump to SpringBoot v2.7.6? HOT 3
- Reply in thread feature
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jbot.