Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » scout » Activator in org.eclipse.scout.rt.server
Activator in org.eclipse.scout.rt.server [message #915890] Tue, 18 September 2012 02:56 Go to next message
Ken Lee is currently offline Ken Lee
Messages: 97
Registered: March 2012
Member
In the start method of the Activator class in the Plugin org.eclipse.scout.rt.server (package org.eclipse.scout.rt.server.internal) I was wondering about a specific code snippet:

    // workaround for bug in serverside equinox implementation with servletbridge
    // wait until done and launch product if one exists
    if (Platform.getBundle("org.eclipse.scout.sdk") == null) {
      context.addBundleListener(new SynchronousBundleListener() {
        @Override
        public void bundleChanged(BundleEvent event) {
          if (event.getType() == BundleEvent.STARTED && event.getBundle().equals(getBundle())) {
            new Job("Product launcher") {
              @Override
              protected IStatus run(IProgressMonitor monitor) {
                if (Platform.getBundle("org.eclipse.equinox.http.servletbridge") != null) {
                  runProduct();
                }
                return Status.OK_STATUS;
              }
            }.schedule();
          }
        }
      });
    }


1. Does anybody know which server-side Equinox servletbridge bug is referred?
2. Is this workaround still needed?

In our Scout (Eclipse Scout 2012-Jan) application we registered an extension point in the plugin.xml file of the server plugin

   <extension
         id="app"
         name="Server Application"
         point="org.eclipse.core.runtime.applications">
      ...
    </extension>


This causes the server application to be started twice when deploying the web-application on a Tomcat: One instance gets started by the Activator and the other by the extension point configuration.
Since we setup a scheduler when starting the server application, we end up having 2 schedulers running concurrently.

3. What's the best practice to avoid the server application being started twice? Removing the extension point is not an option because the application won't get started on Jetty.








Re: Activator in org.eclipse.scout.rt.server [message #916602 is a reply to message #915890] Wed, 19 September 2012 04:10 Go to previous messageGo to next message
Ivan Motsch is currently offline Ivan Motsch
Messages: 100
Registered: March 2010
Senior Member
Seems that this code could now be removed.

Ken, did you check whether the servletbridge.jar in the WEB-INF/lib you use is the official one? and also the servletbridge?

I cannot remember the bug it refers, please search the bugzilla of serverside equinox for that issue.

If tests with eclipse 3.6 (!), 3.7 and 3.8 show that serverside equinox is working as expected this line can be removed.

To avoid this, please check the config.ini if it contains the org.eclipse...server bundle in the bundle start line.

remove it from there.
Re: Activator in org.eclipse.scout.rt.server [message #916646 is a reply to message #916602] Wed, 19 September 2012 05:17 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie Bresson
Messages: 639
Registered: October 2011
Senior Member
I do not think that this is directly related the Problem exposed by Ken.

But in our Scout Application we have a patched servletbridge.jar with patch proposal from Thomas Watson (see Bug 370547)

We had to do this, because the path to the Tomcat where we deploy contains some spaces (e.g. "C:/Program Files/Tomcat 6/..."). This is a company requirements and can not be changed.
Re: Activator in org.eclipse.scout.rt.server [message #917562 is a reply to message #915890] Thu, 20 September 2012 03:46 Go to previous message
Claudio Guglielmo is currently offline Claudio Guglielmo
Messages: 126
Registered: March 2010
Senior Member
Hi Ken

We experienced a similar issue more than one year ago. The ServerApplication was started twice on jetty and wasn't started at all on tomcat. Have a look at https://dev.eclipse.org/svnroot/technology/org.eclipse.scout/scout.rt/branches/3.8/org.eclipse.scout.rt.server/Release%20Notes.txt to find more details about it.

We solved it by removing the plugins „org.eclipse.equinox.http.servletbridge" and „org.eclipse.equinox.servletbridge" from the jetty product, so that the activator did not start the product. The tomcat resp. wls product file didn't have to be changed because it worked fine there.

In your case the ServerApplication is started twice on Tomcat, and not on Jetty. Maybe the servletbridge has been fixed in the meantime so that the workaround is not necessary anymore, as already explained by Ivan.

Hope that helps
Claudio
Previous Topic:Scout and EclipseLink
Next Topic:Change Mouse Pointer on AbstractTable
Goto Forum:
  


Current Time: Tue Jul 29 19:05:40 EDT 2014

Powered by FUDForum. Page generated in 0.02373 seconds