Closed moniman closed 9 years ago
Can you provide more information ?
Grails - version ? What is boulangers ? is this some room you have created in Config.groovy ? If possible could you upload the sample project to your github and I can try to figure out your issue from it..
You have got a 404 so something that did not exist within the ws line - ws://localhost:8080/myapp/WsChatEndpoint
is myapp your app name
Sorry yes an issue has been spotted - try latest version compile ":wschat:1.7-SNAPSHOT" let me know how it goes.
This issue was not visible to me since I was testing plugin as an inline plugin which appears to work fine as it was before this change locally.
Hi, Thanks for your answer. I trie with the -SNAPSHOT and I have exceptions.
My config is
Grails 2.4.4
Java 8
build ':tomcat:8.0.15'
compile ':scaffolding:2.1.2'
compile ':cache:1.1.8'
compile ':asset-pipeline:2.0.15'
compile ':spring-security-core:2.0-RC4'
compile ':spring-security-facebook:0.16.2'
compile ':spring-security-oauth2-provider:2.0-RC2'
compile ':mail:1.0.7'
compile ':quartz:1.0.2'
compile ":rest-api-doc:0.5"
compile ":spring-websocket:1.2.0"
compile ":wschat:1.7-SNAPSHOT"
runtime ':hibernate4:4.3.6.1'
runtime ':database-migration:1.4.0'
runtime ':jquery:1.11.1'
I have to clean my project before update it to github. If it necessary I'll do it tomorrow evening
| Error org.springframework.dao.DataAccessResourceFailureException: Could not obtain current Hibernate Session; nested exception is org.hibernate.HibernateException: No Session found for current thread | Error at org.codehaus.groovy.grails.orm.hibernate.GrailsHibernateTemplate.getSession(GrailsHibernateTemplate.java:210) | Error at org.codehaus.groovy.grails.orm.hibernate.GrailsHibernateTemplate.doExecute(GrailsHibernateTemplate.java:166) | Error at org.codehaus.groovy.grails.orm.hibernate.GrailsHibernateTemplate.executeFind(GrailsHibernateTemplate.java:127) | Error at org.codehaus.groovy.grails.orm.hibernate.metaclass.FindAllByPersistentMethod.doInvokeInternalWithExpressions(FindAllByPersistentMethod.java:74) | Error at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractClausedStaticPersistentMethod.doInvokeInternal(AbstractClausedStaticPersistentMethod.java:544) | Error at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractClausedStaticPersistentMethod.doInvokeInternal(AbstractClausedStaticPersistentMethod.java:418) | Error at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod.invoke(AbstractStaticPersistentMethod.java:79) | Error at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractStaticPersistentMethod.invoke(AbstractStaticPersistentMethod.java:72) | Error at org.grails.datastore.gorm.finders.FinderMethod$invoke$0.call(Unknown Source) | Error at org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2.doCall(GormStaticApi.groovy:102) | Error at org.grails.datastore.gorm.GormStaticApi$_methodMissing_closure2.call(GormStaticApi.groovy) | Error at org.codehaus.groovy.runtime.metaclass.ClosureStaticMetaMethod.invoke(ClosureStaticMetaMethod.java:59) | Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:324) | Error at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.invoke(StaticMetaMethodSite.java:43) | Error at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.call(StaticMetaMethodSite.java:88) | Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) | Error at grails.plugin.wschat.ChatUtils.isBanned(ChatUtils.groovy:712) | Error at grails.plugin.wschat.ChatUtils.verifyAction(ChatUtils.groovy:99) | Error at grails.plugin.wschat.ChatUtils.this$2$verifyAction(ChatUtils.groovy) | Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | Error at java.lang.reflect.Method.invoke(Method.java:483) | Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) | Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) | Error at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:919) | Error at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1256) | Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209) | Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) | Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) | Error at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) | Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145) | Error at grails.plugin.wschat.WsChatEndpoint.handleMessage(WsChatEndpoint.groovy:77) | Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | Error at java.lang.reflect.Method.invoke(Method.java:483) | Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) | Error at org.apache.tomcat.websocket.pojo.PojoMessageHandlerWholeBase.onMessage(PojoMessageHandlerWholeBase.java:80) | Error at org.apache.tomcat.websocket.WsFrameBase.sendMessageText(WsFrameBase.java:393) | Error at org.apache.tomcat.websocket.WsFrameBase.processDataText(WsFrameBase.java:494) | Error at org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:289) | Error at org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:130) | Error at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:60) | Error at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:203) | Error at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:194) | Error at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95) | Error at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:653) | Error at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) | Error at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) | Error at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) | Error at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) | Error at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) | Error at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) | Error at java.lang.Thread.run(Thread.java:745) | Error Caused by: org.hibernate.HibernateException: No Session found for current thread | Error at org.codehaus.groovy.grails.orm.hibernate.GrailsSessionContext.currentSession(GrailsSessionContext.java:117) | Error at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014) | Error at org.codehaus.groovy.grails.orm.hibernate.SessionFactoryProxy.getCurrentSession(SessionFactoryProxy.java:148) | Error at org.codehaus.groovy.grails.orm.hibernate.GrailsHibernateTemplate.getSession(GrailsHibernateTemplate.java:208) | Error ... 54 more 2014-12-15 22:54:16 pojo.PojoEndpointBase Failed to call onClose method of POJO end point for POJO of type [grails.plugin.wschat.WsChatEndpoint] java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) at org.apache.tomcat.websocket.pojo.PojoEndpointBase.onClose(PojoEndpointBase.java:107) at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:508) at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:491) at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.close(WsHttpUpgradeHandler.java:183) at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$200(WsHttpUpgradeHandler.java:48) at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:205) at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:194) at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:653) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.hibernate.HibernateException: No Session found for current thread at org.codehaus.groovy.grails.orm.hibernate.GrailsSessionContext.currentSession(GrailsSessionContext.java:117) at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014) at org.codehaus.groovy.grails.orm.hibernate.SessionFactoryProxy.getCurrentSession(SessionFactoryProxy.java:148) at org.codehaus.groovy.grails.orm.hibernate.validation.HibernateDomainClassValidator.validate(HibernateDomainClassValidator.java:60) at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractSavePersistentMethod.doInvokeInternal(AbstractSavePersistentMethod.java:173) at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod.invoke(AbstractDynamicPersistentMethod.java:68) at org.codehaus.groovy.grails.orm.hibernate.HibernateGormInstanceApi.save(HibernateGormInstanceApi.groovy:195) at grails.plugin.wschat.ChatLogs.save(ChatLogs.groovy) at grails.plugin.wschat.ChatLogs$save.call(Unknown Source) at grails.plugin.wschat.ChatUtils.validateLogOut(ChatUtils.groovy:48) at grails.plugin.wschat.ChatUtils.this$2$validateLogOut(ChatUtils.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:919) at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1256) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at grails.plugin.wschat.WsChatEndpoint.handeClose(WsChatEndpoint.groovy:88) ... 21 more | Error java.lang.reflect.InvocationTargetException | Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | Error at java.lang.reflect.Method.invoke(Method.java:483) | Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) | Error at org.apache.tomcat.websocket.pojo.PojoEndpointBase.onClose(PojoEndpointBase.java:107) | Error at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:508) | Error at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:491) | Error at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.close(WsHttpUpgradeHandler.java:183) | Error at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$200(WsHttpUpgradeHandler.java:48) | Error at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:205) | Error at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:194) | Error at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95) | Error at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:653) | Error at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) | Error at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) | Error at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) | Error at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) | Error at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) | Error at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) | Error at java.lang.Thread.run(Thread.java:745) | Error Caused by: org.hibernate.HibernateException: No Session found for current thread | Error at org.codehaus.groovy.grails.orm.hibernate.GrailsSessionContext.currentSession(GrailsSessionContext.java:117) | Error at org.hibernate.internal.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:1014) | Error at org.codehaus.groovy.grails.orm.hibernate.SessionFactoryProxy.getCurrentSession(SessionFactoryProxy.java:148) | Error at org.codehaus.groovy.grails.orm.hibernate.validation.HibernateDomainClassValidator.validate(HibernateDomainClassValidator.java:60) | Error at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractSavePersistentMethod.doInvokeInternal(AbstractSavePersistentMethod.java:173) | Error at org.codehaus.groovy.grails.orm.hibernate.metaclass.AbstractDynamicPersistentMethod.invoke(AbstractDynamicPersistentMethod.java:68) | Error at org.codehaus.groovy.grails.orm.hibernate.HibernateGormInstanceApi.save(HibernateGormInstanceApi.groovy:195) | Error at grails.plugin.wschat.ChatLogs.save(ChatLogs.groovy) | Error at grails.plugin.wschat.ChatLogs$save.call(Unknown Source) | Error at grails.plugin.wschat.ChatUtils.validateLogOut(ChatUtils.groovy:48) | Error at grails.plugin.wschat.ChatUtils.this$2$validateLogOut(ChatUtils.groovy) | Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | Error at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) | Error at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) | Error at java.lang.reflect.Method.invoke(Method.java:483) | Error at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1270) | Error at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) | Error at groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:919) | Error at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1256) | Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1209) | Error at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110) | Error at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1016) | Error at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) | Error at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) | Error at grails.plugin.wschat.WsChatEndpoint.handeClose(WsChatEndpoint.groovy:88) | Error ... 21 more | Error java.lang.IllegalStateException: Message will not be sent because the WebSocket session has been closed | Error at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.writeMessagePart(WsRemoteEndpointImplBase.java:378) | Error at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessage(WsRemoteEndpointImplBase.java:335) | Error at org.apache.tomcat.websocket.WsRemoteEndpointImplBase.startMessageBlock(WsRemoteEndpointImplBase.java:264) | Error at org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:536) | Error at org.apache.tomcat.websocket.WsSession.doClose(WsSession.java:464) | Error at org.apache.tomcat.websocket.WsSession.close(WsSession.java:441) | Error at org.apache.tomcat.websocket.WsSession.close(WsSession.java:435) | Error at org.apache.tomcat.websocket.pojo.PojoEndpointBase.handleOnOpenOrCloseError(PojoEndpointBase.java:96) | Error at org.apache.tomcat.websocket.pojo.PojoEndpointBase.onClose(PojoEndpointBase.java:112) | Error at org.apache.tomcat.websocket.WsSession.fireEndpointOnClose(WsSession.java:508) | Error at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:491) | Error at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.close(WsHttpUpgradeHandler.java:183) | Error at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.access$200(WsHttpUpgradeHandler.java:48) | Error at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDataAvailable(WsHttpUpgradeHandler.java:205) | Error at org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(AbstractServletInputStream.java:194) | Error at org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractProcessor.java:95) | Error at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:653) | Error at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222) | Error at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556) | Error at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513) | Error at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) | Error at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) | Error at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) | Error at java.lang.Thread.run(Thread.java:745)
I had the same issue.
//runtime ":hibernate4:4.3.6.1" // or ":hibernate:3.6.10.18"
runtime ":hibernate4:4.3.5.4"
Until I commented out hibernate in the default app and enabled a downgraded version below.
You can either do this for now or run it on 2.4.2 grails app,
I will try find out how I can use a generic hibernate for all types of grails app (if possible)
ok - its a new feature in 2.4.4 I think, try : (withTransaction required)
compile ":wschat:1.8"
Hope to have fixed it on this
Hi vahidhedayati I've just try 1.8 it works thank you so much !!
no problems :) am updating at the moment but its bugs related to another issue 1.8 should be fine for now 1.9 is broke as far as cam goes 1.10 should be ok again -
Hi
I would like to use this chat. I have installed this plugin, and add all configs lines like the documentation.
at localhost:8080/wsChat/chat There is this message :
And in chrome console : WebSocket connection to 'ws://localhost:8080/myapp/WsChatEndpoint/boulangers' failed: Error during WebSocket handshake: Unexpected response code: 404 wschat.js:775 WebSocket is already in CLOSING or CLOSED state.
Have you an idea ? Thank you