Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO]: How to start the CDO-Server from a command shell without eclipse
[CDO]: How to start the CDO-Server from a command shell without eclipse [message #727953] Thu, 22 September 2011 09:33 Go to next message
Juan C. Flores is currently offline Juan C. FloresFriend
Messages: 3
Registered: September 2011
Junior Member
Hi,

I would like to start the CDO-Server without having to start the eclipse UI. What is the best to do this?

regards
Re: [CDO]: How to start the CDO-Server from a command shell without eclipse [message #727958 is a reply to message #727953] Thu, 22 September 2011 09:49 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 22.09.2011 11:33, schrieb Juan C. Flores:
> Hi,
>
> I would like to start the CDO-Server without having to start the eclipse UI. What is the best to do this?
One way is to create and export a "product" as illustrated in:

org.eclipse.emf.cdo.server.product
org.eclipse.emf.cdo.server.product-feature

Does that help?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO]: How to start the CDO-Server from a command shell without eclipse [message #727975 is a reply to message #727958] Thu, 22 September 2011 10:23 Go to previous messageGo to next message
Juan C. Flores is currently offline Juan C. FloresFriend
Messages: 3
Registered: September 2011
Junior Member
Hello Eike,

as far as I can see, the plugin starts the server using directly the osgi mechanism. Do you mean I should create an osgi-service (with the implementation in org.eclipse.emf.cdo.server.product) wich in turn starts the server?
Re: [CDO]: How to start the CDO-Server from a command shell without eclipse [message #728087 is a reply to message #727975] Thu, 22 September 2011 13:45 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 22.09.2011 12:23, schrieb Juan C. Flores:
> Hello Eike,
>
> as far as I can see, the plugin starts the server using directly the osgi mechanism. Do you mean I should create an
> osgi-service (with the implementation in org.eclipse.emf.cdo.server.product) wich in turn starts the server?
I think I was confused by the fact that this thread's subject is a little different fro the exact question in the first
post, where you ask for a UI-less way. In general CDO, EMF and Net4j can operate in a number or environments:

a) Standalone, meaning that OSGi is not *running* (some bundle jars might be needed on the flat classpath, though)
b) Headless, meaning that OSGi is running, but without any Eclipse UI
c) RCP, meaning that OSGi is running together with an Eclipse workbench
d) IDE, same as RCP but including some plugins like core.resources and ui.ide

BTW, standalone, with this definition, can theoretically mean that a UI is included, such as Swing or SWT-standalone loops.

Regarding CDO, EMF or Net4j the only thing that makes a difference is whether OSGi is running or not. More exactly one
would say whether an extension registry is active or not. And the difference is that without an extension registry a
number of factories (or other things that are contributed automatically elsewise) may need to be registered manually.
So, you can basically take any example to start a CDO server and run it standalone. Just ensure that the following calls
are being made some time at the beginning:

IManagedContainer container = IPluginContainer.INSTANCE;
Net4jUtil.prepareContainer(container); // Prepare the Net4j kernel
TCPUtil.prepareContainer(container); // Prepare the TCP transport (optional)
JVMUtil.prepareContainer(container); // Prepare the JVM transport (optional)
CDONet4jServerUtil.prepareContainer(container); // Prepare the CDO server for Net4j

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO]: How to start the CDO-Server from a command shell without eclipse [message #728419 is a reply to message #728087] Fri, 23 September 2011 09:01 Go to previous messageGo to next message
Juan C. Flores is currently offline Juan C. FloresFriend
Messages: 3
Registered: September 2011
Junior Member
Hi,

I think you are right, the subject is a little bit confusing.

Well, what I want is to start the server as simple as possible.
1) start from a comand shell script
2) The CDO-Server starts without any UI. at least no visible one.
3) If OSGI is not required, it would be great. As I said, as simple as possible

I think the variant a) is the one I am looking for.
1) I would create a new eclipse Java Project
2) Implement or copy paste a java class which starts the CDO Server and do required tasks.
3) define the required jars in the classpath

My Problem is, that I don't know which jars I need. How can I find out which jars are required?


Cheers
Re: [CDO]: How to start the CDO-Server from a command shell without eclipse [message #728459 is a reply to message #728419] Fri, 23 September 2011 09:43 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 23.09.2011 11:01, schrieb Juan C. Flores:
> Hi,
>
> I think you are right, the subject is a little bit confusing.
>
> Well, what I want is to start the server as simple as possible.
> 1) start from a comand shell script
> 2) The CDO-Server starts without any UI. at least no visible one.
> 3) If OSGI is not required, it would be great. As I said, as simple as possible
>
> I think the variant a) is the one I am looking for.
> 1) I would create a new eclipse Java Project
> 2) Implement or copy paste a java class which starts the CDO Server and do required tasks.
> 3) define the required jars in the classpath
Yes, that will work.

>
> My Problem is, that I don't know which jars I need. How can I find out which jars are required?
You could browse the dependency extent in some PDE views or editors.

Generally I recommend to create Plugin Projects rather than pure Java Projects. You can still launch your main() method
from within Eclipse. If you set a breakpoint somewhere, the debugger should show you the assembled classpath.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:Loading of XML very very slow in EMF
Next Topic:Xcore and Ecore references
Goto Forum:
  


Current Time: Tue Apr 16 15:37:38 GMT 2024

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

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

Back to the top