Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Problems with renamed server session
Problems with renamed server session [message #1235106] Thu, 23 January 2014 15:30 Go to next message
Urs Beeli is currently offline Urs Beeli
Messages: 335
Registered: October 2012
Location: Bern, Switzerland
Senior Member
In our project we have three scout applications that (will) have some dependencies on each other. In preparation for this (they will inherit their sessions in a chain) I refactored the ServerSession and ClientSession classes to AngebotServerSession and AngebotClientSession.

Since I've done this, I can no longer connect to the server (neither using the client nor a web browser to connect to localhost:8080/Angebot/process). I always get the following exception:

WARN org.eclipse.jetty.servlet.ServletHandler: /scoutAngebot/process
javax.servlet.ServletException: Expected init-param "session"
at org.eclipse.scout.rt.server.ServiceTunnelServlet.lazyInit(ServiceTunnelServlet.java:131)

Looking at the code in ServiceTunnelServlet.lazyInit() the method first tries to us getServletConfig().getInitParameter("session") to get the server session class name and if that fails, it will try to load the hard coded class named "ServerSession".

How/where do I need to configure my class name?

As far as I can tell, the renaming of ClientSession to AngebotClientSession has no such pitfalls. Is that correct, or did I miss something there?
Re: Problems with renamed server session [message #1235244 is a reply to message #1235106] Thu, 23 January 2014 22:37 Go to previous messageGo to next message
Lukas Huser is currently offline Lukas Huser
Messages: 42
Registered: March 2010
Member
Hi Urs

You are already close to the solution Smile

"Urs Beeli"
How/where do I need to configure my class name?

Servlets are registered with a context path directly in the plugin.xml file of the server bundle. Here you can also provide additional servlet init-params.

Your adapted servlet registration will look similar to the following:
      <servlet
            alias="/process"
            class="org.eclipse.scout.rt.server.ServiceTunnelServlet">
         <init-param
               name="min-version"
               value="0.0.0">
         </init-param>
         <init-param
               name="session"
               value="playground.server.core.PlaygroundServerSession">
         </init-param>         
      </servlet>


The ServiceTunnelServlet might be registered multiple times with different context paths (e.g. if you are using RAP). Make sure to adapt all occurrences accordingly.

Also, you might want to double-check the session attribute of registered services (in the plugin.xml of both the client and server bundle). Here also the new session classes should be referenced.
Example:
      <service
            factory="org.eclipse.scout.rt.server.services.ServerServiceFactory"
            class="playground.server.core.ExampleService"
            session="playground.server.core.PlaygroundServerSession">
      </service>



Lukas
Re: Problems with renamed server session [message #1235582 is a reply to message #1235244] Fri, 24 January 2014 18:15 Go to previous message
Urs Beeli is currently offline Urs Beeli
Messages: 335
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Lukas, thanks a lot. Eclipse automatically adjusted the session class for the ServiceFactories and Proxies in the server and client plugin.xml files. The one crucial missing bit of information was how to tell the servlet which session to use (because that entry had been missing altogether in my plugin.xml and it just worked because the servicetunnel fell back on the default name).

Now all works as expected. Thanks for your help.
Previous Topic:Scout RAP - Margin between group box columns
Next Topic:XML validation with XSD
Goto Forum:
  


Current Time: Fri Oct 24 11:40:55 GMT 2014

Powered by FUDForum. Page generated in 0.10632 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software