Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo as windows service(Changes between 3.2.0 and 3.5.0 for starting Virgo as windows service)
Virgo as windows service [message #940659] Thu, 11 October 2012 21:28 Go to next message
Prasanth Salla is currently offline Prasanth Salla
Messages: 4
Registered: May 2011
Junior Member
We currently use Virgo 3.0.2.RELEASE. The Virgo is starting as a windows service using the Tanuki Java Wrapper software. The parameters we pass to the Wrapper software as below:

wrapper.conf for 3.0.2

set.default.SERVER_HOME=%VWS_HOME%
set.default.CONFIG_DIR=%SERVER_HOME%/config

wrapper.app.parameter.1=org.eclipse.virgo.osgi.launcher.Launcher
wrapper.app.parameter.2=-config
wrapper.app.parameter.3=%SERVER_HOME%/lib/org.eclipse.virgo.kernel.launch.properties
wrapper.app.parameter.4=-Forg.eclipse.virgo.kernel.home=%SERVER_HOME%
wrapper.app.parameter.5=-Forg.eclipse.virgo.kernel.config=%CONFIG_DIR%
wrapper.app.parameter.6=-Fosgi.configuration.area=%SERVER_HOME%/work/osgi/configuration
wrapper.app.parameter.7=-Fosgi.java.profile=file:%SERVER_HOME%/lib/java6-server.profile
wrapper.app.parameter.8=-Fosgi.clean=true

When we do something similar for the Virgo 3.5.0.RELEASE the service is not startign and the interestingly the Serviceability folder is not created for me to check the logs. If I start the Virgo from command line everything works fine.


wrapper.conf for 3.5.0

wrapper.app.parameter.1=org.eclipse.virgo.osgi.launcher.Launcher
wrapper.app.parameter.2=-config
wrapper.app.parameter.3=%CONFIG_DIR%/config.ini
wrapper.app.parameter.4=-Forg.eclipse.virgo.kernel.home=%SERVER_HOME%
wrapper.app.parameter.5=-Forg.eclipse.virgo.kernel.config=%CONFIG_DIR%
wrapper.app.parameter.6=-Fosgi.configuration.area=%CONFIG_DIR%
wrapper.app.parameter.7=-Fosgi.java.profile=file:%CONFIG_DIR%/java6-server.profile
wrapper.app.parameter.8=-Fosgi.clean=true

I would appreciate if you can let me know if any of the parameters for the Launcher have changed or if there is a different approach.
Re: Virgo as windows service [message #940765 is a reply to message #940659] Fri, 12 October 2012 00:07 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Yes, the launching mechanism has changed. Please see the migration notes.
Re: Virgo as windows service [message #940838 is a reply to message #940765] Fri, 12 October 2012 01:55 Go to previous messageGo to next message
Prasanth Salla is currently offline Prasanth Salla
Messages: 4
Registered: May 2011
Junior Member
Thanks Glyn for the response. I did review the migration notes and made the changes accordingly. The changes are still not working, if you can please review the changes would really appreciate.

In 3.0.2 release the library bundles required were part of the kernel.properties, in 3.5.0 not sure how to pass these to the Launcher class.
Re: Virgo as windows service [message #947858 is a reply to message #940838] Wed, 17 October 2012 14:12 Go to previous messageGo to next message
joel mann is currently offline joel mann
Messages: 7
Registered: October 2012
Junior Member
Hi, I would like to know if you were able to get this going as a service...? We are in the same boat as you. We had Virgo 3.0.3 working fine as a service, but are struggling wrapping Virgo 3.5 in a service.

Whenever we attempt to use the starter main class "org.eclipse.equinox.launcher.Main" as per the docs, we get "ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter" errors...

See my thread here for our progress.

Hopefully between the two of us with a bit of community support we can get this going! Razz
Re: Virgo as windows service [message #947865 is a reply to message #947858] Wed, 17 October 2012 14:23 Go to previous messageGo to next message
Prasanth Salla is currently offline Prasanth Salla
Messages: 4
Registered: May 2011
Junior Member
I haven't put much effort on this after the post. The key thing to figure out is how to pass the parameters required for the launcher. We don't see any log files also to debug the problem.

wrapper.app.parameter.1=org.eclipse.virgo.osgi.launcher.Launcher
wrapper.app.parameter.2=-config
wrapper.app.parameter.3=%CONFIG_DIR%/config.ini
wrapper.app.parameter.4=-Forg.eclipse.virgo.kernel.home=%SERVER_HOME%
wrapper.app.parameter.5=-Forg.eclipse.virgo.kernel.config=%CONFIG_DIR%
wrapper.app.parameter.6=-Fosgi.configuration.area=%CONFIG_DIR%
wrapper.app.parameter.7=-Fosgi.java.profile=file:%CONFIG_DIR%/java6-server.profile
wrapper.app.parameter.8=-Fosgi.clean=true

Would you mind posting the wrapper configuration your team has, I can try and reproduce what you have and see if we make progress.
Re: Virgo as windows service [message #947916 is a reply to message #947865] Wed, 17 October 2012 15:18 Go to previous messageGo to next message
joel mann is currently offline joel mann
Messages: 7
Registered: October 2012
Junior Member
I'm not sure if you have requirements to use the Tanuki Java Wrapper, however I found YAJSW (Yet Another Java Service Wrapper) to be easier to setup and get going. All you need to do is run the Virgo server (via startup.bat), then use the YAJSW tool genConfig.bat <PID of Server> and it will generate all the configurations for you. Much easier then hand jamming all the start up parameters. That is what we are using here, so our config parameters may be slightly different.

The good thing about using YAJSW, is that "in theory" it "should" be running the exact same start up procedures that are used when running the Virgo 3.5 startup.bat file.

Here's a snippet of what we have:

wrapper.working.dir=C:\\Virgo-server\\
wrapper.java.app.mainclass=org.eclipse.equinox.launcher.Main
wrapper.java.command = C:\\Program Files\\Java\\jdk1.6.0_35\\bin\\java
wrapper.java.classpath.1 = .\\lib\\org.eclipse.equinox.launcher_1.3.0.v20120308-1358.jar
wrapper.java.classpath.2 = .\\lib\\javax.transaction_1.1.1.v201105210645.jar
wrapper.java.classpath.3 = .\\lib\\javax.annotation_1.1.0.v201108011116.jar
wrapper.java.classpath.4 = .\\lib\\org.eclipse.osgi_3.8.0.v20120508-2119.jar
wrapper.java.classpath.5 = .\\lib\\org.eclipse.virgo.kernel.authentication_3.5.0.RELEASE.jar
wrapper.java.classpath.6 = .\\lib\\org.eclipse.virgo.kernel.shutdown_3.5.0.RELEASE.jar
wrapper.java.classpath.7 = .\\lib\\org.eclipse.virgo.osgi.console_3.5.0.RELEASE.jar
wrapper.java.classpath.8 = .\\lib\\org.eclipse.virgo.osgi.extensions.equinox_3.5.0.RELEASE.jar
wrapper.java.classpath.9 = .\\lib\\org.eclipse.virgo.osgi.launcher_3.5.0.RELEASE.jar
wrapper.java.classpath.10 = .\\plugins\\org.eclipse.osgi_3.8.0.v20120508-2119.jar
wrapper.java.classpath.11 = .\\plugins\\org.eclipse.equinox.console.ssh_1.0.0.v20120430-1356.jar
wrapper.app.parameter.1 = -noExit
wrapper.java.additional.1 = -Xms512m
wrapper.java.additional.2 = -Xmx1024m
wrapper.java.additional.3 = -XX:PermSize=128m
wrapper.java.additional.4 = -XX:MaxPermSize=256m
wrapper.java.additional.2 = -Xmx1024m
wrapper.java.additional.3 = -XX:PermSize=128m
wrapper.java.additional.4 = -XX:MaxPermSize=256m
wrapper.java.additional.5 = -Dcom.sun.management.jmxremote.port=9875
wrapper.java.additional.6 = -Dcom.sun.management.jmxremote.authenticate=true
wrapper.java.additional.7 = -Dcom.sun.management.jmxremote.login.config=virgo-kernel
wrapper.java.additional.8 = -Dcom.sun.management.jmxremote.access.file=.\\configuration\\org.eclipse.virgo.kernel.jmxremote.access.properties
wrapper.java.additional.9 = -Djavax.net.ssl.keyStore=.\\configuration\\keystore
wrapper.java.additional.10 = -Djavax.net.ssl.keyStorePassword=changeit
wrapper.java.additional.11 = -Dcom.sun.management.jmxremote.ssl=true
wrapper.java.additional.12 = -Dcom.sun.management.jmxremote.ssl.need.client.auth=false
wrapper.java.additional.13 = -XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.14 = -XX:ErrorFile=.\\serviceability\\error.log
wrapper.java.additional.15 = -XX:HeapDumpPath=.\\serviceability\\heap_dump.hprof
wrapper.java.additional.16 = -Djava.security.auth.login.config=.\\configuration\\org.eclipse.virgo.kernel.authentication.config
wrapper.java.additional.17 = -Dorg.eclipse.virgo.kernel.authentication.file=.\\configuration\\org.eclipse.virgo.kernel.users.properties
wrapper.java.additional.18 = -Djava.io.tmpdir=.\\work\\tmp
wrapper.java.additional.19 = -Dorg.eclipse.virgo.kernel.home=C:\\Virgo-server
wrapper.java.additional.20 = -Dosgi.java.profile=file:.\\configuration\\java6-server.profile
wrapper.java.additional.21 = -Dssh.server.keystore=.\\configuration\/hostkey.ser
wrapper.java.additional.22 = -Dorg.eclipse.virgo.kernel.home=C:\\Virgo-server
wrapper.java.additional.23 = -Dorg.eclipse.virgo.kernel.config=.\\configuration
wrapper.java.additional.24 = -Declipse.ignoreApp=true
wrapper.java.additional.25 = -Dosgi.install.area=C:\\Virgo-server
wrapper.java.additional.26 = -Dosgi.configuration.area=.\\work
wrapper.java.additional.27 = -Dosgi.frameworkClassPath=file:\/\/\/.\\lib\\javax.annotation_1.1.0.v201108011116.jar,file:\/\/\/.\\lib\\javax.transaction_1.1.1.v201105210645.jar,file:\/\/\/.\\lib\\org.eclipse.equinox.launcher_1.3.0.v20120308-1358.jar,file:\/\/\/.\\lib\\org.eclipse.osgi_3.8.0.v20120508-2119.jar,file:\/\/\/.\\lib\\org.eclipse.virgo.kernel.authentication_3.5.0.RELEASE.jar,file:\/\/\/.\\lib\\org.eclipse.virgo.kernel.shutdown_3.5.0.RELEASE.jar,file:\/\/\/.\\lib\\org.eclipse.virgo.osgi.console_3.5.0.RELEASE.jar,file:\/\/\/.\\lib\\org.eclipse.virgo.osgi.extensions.equinox_3.5.0.RELEASE.jar,file:\/\/\/.\\lib\\org.eclipse.virgo.osgi.launcher_3.5.0.RELEASE.jar,file:\/\/\/.\\plugins\\org.eclipse.osgi_3.8.0.v20120508-2119.jar,file:\/\/\/.\\plugins\\org.eclipse.equinox.console.ssh_1.0.0.v20120430-1356.jar


Not sure how much help that will be, as I mentioned earlier we get ""ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter" when trying to run with the above...

Please let us know if you are able to get this going as a service. And if anyone else has any idea why this is not working, please chime in...
Re: Virgo as windows service [message #963755 is a reply to message #947916] Tue, 30 October 2012 02:35 Go to previous messageGo to next message
Borislav Kapukaranov is currently offline Borislav Kapukaranov
Messages: 80
Registered: September 2010
Member
Hi,

These properties look fine. I'm only concerned about the value of osgi.frameworkClassPath - these VVV characters look wrong. I've seen this kind of ClassNotFoundException and it was triggered because of incorrect frameworkClassPath settings.
The whole thing with a java and a framework classpath is a bit smelly and I was thinking of removing the framework classpath for 3.6.0 or 3.7/4.0 which should ease your setup.
Could you open an enhancement in our Bugzilla so we can keep track there?

Best Regards
Bobby
Re: Virgo as windows service [message #964189 is a reply to message #963755] Tue, 30 October 2012 10:25 Go to previous messageGo to next message
Thomas Gillet is currently offline Thomas Gillet
Messages: 14
Registered: May 2011
Junior Member
Hi all, have been investigating the same issue, and I think I found a solution.

Seems to me the only problem is the osgi.frameworkClassPath property:
The Virgo startup script generates it with the same contents as the classpath, but with absolute URLs instead of relative paths (see bin/setupClasspath.bat).
I don't see any reason why.

The Eclipse launcher documentation states that this property supports relative paths, but doesn't say relative to which directory.
I tried different paths and I found it's relative to a subdirectory of the Virgo root (probably lib/ or plugins/, but I don't know for sure).

So I took the framework classpath generated by the startup script, made all paths relative and put it in the osgi.frameworkClassPath, in the wrapper conf.
And now it's working for me.

Note: "make all paths relative" means:
the entry file: ///C:\tools\virgo\lib\javax.annotation.jar becomes ../lib/javax.annotation.jar
(assuming Virgo is installed in C:\tools\virgo)

@joel mann:

I ended up with almost the same config file, so I guess replacing "." by ".." in your osgi.frameworkClassPath property should make it work.
(Also it is working fine for me without escaping any slashes).

@Borislav Kapukaranov:

I don't know what this property is for so I won't say anything about keeping it or not, but I think it could really use a little more documentation.
Also, why the hell the startup script generates this classpath with absolute URLs? It may be less confusing to use relative paths...

Re: Virgo as windows service [message #964307 is a reply to message #964189] Tue, 30 October 2012 12:24 Go to previous messageGo to next message
Borislav Kapukaranov is currently offline Borislav Kapukaranov
Messages: 80
Registered: September 2010
Member
Hi,

The property is quite self explanatory - it sets the OSGi's framework classpath. Usually it is not required but in cases where the equinox.launcher and the equinox framework bundle are in different directories, like in the Virgo case, it has to be set so that the launcher knows how to load framework classes.
As stated in the Eclipse launcher documentation it is relative to the value of the osgi.framework property which points to the equinox framework jar location relative to the Virgo's root. In our case it has value of osgi.framework=file\:plugins/org.eclipse.osgi_version.jar.
So to relativize the frameworkClasspath you need to do it relative to the plugins directory.

The absolute path point is a valid one, there isn't any particular reason for that. Could you raise a bugzilla entry so we can track the issue?

Best Regards
Bobby
Re: Virgo as windows service [message #1023612 is a reply to message #940659] Sun, 24 March 2013 18:38 Go to previous messageGo to next message
Paul Wysocki is currently offline Paul Wysocki
Messages: 1
Registered: July 2009
Junior Member
It seems that the YAJSW generate script has a bug that breaks the frameworkClassPath:

From: sourceforge.net/projects/yajsw/forums/forum/810311/topic/6036261

Quote:
We found that our in our java parameter -Dosgi.frameworkClassPath, our jars were getting separated by "," in lieu of what it should be "\,"


I had the same issue, but placing backslashes in front of the commas did the trick.
Re: Virgo as windows service [message #1027925 is a reply to message #940659] Wed, 27 March 2013 15:58 Go to previous messageGo to next message
joel mann is currently offline joel mann
Messages: 7
Registered: October 2012
Junior Member
That was my post over on the yajsw forum. Smile

Sorry to not update this thread, but yes we have it working great here now. If anyone has any issues getting this going feel free to PM me and I'll be glad to help.
Re: Virgo as windows service [message #1096572 is a reply to message #1027925] Wed, 28 August 2013 15:28 Go to previous messageGo to next message
Johan Eriksson is currently offline Johan Eriksson
Messages: 19
Registered: May 2012
Junior Member
Has anyone been successful in launching Virgo 3.6.x with YAJSW ? I'm trying and seem to be running into a classpath issue. The main class (org.eclipse.equinox.launcher.Main) is instantiated - but when it tries to load org.eclipse.core.runtime.adaptor.EclipseStarter it fails with a CNFE.

The classpath looks right to me (it was generated using genConfig).

Would appreciate any tips.
Re: Virgo as windows service [message #1097015 is a reply to message #940659] Thu, 29 August 2013 06:14 Go to previous messageGo to next message
Felix Schöpf is currently offline Felix Schöpf
Messages: 6
Registered: February 2013
Junior Member
This is the configuration I use for Virgo 3.6.0 with yajsw-stable-11.03:

wrapper.working.dir=C:\\Virgo_3.6\\
wrapper.tmp.path = ${jna_tmpdir}
wrapper.java.app.mainclass=org.eclipse.equinox.launcher.Main
wrapper.console.loglevel=INFO
wrapper.logfile=${wrapper_home}\/log\/wrapper.log
wrapper.logfile.maxsize=10m
wrapper.logfile.maxfiles=10
wrapper.console.title=Virgo
wrapper.ntservice.name=Virgo
wrapper.ntservice.displayname=Virgo
wrapper.ntservice.description=Virgo Service
wrapper.ntservice.starttype=AUTO_START
wrapper.daemon.run_level_dir=${if (new File('\/etc\/rc0.d').exists()) return '\/etc\/rcX.d' else return '\/etc\/init.d\/rcX.d'}
wrapper.tray = true
wrapper.tray.port = 15002
wrapper.on_exit.0=SHUTDOWN
wrapper.on_exit.default=RESTART
wrapper.filter.trigger.0=Exception
wrapper.filter.script.0=scripts\/trayMessage.gv
wrapper.filter.script.0.args=Exception
placeHolderSoGenPropsComeHere=
wrapper.java.command = C:\\Program Files (x86)\\Java\\jre6\\bin\\java
wrapper.java.classpath.1 = .\\lib\\javax.annotation_1.1.0.v201108011116.jar
wrapper.java.classpath.2 = .\\lib\\javax.transaction_1.1.1.v201105210645.jar
wrapper.java.classpath.3 = .\\lib\\org.eclipse.equinox.launcher_1.3.0.v20120308-1358.jar
wrapper.java.classpath.4 = .\\lib\\org.eclipse.virgo.kernel.equinox.extensions_3.6.0.RELEASE.jar
wrapper.java.classpath.5 = .\\lib\\org.eclipse.virgo.nano.authentication_3.6.0.RELEASE.jar
wrapper.java.classpath.6 = .\\lib\\org.eclipse.virgo.nano.shutdown_3.6.0.RELEASE.jar
wrapper.java.classpath.7 = .\\lib\\org.eclipse.virgo.util.env_3.6.0.RELEASE.jar
wrapper.java.classpath.8 = .\\plugins\\org.eclipse.osgi_3.8.1.v20120830-144521.jar
wrapper.java.classpath.9 = .\\plugins\\org.eclipse.equinox.console.ssh_1.0.0.v20120430-1356.jar
wrapper.app.parameter.1 = -noExit
wrapper.java.additional.1 = -Xmx512m
wrapper.java.additional.2 = -XX:MaxPermSize=512m
wrapper.java.additional.3 = -Dcom.sun.management.jmxremote.port=9875
wrapper.java.additional.4 = -Dcom.sun.management.jmxremote.authenticate=true
wrapper.java.additional.5 = -Dcom.sun.management.jmxremote.login.config=virgo-kernel
wrapper.java.additional.6 = -Dcom.sun.management.jmxremote.access.file=.\\configuration\\org.eclipse.virgo.kernel.jmxremote.access.properties
wrapper.java.additional.7 = -Djavax.net.ssl.keyStore=.\\configuration\\keystore
wrapper.java.additional.8 = -Djavax.net.ssl.keyStorePassword=changeit
wrapper.java.additional.9 = -Dcom.sun.management.jmxremote.ssl=true
wrapper.java.additional.10 = -Dcom.sun.management.jmxremote.ssl.need.client.auth=false
wrapper.java.additional.11 = -XX:+HeapDumpOnOutOfMemoryError
wrapper.java.additional.12 = -XX:ErrorFile=.\\serviceability\\error.log
wrapper.java.additional.13 = -XX:HeapDumpPath=.\\serviceability\\heap_dump.hprof
wrapper.java.additional.14 = -Djava.security.auth.login.config=.\\configuration\\org.eclipse.virgo.kernel.authentication.config
wrapper.java.additional.15 = -Dorg.eclipse.virgo.kernel.authentication.file=.\\configuration\\org.eclipse.virgo.kernel.users.properties
wrapper.java.additional.16 = -Djava.io.tmpdir=.\\work\\tmp
wrapper.java.additional.17 = -Dorg.eclipse.virgo.kernel.home=C:\\Virgo_3.6
wrapper.java.additional.18 = -Dosgi.java.profile=file:.\\configuration\\java6-server.profile
wrapper.java.additional.19 = -Dssh.server.keystore=.\\configuration\/hostkey.ser
wrapper.java.additional.20 = -Dorg.eclipse.virgo.kernel.config=.\\configuration
wrapper.java.additional.21 = -Declipse.ignoreApp=true
wrapper.java.additional.22 = -Dosgi.install.area=C:\\Virgo_3.6
wrapper.java.additional.23 = -Dosgi.configuration.area=.\\work
wrapper.java.additional.24 = -Dosgi.frameworkClassPath="file:\/\/\/C:\\Virgo_3.6\\lib\\javax.annotation_1.1.0.v201108011116.jar\,file:\/\/\/C:\\Virgo_3.6\\lib\\javax.transaction_1.1.1.v201105210645.jar\,file:\/\/\/C:\\Virgo_3.6\\lib\\org.eclipse.equinox.launcher_1.3.0.v20120308-1358.jar\,file:\/\/\/C:\\Virgo_3.6\\lib\\org.eclipse.virgo.kernel.equinox.extensions_3.6.0.RELEASE.jar\,file:\/\/\/C:\\Virgo_3.6\\lib\\org.eclipse.virgo.nano.authentication_3.6.0.RELEASE.jar\,file:\/\/\/C:\\Virgo_3.6\\lib\\org.eclipse.virgo.nano.shutdown_3.6.0.RELEASE.jar\,file:\/\/\/C:\\Virgo_3.6\\lib\\org.eclipse.virgo.util.env_3.6.0.RELEASE.jar\,file:\/\/\/C:\\Virgo_3.6\\plugins\\org.eclipse.osgi_3.8.1.v20120830-144521.jar\,file:\/\/\/C:\\Virgo_3.6\\plugins\\org.eclipse.equinox.console.ssh_1.0.0.v20120430-1356.jar"

Most likely these settings could be optimized, but I am happy as long as they are working.
Re: Virgo as windows service [message #1097056 is a reply to message #1097015] Thu, 29 August 2013 07:16 Go to previous messageGo to next message
Johan Eriksson is currently offline Johan Eriksson
Messages: 19
Registered: May 2012
Junior Member
Thanks Felix - got it working now.
Re: Virgo as windows service [message #1220674 is a reply to message #940659] Fri, 13 December 2013 01:49 Go to previous message
oumi casha is currently offline oumi casha
Messages: 8
Registered: December 2013
Location: china
Junior Member

I want use it in virgo 3.6.2 help me please
Previous Topic:Equinox based War to Virgo plan
Next Topic: Virgo Service commands are not working
Goto Forum:
  


Current Time: Thu Sep 18 17:51:49 GMT 2014

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

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