JeffLeFoll / gwteventservice

An event-based client-server communication framework.
http://code.google.com/p/gwteventservice
Other
3 stars 3 forks source link

RPC dies after 6 hours continuous working #29

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Modify the sources of conversation-ui-1.2.0 demo so that browser would send 
a chat message each 3 seconds. I did:
in ConversationControl.java, init()
    private void init(final ConversationMessagePanel aConversationMessagePanel) {
        aConversationMessagePanel.addSendButtonListener(new ClickHandler() {
            public void onClick(ClickEvent aClickEvent) {
                final String theMessage = aConversationMessagePanel.getMessageText();
                if(theMessage.trim().length() > 0) {
                    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
                        public boolean execute() {
                            myConversationService.sendMessage(myUser, theMessage, new VoidAsyncCallback<Void>());
                            return true;
                        }
                      }, 3000);
                    Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
                        public boolean execute() {
                            myConversationMainPanel.reset();
                            return true;
                        }
                      }, 9000);                    
                    //aConversationMessagePanel.resetMessageText();
                }
            }
        });
    }
in GWTConversationMessagePanel constructor, increase max length:
    public GWTConversationMessagePanel() {
        mySendButton = new Button();
        mySendButton.setText("Send");
        myHandlerRegistrations = new ArrayList<HandlerRegistration>();

        myMessageTextBox = new TextBox();
        myMessageTextBox.setMaxLength(4096);
     ...
2. login in Firefox, paste 4Kb text file into message input field
3. login in couple of other browsers, also type something and press Send

After 6 hours, server stops serving requests and just logs NPE many times per 
second:

Nov 2, 2010 12:25:53 PM org.apache.catalina.core.ApplicationContext log
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public 
abstract java.util.List 
de.novanic.eventservice.client.event.service.EventService.listen()' threw an 
unexpected exception: java.lang.NullPointerException
at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:581)
at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceSer
vlet.java:188)
at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceSer
vlet.java:224)
at 
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemot
eServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:290)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:206)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
33)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
75)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109
)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Pr
otocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at 
de.novanic.eventservice.service.connection.id.SessionConnectionIdGenerator.getCo
nnectionId(SessionConnectionIdGenerator.java:57)
at 
de.novanic.eventservice.service.EventServiceImpl.getClientId(EventServiceImpl.ja
va:348)
at 
de.novanic.eventservice.service.EventServiceImpl.getClientId(EventServiceImpl.ja
va:339)
at 
de.novanic.eventservice.service.EventServiceImpl.listen(EventServiceImpl.java:22
4)
at sun.reflect.GeneratedMethodAccessor29.invoke(Unknown Source)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
... 17 more

Using sources from the trunk built with Maven, on Windows 7, Tomcat 6.0.14, 
gwt-2.1.0.M1, Firefox 3.6.12, latest Google Chrome 7.0.517.41.

Original issue reported on code.google.com by a.dolgu...@gmail.com on 2 Nov 2010 at 11:25

Attachments:

GoogleCodeExporter commented 8 years ago
I think your server has removed the session, because a session timeout was 
detected. That depends on your server configuration.

For a quick work-around you could set the GWTEventService property 
"eventservice.connection.id.generator=de.novanic.eventservice.service.connection
.id.SessionExtendedConnectionIdGenerator" (available on trunk and will be 
introduced with GWTEventService 1.2). With this property set, the session isn't 
used to identify the clients and the multiple session feature is activated 
(every browser instance gets an unique id rather than every client).

Original comment by sven.strohschein@googlemail.com on 3 Nov 2010 at 6:14

GoogleCodeExporter commented 8 years ago
Good. I modified demo/conf/eventservice.properties. How do I ensure that 
SessionExtendedConnectionIdGenerator is used when I run the server?

Original comment by a.dolgu...@gmail.com on 8 Nov 2010 at 1:02

GoogleCodeExporter commented 8 years ago
Hi again,
I tried to replace the connection id generator, but now all I get is:
Nov 13, 2010 9:16:29 PM de.novanic.eventservice.logger.DefaultServerLogger log
INFO: Server: Client "4EC23F4B5A43877DF600EFC6A202E0761666609994" initialized.

and no joined channel/ no messages transmitted

Original comment by a.dolgu...@gmail.com on 13 Nov 2010 at 3:19

GoogleCodeExporter commented 8 years ago
And later, I found exception in the log:
SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public 
abstract void 
de.novanic.gwteventservice.demo.conversationapp.client.conversation.Conversation
Service.sendMessage(java.lang.String,java.lang.String)' threw an unexpected 
exception: de.novanic.eventservice.client.config.ConfigurationException: A 
client id was requested without generating a connection id first or the 
connection id was not transferred with the request!
    at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:378)

Original comment by a.dolgu...@gmail.com on 15 Nov 2010 at 6:33

GoogleCodeExporter commented 8 years ago
Hi,

which method is used to add events within your sendMessage method?

Original comment by sven.strohschein@googlemail.com on 19 Nov 2010 at 8:15

GoogleCodeExporter commented 8 years ago
Separated E-Mail contact:

13.09.2011 Issue Opener -> Sven S.

Hi Sven,

yes I had, but we haven't yet introduced GWTEventService into our live apps.

12.09.2011 Sven S. -> Issue Opener

Hi,

the last update to Issue29 of GWTEventService 
(http://code.google.com/p/gwteventservice/issues/detail?id=29) is some time 
ago. :-) Do you have had luck with SessionExtendedConnectionIdGenerator at last?

Thank you in advance.

Regards,

Sven S.

Original comment by sven.strohschein@googlemail.com on 4 Oct 2011 at 5:51

GoogleCodeExporter commented 8 years ago
What was the solution to:

de.novanic.eventservice.client.config.ConfigurationException: A client id was 
requested without generating a connection id first or the connection id was not 
transferred with the request!

?

Original comment by bos...@gmail.com on 24 Feb 2012 at 10:53

GoogleCodeExporter commented 8 years ago
Okay, I found my issue. 

I was not using a single instance of my Async Service throughout my project. 
Also, when  setting up my RemoteEventListener, I was not registering the Client 
Specific Handler.

        RemoteEventServiceFactory.getInstance().requestClientHandler(new AsyncCallback<ClientHandler>() {

            @Override
            public void onSuccess(ClientHandler result) {
                RemoteEventServiceFactory.getInstance()
                    .registerClientSpecificHandler((ServiceDefTarget)ServiceFactory.getInstance(), result);

            }

            @Override
            public void onFailure(Throwable caught) {
            }
        });

Original comment by bos...@gmail.com on 27 Feb 2012 at 8:25