We already address #1 See: MessageBus.conversationWith(Message, MessageCallback);
#2: I will definitely start looking into that. Obviously we haven't considered the
needs for thread safety there as we assume a single-server environment.... but obviously
people are going to want to cluster as you are. So I'll see what I can do.
Mike.
On 2010-01-29, at 11:14 AM, Kevin Jordan wrote:
By the way, it did work in my large scale application too. Although
if something like gwt-user.jar gets in there, even though Tomcat says it won’t load it
because it has a servlet implementation in there, it will mess up Errai’s
TomcatCometServlet anyways.
Now my only concerns with Terracotta are:
1) The way the conversation callbacks work. I still figure a direct callback in the
conversation call to the server would be better than providing a subject to send it to
since for my application I might have a few instances of the same component up that would
make the same type of call to the server and unless it can keep tracking of an individual
listener to that subject for that conversation, then I’m not sure it would work for me as
it is since I don’t want all the callbacks being called and I’d like to avoid having to
have a counter or something to make them distinct.
2) Getting it working in a clustered environment. I figure the variables I need to
share are the listener and subscription collections in ServerMessageBusImpl, but I’m not
sure where to cut off where the memory needs to be shared so I keep having to add
synchronization/locks to methods and add fields as transient. But eventually, until I
took it out, Terracotta got to throwing messages about down to as far as just logging. So
the question is, is there anything on the roadmap about making Errai thread-safe for a
clustered environment? Errai is pretty powerful as is, but it would be even more so if it
could be used in a clustered environment instead of a single web server.
From: Kevin Jordan [mailto:kevin.jordan@xteconline.com]
Sent: Tuesday, January 26, 2010 10:01 AM
To: 'Mike Brock'
Cc: 'errai-users(a)lists.jboss.org'
Subject: RE: [errai-users] Trouble sending messages
Seems to work in my small example now with the latest snapshot. I’ll let you know if I
have any problems with my large application.
From: Mike Brock [mailto:cbrock@redhat.com]
Sent: Monday, January 25, 2010 11:11 PM
To: Kevin Jordan
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
By the way, this is very important -- as we've recently discovered. You must use the
AsyncDispatcher when you're using the comet servlet, otherwise you'll end up
getting serious contention locks.
Add this to your ErraiServices.properties
errai.dispatcher_implementation=org.jboss.errai.bus.server.AsyncDispatcher
On 2010-01-25, at 10:20 PM, Mike Brock wrote:
These are the bare minimum files I left that made it work. So the problem exists in some
file outside these files.
errai-bus-1.0-SNAPSHOT.jar
errai-common-1.0-SNAPSHOT.jar
guice-2.0-aopalliance.jar
guice-2.0.jar
guice-servlet-2.0.jar
gwt-mosaic-dnd-0.2.0.jar
log4j-1.2.14.jar
mvel2-2.0.16-SNAPSHOT.jar
slf4j-api-1.5.10.jar
slf4j-log4j12-1.5.10.jar
On 2010-01-25, at 4:48 PM, Kevin Jordan wrote:
Well, at least it’s reproducible. I was going crazy trying to figure out why it would
have been doing it and only on my network.
From: Mike Brock [mailto:cbrock@redhat.com]
Sent: Monday, January 25, 2010 3:42 PM
To: Kevin Jordan
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
Okay, this causes the problem. Hopefully I can now use this to track down the problem.
On 2010-01-25, at 3:58 PM, Kevin Jordan wrote:
Same thing happened with the small example. I’ve posted it here for you to try:
http://kjordan.net/ErraiTest.war
From: errai-users-bounces(a)lists.jboss.org [mailto:errai-users-bounces@lists.jboss.org] On
Behalf Of Kevin Jordan
Sent: Monday, January 25, 2010 2:40 PM
To: 'Mike Brock'
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
Well, just to make sure it wasn’t anything Linux distro specific, I installed Fedora 12
with the tomcat native library through yum, and then downloaded the tomcat 6.0.24
distribution and it does the exact same thing there. All I did was modify it so it used
NIO for the connector and also so that valve was enabled in context.xml, but I still get
the same errors. There shouldn’t be anything else I have to configure elsewhere, correct?
I guess I’ll try my small example again with the TomcatCometServlet and see what happens
with that. The only thing, unless I’m missing a config somewhere else, I can think of is
something else making it fail on that servlet.
From: Mike Brock [mailto:cbrock@redhat.com]
Sent: Monday, January 25, 2010 2:29 PM
To: Kevin Jordan
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
I'm really unsure as to what can be the problem. All I know -- and this is supported
by Tomcat documentation -- is that the service() method should *never* be called on a
servlet that calls CometProcessor.
I also know that it's working in our tests, so I'm really at a loss to describe
the problem.
Perhaps you can try writing and deploying a simple Servlet that implements CometProcessor
and test to see if Tomcat calls the event() method or the servlet() method. That should
provide an objective test as to whether or not this is Errai or Tomcat.
On 2010-01-25, at 2:45 PM, Kevin Jordan wrote:
Well, I’ve been taking Terracotta in and out to see if it makes a difference, but I get
it either way. It’s only 3 lines in my Tomcat startup script to take it completely out.
From: Mike Brock [mailto:cbrock@redhat.com]
Sent: Monday, January 25, 2010 1:44 PM
To: Kevin Jordan
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
I don't much know how Terracotta works, but if it is in any way getting in between
the way the TomcatCometServlet deploys and Tomcat... that could explain the problem. This
is why we had to stop using Guice-Servlet.
The way that Tomcat decides to use AIO is if it detects the marker interface on the
servlet. And it only supports it when deployed directly, not through any intermediary.
On 2010-01-25, at 2:34 PM, Kevin Jordan wrote:
And maybe not…added that in and it does show up in the stack trace now:
*************************************************************************************************
** PROBLEM!
** It appears something has been incorrectly configured. In order to use ErraiBus
** on Tomcat, you must ensure that you are using the NIO or APR connector. Also
** make sure that you have added these lines to your WEB-INF/web.xml file:
** ---
** <servlet>
** <servlet-name>TomcatErraiServlet</servlet-name>
**
<servlet-class>org.jboss.errai.bus.server.servlet.TomcatCometServlet</servlet-class>
** <load-on-startup>1</load-on-startup>
** </servlet>
**
** <servlet-mapping>
** <servlet-name>TomcatErraiServlet</servlet-name>
** <url-pattern>*.erraiBus</url-pattern>
** </servlet-mapping>
** ---
** If you have the following lines in your WEB-INF/web.xml, you must comment or remove
them:
** ---
** <listener>
**
<listener-class>org.jboss.errai.bus.server.ErraiServletConfig</listener-class>
** </listener>
*************************************************************************************************
java.lang.Exception: Stack tracing...
at
org.jboss.errai.bus.server.servlet.TomcatCometServlet.service(TomcatCometServlet.java:133)
at javax.servlet.http.HttpServlet.service(Unknown Source)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown
Source)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
at org.apache.catalina.valves.CometConnectionManagerValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
at org.apache.catalina.ha.tcp.ReplicationValve.invoke(Unknown Source)
at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(Unknown Source)
at
org.terracotta.modules.tomcat.tomcat_5_5.SessionValve55.invoke(SessionValve55.java:52)
at org.apache.catalina.connector.CoyoteAdapter.service(Unknown Source)
at org.apache.coyote.http11.Http11NioProcessor.process(Unknown Source)
at
org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Unknown
Source)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(Unknown Source)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
From: errai-users-bounces(a)lists.jboss.org [mailto:errai-users-bounces@lists.jboss.org] On
Behalf Of Kevin Jordan
Sent: Monday, January 25, 2010 1:30 PM
To: 'Mike Brock'
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
Well, I think just by looking at that context.xml, I can see what I’m missing then:
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve"
/>
That was commented out in mine and I’ve never seen anything on that in any articles on
comet on Tomcat, but by that name and the comment above it, it has to be it.
From: Mike Brock [mailto:cbrock@redhat.com]
Sent: Monday, January 25, 2010 1:25 PM
To: Kevin Jordan
Cc: errai-users(a)lists.jboss.org
Subject: Re: [errai-users] Trouble sending messages
Attached are the server.xml and context.xml files we use for testing.
_______________________________________________
errai-users mailing list
errai-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/errai-users