Jump to content
Excelsior Forums

Mirage

Members
  • Content count

    0
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Mirage

  • Rank
    Newbie
  1. OSGi bundles and Windows service

    Yes, indeed, Windows Control Panel/Administrative tools/Services.
  2. OSGi bundles and Windows service

    Yes, I understand this, but when I stop the service using the Stop button, the method stop or shutdown doesn't get called. This is tested very well, and I just don't see the message "RCP Service Stopping...", but I do see "RCP Service Starting...": public class WindowsService extends WinService { @Override public boolean init() { return false; // pause/resume are not supported } @Override public void run() { logInfoEvent("RCP Service Starting..."); System.out.println("RCP Service Starting..."); try { Class bootstrap = Class.forName("org.eclipse.equinox.launcher.Main"); Method main = bootstrap.getDeclaredMethod("main", String[].class); main.invoke(null, (Object) new String[] {}); } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); logErrorEvent("RCP Service failed: " + sw); } } @Override public void stop() { logInfoEvent("RCP Service Stopping..."); System.out.println("RCP Service Stopping..."); try { Class starter = Class.forName("org.eclipse.core.runtime.adaptor.EclipseStarter"); Method shutdown = starter.getDeclaredMethod("shutdown"); shutdown.invoke(null); } catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); logErrorEvent("RCP Service Stop failed: " + sw); } super.stop(); } @Override public void shutdown() { logInfoEvent("RCP Service Shutdown"); System.out.println("RCP Service Shutdown"); super.shutdown(); } }
  3. Continuous Integration Support

    I finally managed to get it working using xbind utility. The only trick is to include all JRE classes in rt.jar, because it seems this is autodetected by JetPack. It would be cool to improve the packaging process to work better with RCP installations and continuous integration. Cheers, Mirage
  4. OSGi bundles and Windows service

    Hi again, any idea why stop/shutdown doesn't get called? Thanks
  5. Continuous Integration Support

    We cannot add the plugins into the executable, because 1) some of them are nor jars (unpacked), and 2) we need to have some jars outside the executable due to external programmers contributing plugins into our applications. We could omit these plugins in the packaging process, but check out the jpn project file. It references many other plugins which are included in the executable. These plugins could still change, and we would have to update the project files whenever we change them. This is not a good solution. I don't understand why it has to be so complicated when we just need to include the runtime, and be done with it. It would be best if we could use the xbind utility, but it doesn't work for us (as I described). Could you point us into the right direction on how to use it? We already generate the prj files for our continuous integration builds, but jpn files are much more complicated. Any help would be appreciated.
  6. Continuous Integration Support

    Hi, we have an urgent problem with JetPack project files. Is there a way to automatically generate these files specifying the installation directory (intermediate)? We cannot easily use these files generated by the wizard, because it contains references to various platform plugins which we change frequently. We also have other plugins in the installation plugins directory which change their version with each build (I could workaround that by including only the executable into the project), but this doesn't help with the many references in the project file. Obviously, just copying the rt directory to the installation is not enough, because the executable has to be modified as well. xbind utility can help modify the executable, but how do I use it? If I just use the generated script file, it finishes, but the executable is not modified. We really need to solve this. Thanks for any suggestions.
  7. OSGi bundles and Windows service

    I'm sorry. Your solution really works. My colleague has been trying this with org.eclipse.core.launcher.Main instead of org.eclipse.equinox.launcher.Main. That approach really requires to specify hundreds of properties. We now have another problem. We use a shutdown hook to make cleanup procedures. We need to somehow exit the framework (either using EclipseStarter.shutdown or by calling System.exit). The problem is that methods stop or shutdown on WinService never get called. We use Win7 x64. We tried running the application in a separate thread to avoid blocking the control thread, but it seems you already do that (according to your documentation). Do you have any idea what could cause this?
  8. OSGi bundles and Windows service

    - using org.eclipse.equinox.launcher.Main is not the recommended solution - no need to use reflection - you cannot just pass an empty array with no properties to equinox (it requires hundreds of properties to be specified combining system properties, config.ini properties, and native launcher properties) - currently, we are trying to use EclipseStarter class, which is the recommended way of starting an RCP application, but you need to pass some special properties as well - we already have a working solution using srvany.exe service wrapper, but the problem is that it doesn't call the shutdown hook when we exit the application (it just kills it)
  9. OSGi bundles and Windows service

    It's not a GUI application (no interaction with desktop required). We don't even use command line (no console). It's just an RCP application which should start as a service only. It is controlled by clients connected to it using RMI.
  10. OSGi bundles and Windows service

    I have to say that this guide is not very comprehensible. We have an RCP desktop application which needs to be run as a windows service. The problem is that I don't know how to implement the method run in com.excelsior.service.WinService. It would need to start the RCP application using equinox launcher, but how do I do that the simple way? This is probably the only problem we have with Excelsior JET, so the resolution of this problem will determine whether we will buy it or not. Thank you for any tips. Mirage
×