Quantcast

Deployment of 'events-push' app into Tomcat

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Deployment of 'events-push' app into Tomcat

thomasbee
Stephane, all,

I sort of have the events-push plugin running the way I need it, however I still have 2 issues

(1) pushing events doesn't run when I start the app from within Intellij (not errors reported), but it runs fine when starting from the command line

(2) When I deploy into Tomcat 7 with NIO connector enabled, i.e.

    <Connector port="7777" protocol="org.apache.coyote.http11.Http11NioProtocol"
               connectionTimeout="20000"
               redirectPort="8443" />

I get the following error when pushing an event (note that this is running without errors from the command line)

java.lang.IllegalAccessException: Class org.grails.plugin.platform.events.registry.DefaultEventsRegistry$ListenerHandler can not access a member of class org.grails.plugin.platform.events.push.EventsPushHandler$BroadcastEventWrapper with modifiers "public"
        at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
        at java.lang.reflect.Method.invoke(Method.java:588)
        at org.grails.plugin.platform.events.registry.DefaultEventsRegistry$ListenerHandler.invoke(DefaultEventsRegistry.java:256)
        at org.grails.plugin.platform.events.registry.DefaultEventsRegistry.invokeListeners(DefaultEventsRegistry.java:180)
        at org.grails.plugin.platform.events.publisher.DefaultEventsPublisher.event(DefaultEventsPublisher.java:69)
        at org.grails.plugin.platform.events.publisher.EventsPublisher$event.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.grails.plugin.platform.events.EventsImpl._event(EventsImpl.groovy:81)
        at org.grails.plugin.platform.events.EventsImpl$_event.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
        at org.grails.plugin.platform.events.EventsImpl$_closure1_closure4_closure6.doCall(EventsImpl.groovy:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:226)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:149)
        at org.grails.plugin.platform.events.EventsImpl$_closure1_closure4_closure6.doCall(EventsImpl.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaMethod.invoke(ClosureMetaMethod.java:80)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoMetaMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:308)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
        at org.eso.ohs.nlt.BroadcastService.send(BroadcastService.groovy:6)
        at org.eso.ohs.nlt.BroadcastService$$FastClassByCGLIB$$7aaeb597.invoke(<generated>)
        at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
        at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
        at org.eso.ohs.nlt.BroadcastService$$EnhancerByCGLIB$$c4a7e4f7.send(<generated>)
        at org.eso.ohs.nlt.BroadcastService$send.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.eso.ohs.nlt.BroadcastController.send(BroadcastController.groovy:10)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.groovy.grails.web.servlet.mvc.MixedGrailsControllerHelper.invoke(MixedGrailsControllerHelper.java:69)
        at org.codehaus.groovy.grails.web.servlet.mvc.AbstractGrailsControllerHelper.handleAction(AbstractGrailsControllerHelper.java:331)
        at org.codehaus.groovy.grails.web.servlet.mvc.AbstractGrailsControllerHelper.executeAction(AbstractGrailsControllerHelper.java:212)
        at org.codehaus.groovy.grails.web.servlet.mvc.AbstractGrailsControllerHelper.handleURI(AbstractGrailsControllerHelper.java:178)

Could it be that the push URL is somehow wrong? It is assembled in

$(function(){
      window.grailsEvents = new grails.Events('${createLink(uri: '')}', null, {transport:'long-polling'});

      grailsEvents.on("myEvent", function(data){
          alert('hello')
      });
});

Thanks

.t
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

thomasbee
I can confirm the above error on

- Grails 2.1.0
- Tomcat 7.0.28
- Linux and MacOS

----
Changes to the demo as follows

- empty resources.groovy

commented out the following lines in BuildConfig.groovy

//  runtime 'org.springframework.integration:spring-integration-amqp:2.1.1.RELEASE'
//  runtime ":cloud-foundry:1.2.2"
//  runtime ":rabbitmq:1.0.0.RC1"
//  runtime ":events-si:1.0.M2-SNAPSHOT"
 

I have enabled the NIO connector in Tomcat.

Thanks

.t
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

thomasbee
It seems that the demo on cloudfoundry also does not push anything ...

http://grailstodos.cloudfoundry.com/todos

or am I missing something?

.t
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

smaldini
No I didn't miss those bugs I plan to redeploy. Cloudfoundry is not the best option to deploy a tomcat 7 pushed app with websockets (not supported). The bug is quite strange, but I think its fixed on trunk (M2 , not released yet).

Thank you for your feedback anyway :)

On Fri, Jul 6, 2012 at 8:51 PM, thomasbee <[hidden email]> wrote:
It seems that the demo on cloudfoundry also does not push anything ...

