| Summary: | Application not started when deployed in servlet container via servletbridge | ||
|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Michal Tkacz <Michal.Tkacz> |
| Component: | Server-Side | Assignee: | equinox.server-side-inbox <equinox.server-side-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | batxut, raymond.auge, simon_kaegi, steve |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
While I'm probably going to have a separate bundle to start my application (so far I've been starting it manually), I wonder if there're plans to have it fixed using one of the options mentioned above (#2 sounds promising)? Hi Michael, We're not planning on doing a change like #2 in indigo but we'll still leave the bug open as we might in a future release if we're finding more Eclipse teams are starting server-side applications. What that means is for now you have to do this work manually / yourself. For what it's worth, I was able to get an application to launch with a minor modification to the servlet bridge's FrameworkLauncher class. The start() method in the launcher currently invokes the setInitialProperties() and startup() methods of the EclipseStarter in order to start the framework. By adding an invocation of the run() method on the same class, and by wrapping the invocation in a secondary thread, I was able to run my nested application (in this case, a CDO Repository Server). Since the servletbridge can be built at the same time as the web application (I'm using a RAP-like project structure), it's a relatively easy change to make for a single project. I'm sure this is far from a general solution to the problem, but it might be of some help to others in restricted cases. In my case, there is no UI code, which is one less thing to be concerned about. Also, if anyone sees any major problems with this approach, I'd appreciate being educated via follow-on comments. Closing due to inactivity. |
Build Identifier: While the OSGi console shows after deployment that the application specified with eclipse.application option is running , it isn't really. It turns out that org.eclipse.osgi.service.runnable.ApplicationLauncher service is not available during startup which prevents org.eclipse.equinox.internal.app.EclipseAppContainer from launching the default application and defers its launch. However this service is not available anytime later either. That is because it is only registered by org.eclipse.core.runtime.adaptor.EclipseStarter which is not used when the osgi container is deployed inside the servlet container via servletbridge. Thomas Watson suggests following workarounds and solutions ("Running an IApplication when deploying to Tomcat with servletbridge" thead on the newsgroup): "I had forgotten about the change we made in bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=301262 We now require the ApplicationLauncher to be registered before launching the default application no matter what the thread type is. I can see two options for you: 1) Have a bundle that registers its won ApplicationLauncher service. I would recommend it throw unsupported operation exceptions. This way you will be able to launch the default application as long as it is an any thread app. 2) Have another bundle lookup the ApplicationDescription service for the application you want to launch and launch it yourself instead of depending on the default application. There are a couple of options for us to fix this in Equinox: 1) Have the application container check to see if the framework is in the process of STARTING; if it is then monitor events to determine when the framework is active and then launch the default application any threaded application. If the framework is already active then we still may have to wait for the application launcher service 2) Have the servlet equinox launcher register an ApplicationLauncher service for you." Reproducible: Always