I am using REST API to update Chatroom and also tying to add members. Every time I am sending request via Postmane it’s returning error - 415 Unsopported Media Type.
I removed the request to add new member but only to update chatroom description it’s still returning same error.
Method: PUT (according to the REST API documentation)
Is it possible to update member listing using ChatRoom Update API? Or am I sending unsupported request?
I found something inside Openfire console, it’s throwing some kind of exception:
2019-NAME (asdad) Exception:
java.lang.IllegalArgumentException: Illegal JID: collage frds@conference.localhost.com
at org.xmpp.packet.JID.<init>(JID.java:542)
at org.xmpp.packet.JID.<init>(JID.java:496)
at org.jivesoftware.openfire.muc.spi.LocalMUCRoom.getJID(LocalMUCRoom.java:394)
at org.jivesoftware.openfire.admin.muc_002droom_002dsummary_jsp._jspService(muc_002droom_002dsummary_jsp.java:329)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.jivesoftware.util.LocaleFilter.doFilter(LocaleFilter.java:73)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.jivesoftware.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.jivesoftware.admin.PluginFilter.doFilter(PluginFilter.java:226)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
at org.jivesoftware.admin.AuthCheckFilter.doFilter(AuthCheckFilter.java:216)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
at org.eclipse.jetty.server.Server.handle(Server.java:503)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: The input is not a valid JID node: collage frds
at org.xmpp.packet.JID.nodeprep(JID.java:294)
at org.xmpp.packet.JID.<init>(JID.java:529)
… 49 more
Not sure if this can be the issue the API is returning error.
Yes. I created this chatoom than run the ChatRoom Update API and it started to throw exception.
The strange thing is when I call the ChatRoom delete API it deleted the chatroom but the next chatroom started to throw exception like this.
Is there any way to resolve this or just trace the reason of it?
It seems if I delete that chatroom the next chatroom will appear like this. I just attached a screenshot.!
And yes, there’s a space in the JID “collage frds” and I tried to delete the room but it happens again and again.
But there is no client/user with such JID in the User list
Sorry, my mistake. Yes, it’s the room ID which appearing but the actual ID is abcd@conference.localhost.com which I marked. When I call the API to get the details of that chatroom it also returns the correct one, which is - abcd@conference.localhost.com I also marked the ID/Name with in the screenshot.
I don’t know where it’s coming from, it’s appearing beside the room which has completely different id.
Is there any way I can go through the DB and check if there’s anything exist which match with such strange room id?
There are various database tables in play, the most central one to this problem is probably ofMucRoom. I don’t recommend making changes to the database directly, though - but if you must, be sure to shut down Openfire before you do.