tomasbilek / gwteventservice

Automatically exported from code.google.com/p/gwteventservice
Other
0 stars 0 forks source link

GWTEventService EventServiceImpl Null pointer exception (de.novanic.eventservice.service.EventServiceImpl.getClientId) #27

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We are getting intermittent below error when GWTEventService is running for 
longer time. Our GWT application deployed running on JBoss application server.

Below is our eventservice.properties configuration.

time.waiting.min=0
time.waiting.max=20000
time.timeout=90000

Here is the stacktrace
ERROR [[/TEST]] 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:360)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
        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(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil                
Caused by: java.lang.NullPointerException
        at de.novanic.eventservice.service.EventServiceImpl.getClientId(Unknown Source)
        at de.novanic.eventservice.service.EventServiceImpl.getClientId(Unknown Source)
        at de.novanic.eventservice.service.EventServiceImpl.listen(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)

Any information as Why we are getting this exception and How we can resolve the 
same?

Thanks

Original issue reported on code.google.com by leogem0...@gmail.com on 28 Sep 2010 at 6:41

GoogleCodeExporter commented 8 years ago
Hi,

which version of GWTEventService are you running? I could imagine that you have 
set a server side session timeout for/with the JBoss application server and a 
client is still on the web page which is using GWTEventService. That means the 
application server has removed the session, but the client didn't got a 
timeout. Is that possible?

Regards,

Sven S.

Original comment by sven.strohschein@googlemail.com on 28 Sep 2010 at 7:59

GoogleCodeExporter commented 8 years ago
Hi Sven,

Thanks for your quick response.

we are running gwteventservice-1.1.1.jar.

We are using default settings of JBoss application server. I need to check the 
JBoss documentation if we can set any configuration on the server side for the 
session timeout on the app server level.

But as per the GWTEventService documentation we are using 
eventservice.properties file on our application classpath to configure the 
client side timeout.

You are saying with GWTEventServie we also have to configure session timeout on 
the server side too. Do we need that to use the GWTEventSerivce.

Thanks.

Original comment by leogem0...@gmail.com on 28 Sep 2010 at 8:27

GoogleCodeExporter commented 8 years ago
Hi Sven,

JBoss internally using Tomact Apache as the webserver.

The default setting for the session timeout is 30 minutes on JBoss applicaion 
server.

<!-- ==================== Default Session Configuration ================= -->
  <!-- You can set the default session timeout (in minutes) for all newly   -->
  <!-- created sessions by modifying the value below.                       -->

    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>

It looks like for the longer running requests with GWTEventService the session 
was timeout by default after 30 minutes but the client did not got timeout.

But with the eventservice.properties default configuration the client should 
timeout after 90 seconds. The GWTEventService should not throw 
NullPointerException.

Thanks.

Original comment by leogem0...@gmail.com on 28 Sep 2010 at 8:42

GoogleCodeExporter commented 8 years ago
Hi Sven,

For the work around we have increased the event service time out property in 
the eventservice.properties file to 1800000 ms which is equal to 30 min.

Also making sure to have a session object available by calling 
HttpRequest.getSession(true) on the server side.

But i am hoping GWTEventService still need to look into this and should not 
throw NullPointerException when no session is available for the long running 
requests.

Thanks.

Original comment by leogem0...@gmail.com on 5 Oct 2010 at 3:41

GoogleCodeExporter commented 8 years ago
gwteventservice-1.1.1.jar.
Server side Time out - 30 minutes
eventservice.time.timeout=90000

I get the following  error while I am doing many database updates back to back 
, update events are passed on to client ui after every updates successfully,
following exception occurs randomly,when it does happen, client is unable to 
receive any event. This occurs when both server and client were busy processing 
requests and hence no question of session timeout at server side prior to 
client. Please advice

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(RemoteServiceServlet.java:188)
        at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:224)
        at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.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(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
        at de.novanic.eventservice.service.EventServiceImpl.getClientId(Unknown Source)
        at de.novanic.eventservice.service.EventServiceImpl.getClientId(Unknown Source)
        at de.novanic.eventservice.service.EventServiceImpl.listen(Unknown Source)
        at sun.reflect.GeneratedMethodAccessor217.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)

Original comment by yasmeen....@gmail.com on 7 Oct 2010 at 5:18

GoogleCodeExporter commented 8 years ago
very rarely app recovers from this exception & continues to send the events to 
client side

Original comment by yasmeen....@gmail.com on 7 Oct 2010 at 6:11

GoogleCodeExporter commented 8 years ago
The issue occurred when all listeners were removed, a session-timeout occurred 
and after that a new listener was registered. This problem could now be 
reproduced and is solved in the trunk version (GWTEventService 1.2).

The full conversation can be read here: 
http://gwteventservice.freeforums.org/post208.html

Special thanks again to Sami and Romain for providing an example scenario and 
for help finding the bug.

Original comment by sven.strohschein@googlemail.com on 29 Jan 2011 at 4:24

GoogleCodeExporter commented 8 years ago
Sven,

Sorry, but the fix has raised another problem that I have described in the 
forum :

http://gwteventservice.freeforums.org/nullpointerexception-for-getconnectionid-t
74.html#p210

Before we had an NPE, now we have an exception, in both cases it is impossible 
to reconnect. 

Thanks

Sami

Original comment by sami.ja...@gmail.com on 8 Feb 2011 at 8:26

GoogleCodeExporter commented 8 years ago
Hi,

please try to update to the lastest trunk version again. There was still an 
issue which caused that it wasn't working with Firefox. That should now be 
solved.

Regards,

Sven S.

Original comment by sven.strohschein@googlemail.com on 9 Feb 2011 at 6:09

GoogleCodeExporter commented 8 years ago
Hi, Sven:

Shall we build from trunk for these fixes or will we expect 1.2 soon? We are at 
a critical stage and want to get a latest version for event service?

Thanks,

Original comment by yijiez...@gmail.com on 11 Feb 2011 at 7:58