http://grailstodos.cloudfoundry.com/todos
http://grailstodos.cloudfoundry.com/todos

or am I missing something?

.t

--
View this message in context: http://grails.1312388.n4.nabble.com/Deployment-of-events-push-app-into-Tomcat-tp4631195p4631217.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
--


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

smaldini
BTW be sure to use grails.tomcat.nio=true in your BuildConfig or you will have to use that in your JS:

new grails.Event(url,null, {transport:'long-polling'})

On Sat, Jul 7, 2012 at 12:10 AM, Stephane Maldini <[hidden email]> wrote:
No I didn't miss those bugs I plan to redeploy. Cloudfoundry is not the best option to deploy a tomcat 7 pushed app with websockets (not supported). The bug is quite strange, but I think its fixed on trunk (M2 , not released yet).

Thank you for your feedback anyway :)


On Fri, Jul 6, 2012 at 8:51 PM, thomasbee <[hidden email]> wrote:
It seems that the demo on cloudfoundry also does not push anything ...

http://grailstodos.cloudfoundry.com/todos
http://grailstodos.cloudfoundry.com/todos

or am I missing something?

.t

--
View this message in context: http://grails.1312388.n4.nabble.com/Deployment-of-events-push-app-into-Tomcat-tp4631195p4631217.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
--





--
Stéphane MALDINI
--


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

thomasbee
Hi Stephane,

Thanks for the fast reply. I do have

grails.tomcat.nio=true

BuildConfig.groovy

It is a minor issue that push doesn't work when running inside IntelliJ, running inside STS it works :-)

My main concern is that when deploying to Tomcat it doesn't work. (see stack trace in original post). Were you referring to this as a bug or only to Cloudfoundry?

in other words, I cannot get it deployed into Tomcat 7 for now.

Thanks a lot

.t
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

thomasbee
In Tomcat, the above exception happens for both


long-polling and websocket

As transport. I have the demo of the alternative  atmosphere plugin running fine,

.t
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

thomasbee
Played around with Tomcat 7.0.27/28/29 all behave slightly differently. When deploying an app with the atmosphere plugin into Tomcat, the only working config is 7.0.27, all other produce errors on the identical WAR.  I am still stuck with the ToDo Example

https://github.com/smaldini/grailsTodos 

after removing

- Spring Framework Dependency
- events-si Plugin
- rabbitmq
- cloudfoundry

the sample is working fine with "rails run-app" but continues producing the above error when deployed into Tomcat.

Any ideas would be truly appreciated.

.t
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

twhtanghk
This post has NOT been accepted by the mailing list yet.
In reply to this post by thomasbee
The same exception is thrown when run an application with "afterInsert" event registered by "grails run-war", but it runs fine by "grails run-app". It seems that the exception is thrown from plugin "platform-core" instead of "event-push".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

smaldini
In reply to this post by thomasbee
Will test that this eve and come back to you.

On Tue, Jul 10, 2012 at 9:27 PM, thomasbee <[hidden email]> wrote:
Played around with Tomcat 7.0.27/28/29 all behave slightly differently. When
deploying an app with the atmosphere plugin into Tomcat, the only working
config is 7.0.27, all other produce errors on the identical WAR.  I am still
stuck with the ToDo Example

https://github.com/smaldini/grailsTodos

after removing

- Spring Framework Dependency
- events-si Plugin
- rabbitmq
- cloudfoundry

the sample is working fine with "rails run-app" but continues producing the
above error when deployed into Tomcat.

Any ideas would be truly appreciated.

.t

--
View this message in context: http://grails.1312388.n4.nabble.com/Deployment-of-events-push-app-into-Tomcat-tp4631195p4631347.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
--


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

thomasbee
any news ... Stephane?

Thanks

.t
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

thomasbee

Ok, I am falling back to the grails atmosphere  rather than event-push plugin with "streaming" transport for the time being. Cannot get the other plugin to work when deploying on Tomcat.

.t
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: Deployment of 'events-push' app into Tomcat

smaldini
Sorry I didn't get any chances to debug that this week.. I've worked on some patch locally but didn't release them yet.

On Fri, Jul 20, 2012 at 5:00 PM, thomasbee <[hidden email]> wrote:

Ok, I am falling back to the grails /atmosphere / rather than /event-push/
plugin with "streaming" transport for the time being. Cannot get the other
plugin to work when deploying on Tomcat.

.t



--
View this message in context: http://grails.1312388.n4.nabble.com/Deployment-of-events-push-app-into-Tomcat-tp4631195p4631962.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Stéphane MALDINI
--


Loading...