Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350606

Summary: INTERNAL_SERVER_ERROR (Nullpointer Exception) when accessing process HTML page of project
Product: z_Archived Reporter: Daniel Wiehl <daniel.wiehl>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: zimmermann
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Attachments:
Description Flags
Tempoary fix for ServiceTunnelServlet none

Description Daniel Wiehl CLA 2011-06-28 11:59:09 EDT
When accessing the project's process page in web browser, an internal server error occurs due to a Nullpointer Exception.

This was reported on Eclipse Scout forum: http://www.eclipse.org/forums/index.php/mv/msg/216414/689713/#msg_689713.

The original post is:
Hi, I am absolutely new to scout. I read the tutorials, consumed to webinar and read the documentation as far. Because this project seems to be interesting I installed to minicrm tutorial. After started the server, I try to connect via the browser. While connecting there is a npe thrown:

HTTP ERROR 500

Problem accessing /TutorialMiniCrm/process. Reason:

INTERNAL_SERVER_ERROR

Caused by:

java.lang.NullPointerException
at org.eclipse.scout.rt.shared.services.common.security.ACCESS.check(Unknown Source)
at org.eclipse.scout.rt.server.admin.html.view.ServicesView.isVisible(Unknown Source)
at org.eclipse.scout.rt.server.admin.html.view.TopView.produceBody(Unknown Source)
at org.eclipse.scout.rt.server.admin.html.AdminSession.serviceRequest(Unknown Source)
at org.eclipse.scout.rt.server.ServiceTunnelServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.scout.http.servletfilter.HttpServletEx.access$0(Unknown Source)
at org.eclipse.scout.http.servletfilter.HttpServletEx$1.service(Unknown Source)
at org.eclipse.scout.http.servletfilter.internal.FilterChainImpl.doFilter(Unknown Source)
at org.eclipse.scout.rt.server.servlet.filter.AbstractChainableSecurityFilter.doFilterInternal(Unknown Source)
at org.eclipse.scout.rt.server.servlet.filter.AbstractChainableSecurityFilter.access$0(Unknown Source)
at org.eclipse.scout.rt.server.servlet.filter.AbstractChainableSecurityFilter$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Unknown Source)
at org.eclipse.scout.rt.server.servlet.filter.AbstractChainableSecurityFilter.doFilter(Unknown Source)
at org.eclipse.scout.http.servletfilter.internal.FilterChainImpl.doFilter(Unknown Source)
at org.eclipse.scout.http.servletfilter.ServletFilterDelegate.delegateServiceMethod(Unknown Source)
at org.eclipse.scout.http.servletfilter.HttpServletEx.service(Unknown Source)
at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Powered by Jetty://

What am I doing wrong?

Thank you!
Comment 1 Daniel Wiehl CLA 2011-06-28 12:29:57 EDT
The problem is solved and the fix will be included in SR1 on 9/23/2011.

Description:
When accessing the project's process page in a webbrowser, the GET request did not run in a Scout server job. Thus, services with session scope could not be resolved which caused the reported Nullpointer exception. The problem is located in org.eclipse.scout.rt.server.ServiceTunnelServlet.

Please note, that the client-server communication of the application was not affected as it is based on POST and not on GET requests.

Prior to SR1, you can solve the problem in 2 ways:
1. Use P2 nightly build updatesite and update Scout RT accordingly: http://download.eclipse.org/scout/nightly/update/. Please be in mind, that the nightly build might be unstable.

2. Extend the class ServiceTunnelServlet and overwrite the faulty method doGet with a temporary fix. In order to work, replace the existing ServiceTunnelServlet registration in plugin.xml of server plugin with the new servlet class.
E.g. change
<servlet alias="/process" class="com.blubber.server.ServiceTunnelServlet">
  <init-param name="min-version" value="0.0.0"/>
</servlet>
to
<servlet alias="/process" class="com.blubber.server.ServiceTunnelServletEx">
  <init-param name="min-version" value="0.0.0"/>
</servlet>
.

The file 'ServiceTunnelServletEx' can be found in the files that belong to this bug.
Comment 2 Daniel Wiehl CLA 2011-06-28 12:35:10 EDT
Created attachment 198753 [details]
Tempoary fix for ServiceTunnelServlet

Tempoary fix for ServiceTunnelServlet to run GET request in a server job.
Comment 3 Daniel Wiehl CLA 2011-06-28 12:37:38 EDT
Fixed ServiceTunnelServlet for milestone 3.7.1 (SR1)
Comment 4 Matthias Zimmermann CLA 2011-10-10 12:46:56 EDT
shipped with scout 3.7.1