ClassCastException occured on web chat popup window

I have checked out latest code from svn of openfire and fastpath webchat projet in eclipse 3.7. Build it and put the webchat.war (From:** /target/plugin**) file in opefirefires** target/openfire/plugin folder.**

Then opened Fastpath > Tools page from openfire application (Running from localhost:9090). I found that chat icon is missing, But managed to click on the link of that image. Webchat popup window opened, but displaying the following exception.

Online Chat Service

Our chat service is unavailable at this time. Please check back soon.
java.lang.ClassCastException: com.jivesoftware.smack.workgroup.settings.OfflineSettings cannot be cast to org.jivesoftware.smackx.workgroup.settings.OfflineSettings at org.jivesoftware.smackx.workgroup.user.Workgroup.getOfflineSettings(Workgroup.j ava:726) at at org.apache.jasper.runtime.HttpJspBase.service( at javax.servlet.http.HttpServlet.service( at org.eclipse.jetty.servlet.ServletHolder.handle( at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1359) at org.jivesoftware.webchat.SetCharacterEncodingFilter.doFilter(SetCharacterEncodi at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1330) at org.jivesoftware.webchat.SetupFilter.doFilter( at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.ja va:1330) at org.eclipse.jetty.servlet.ServletHandler.doHandle( at org.eclipse.jetty.server.handler.ScopedHandler.handle( at at org.eclipse.jetty.server.session.SessionHandler.doHandle( 7) at org.eclipse.jetty.server.handler.ContextHandler.doHandle( 1) at org.eclipse.jetty.servlet.ServletHandler.doScope( at org.eclipse.jetty.server.session.SessionHandler.doScope( ) at org.eclipse.jetty.server.handler.ContextHandler.doScope( ) at org.eclipse.jetty.server.handler.ScopedHandler.handle( at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandler at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.jav a:149) at org.eclipse.jetty.server.handler.HandlerWrapper.handle( at org.eclipse.jetty.server.Server.handle( at org.eclipse.jetty.server.HttpConnection.handleRequest( at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConne at org.eclipse.jetty.http.HttpParser.parseNext( at org.eclipse.jetty.http.HttpParser.parseAvailable( at org.eclipse.jetty.server.AsyncHttpConnection.handle( ) at a:586) at$ :44) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob( ) at org.eclipse.jetty.util.thread.QueuedThreadPool$ at

I have found another forum entry

Could this be related?

I browsed svn repository of this fastpath-webchat project, and found a change in the file /leave-a-message.jsp?r2=12985&r1=10482

Could this changes be related with the exception, which I am getting?

Any guidance in this regard shall be highly appriciated.

Managed to workaround this error temporarily to move ahead by replacing all occurrances of .smack. with .smackx. in smack.providers of the workgroup.jar .

We must confess that this was a desperate step as we yet don’t know the utility of smack and smackx and were prompted to give this a shot after reading a few related ClassCastException posts.

Will post updates as we make some progress.

Not that I know anything about Fastpath, but any Smack references for workgroup will fall under org.jivesoftware.smackx.workgroup.*. This is the top level package for all workgroup related stuff. Also note that it is org not com.

Thanks for your quick response.

I have studied smack-3.2.1.jar, smackx-3.2.1.jar and workgroup.jar. All the libraries are present under src/webapp/WEB-INF/lib. Package structure of smack and smackx jar is organized in org.jivesoftware.smack(x).* manner but for workgroup.jar it is maintained com.jivesoftware.smack.* this way.

During run, webchat application uses the workgroup.jar, thats why in exception message com.jivesoftware.smack.workgroup.settings.OfflineSettings is appeared.

I have done the following steps and everything seems working fine.

Procedure 1:

  1. I modified /target/openfire/plugins/webchat/WEB-INF/lib/workgroup.jar’s META-INF/smack.provider file by replacing “**com.jivesoftware.smack.**workgroup__." with "**org.jivesoftware.smackx.**workgroup.”.__

  2. re-ran openfire and tested the entire webchat cycle.

Everything worked fine. Successful to do a test chat using webchat.

Procedure 2:

  1. Just removed the workgroup.jar from the lib of webchat plugin of openfire

  2. Restarted openfire instance and tested it.

Everything worked fine.

I took the 2nd procedure because I have checked workgroup.jar and smackx.3.2.1.jar thoroughly and found that similar package like com.jivesoftware.smack.workgroup.* of workgroup.jar is also present in smackx.3.2.1.jar (org.jivesoftware.**smackx.**workgroup.*). Package structure is also same. One significant difference is package is missing from smackx.3.2.1.jar. I have checked the cross references of this package and found that this package is never used in openfire project.

Now my question is what is the purpose of this workgroup.jar? Is it serving anything in this project? or we may remove it from webchat library?

Wow i am so glad someone solved it. However after so mayn patches i have already done and now also ur patch it would b great if ur provide the compiled war file, just there are no errors done by me when manual patching.

I think the problem of openfire development athe moremnt is the “commit closed” source of svn repository. It would be best if they/someone setio a github mirror of the svn main repo, so that everybody can fork and commit his changed, Doing pull requests and the authoring and reviewing changed by community user (not part of the core devlopers) would speed up whole project and would provide more porfessional exchange of “usnatble” patches till next release.