Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] access CDO server in same JVM like CDO Sessions view
[CDO] access CDO server in same JVM like CDO Sessions view [message #687211] Thu, 16 June 2011 06:23 Go to next message
John Smith is currently offline John SmithFriend
Messages: 137
Registered: July 2009
Senior Member
Hi, I started a CDO server in my Eclipse application, now in the same
Eclipse instance, I wanted to use the CDO Session view to create a
session. This however results in a time-out. I can programmatically
connect to the CDO server, but the CDO Session view cannot. Can it only
connect to CDO servers not deployed in the same JVM?
Re: [CDO] access CDO server in same JVM like CDO Sessions view [message #687230 is a reply to message #687211] Fri, 17 June 2011 07:04 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Am 16.06.2011 08:23, schrieb exquisitus:
<blockquote cite="mid:itc70t$295$1@news.eclipse.org" type="cite">Hi,
I started a CDO server in my Eclipse application, now in the same
Eclipse instance, I wanted to use the CDO Session view to create a
session. This however results in a time-out. I can
programmatically connect to the CDO server, but the CDO Session
view cannot. Can it only connect to CDO servers not deployed in
the same JVM?
<br>
</blockquote>
The only restriction of the CDO session view is that it can only
connect to repositories through Net4j protocols (but there are no
otheres that I know of :P ). If your repository lives in the same
JVM as your client (e.g. the CDO sessions view) you should setup a
JVMConnector as shown in, e.g., 
org.gastro.server.internal.web.GastroServlet.init():<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-15">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = -->
<!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td nowrap="nowrap" align="left"
valign="top"> <code>
<font color="#ffffff">    </font><font color="#000000">acceptor = </font><font
color="#000000">(</font><font color="#000000">IAcceptor</font><font
color="#000000">)</font><font color="#000000">IPluginContainer.INSTANCE.getElement</font><font
color="#000000">(</font><font color="#2a00ff">"org.eclipse.net4j.acceptors"</font><font
color="#000000">, </font><font color="#2a00ff">"jvm"</font><font
color="#000000">, </font></code><code><font
color="#2a00ff">"myAcceptorName"</font></code><code><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">    </font><font color="#000000">connector = Net4jUtil.getConnector</font><font
color="#000000">(</font><font color="#000000">IPluginContainer.INSTANCE, </font><font
color="#2a00ff">"jvm"</font><font color="#000000">, </font></code><code><font
color="#2a00ff">"myAcceptorName"</font></code><code></code><code><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">    </font><font color="#000000">CDOSessionConfiguration config = CDONet4jUtil.createSessionConfiguration</font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff">    </font><font color="#000000">config.setConnector</font><font
color="#000000">(</font><font color="#000000">connector</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">    </font><font color="#000000">config.setRepositoryName</font><font
color="#000000">(</font><font color="#000000">repositoryName</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">    </font><font color="#000000">CDOSession session = config.openSession</font><font
color="#000000">()</font><font color="#000000">;</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== -->
<br>
Don't forget to deploy these plugins:<br>
<br>
<span class="MsgBodyText">    org.eclipse.emf.cdo.net4j<br>
</span><span class="MsgBodyText">   
org.eclipse.emf.cdo.server.net4j</span><br>
    org.eclipse.net4j.jvm<br>
<br>
And note, the "Server Description" in the OpenSessionDialog should
then look like "jvm://myAcceptorName".<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a><br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
</body>
</html>


Re: [CDO] access CDO server in same JVM like CDO Sessions view [message #687509 is a reply to message #687211] Fri, 17 June 2011 07:04 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Am 16.06.2011 08:23, schrieb exquisitus:
<blockquote cite="mid:itc70t$295$1@news.eclipse.org" type="cite">Hi,
I started a CDO server in my Eclipse application, now in the same
Eclipse instance, I wanted to use the CDO Session view to create a
session. This however results in a time-out. I can
programmatically connect to the CDO server, but the CDO Session
view cannot. Can it only connect to CDO servers not deployed in
the same JVM?
<br>
</blockquote>
The only restriction of the CDO session view is that it can only
connect to repositories through Net4j protocols (but there are no
otheres that I know of :P ). If your repository lives in the same
JVM as your client (e.g. the CDO sessions view) you should setup a
JVMConnector as shown in, e.g., 
org.gastro.server.internal.web.GastroServlet.init():<br>
<br>
<title></title>
<style type="text/css">
<!--code { font-family: Courier New, Courier; font-size: 10pt; margin: 0px; }-->
</style>
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-15">
<!-- ======================================================== -->
<!-- = Java Sourcecode to HTML automatically converted code = -->
<!-- = Java2Html Converter 5.0 [2006-02-26] by Markus Gebhard markus@jave.de = -->
<!-- = Further information: http://www.java2html.de = -->
<div class="java" align="left">
<table bgcolor="#ffffff" border="0" cellpadding="3"
cellspacing="0">
<tbody>
<tr>
<!-- start source code --> <td nowrap="nowrap" align="left"
valign="top"> <code>
<font color="#ffffff">    </font><font color="#000000">acceptor = </font><font
color="#000000">(</font><font color="#000000">IAcceptor</font><font
color="#000000">)</font><font color="#000000">IPluginContainer.INSTANCE.getElement</font><font
color="#000000">(</font><font color="#2a00ff">"org.eclipse.net4j.acceptors"</font><font
color="#000000">, </font><font color="#2a00ff">"jvm"</font><font
color="#000000">, </font></code><code><font
color="#2a00ff">"myAcceptorName"</font></code><code><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">    </font><font color="#000000">connector = Net4jUtil.getConnector</font><font
color="#000000">(</font><font color="#000000">IPluginContainer.INSTANCE, </font><font
color="#2a00ff">"jvm"</font><font color="#000000">, </font></code><code><font
color="#2a00ff">"myAcceptorName"</font></code><code></code><code><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">    </font><font color="#000000">CDOSessionConfiguration config = CDONet4jUtil.createSessionConfiguration</font><font
color="#000000">()</font><font color="#000000">;</font><br>
<font color="#ffffff">    </font><font color="#000000">config.setConnector</font><font
color="#000000">(</font><font color="#000000">connector</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff">    </font><font color="#000000">config.setRepositoryName</font><font
color="#000000">(</font><font color="#000000">repositoryName</font><font
color="#000000">)</font><font color="#000000">;</font><br>
<font color="#ffffff"></font><br>
<font color="#ffffff">    </font><font color="#000000">CDOSession session = config.openSession</font><font
color="#000000">()</font><font color="#000000">;</font></code>
</td>
<!-- end source code --> </tr>
</tbody>
</table>
</div>
<!-- = END of automatically generated HTML code = -->
<!-- ======================================================== -->
<br>
Don't forget to deploy these plugins:<br>
<br>
<span class="MsgBodyText">    org.eclipse.emf.cdo.net4j<br>
</span><span class="MsgBodyText">   
org.eclipse.emf.cdo.server.net4j</span><br>
    org.eclipse.net4j.jvm<br>
<br>
And note, the "Server Description" in the OpenSessionDialog should
then look like "jvm://myAcceptorName".<br>
<br>
Cheers<br>
/Eike<br>
<br>
----<br>
<a class="moz-txt-link-freetext" href="http://www.esc-net.de">http://www.esc-net.de</a><br>
<a class="moz-txt-link-freetext" href="http://thegordian.blogspot.com">http://thegordian.blogspot.com</a><br>
<a class="moz-txt-link-freetext" href="http://twitter.com/eikestepper">http://twitter.com/eikestepper</a><br>
<br>
<br>
</body>
</html>


Re: [CDO] access CDO server in same JVM like CDO Sessions view [message #687529 is a reply to message #687230] Wed, 22 June 2011 04:09 Go to previous messageGo to next message
John Smith is currently offline John SmithFriend
Messages: 137
Registered: July 2009
Senior Member
Doing it like GastroServlet works, however I want to use the
OpenSessionDialog to build up the session and let the session display in
the session view. There is some kind of racing condition I guess, as I
get this log infinitely repeated:

monitor-timer [debug.signal] ================ Requesting:
Signal[protocol=cdo, id=-3, name=MonitorProgressRequest, correlation=80]
monitor-timer [debug.signal] Progress of signal 1: totalWork=100, work=1
monitor-timer [debug.buffer] Obtained Buffer@4[INITIAL]
monitor-timer [debug.buffer.stream] Put signal id -3
monitor-timer [debug.channel] Handling buffer: Buffer@4[PUTTING] -->
Channel[1, SERVER, cdo]
monitor-timer [debug.channel] Handling buffer from multiplexer:
Buffer@4[GETTING] --> Channel[1, CLIENT, cdo]
ReceiveSerializer-Channel[1, CLIENT, cdo] [debug.signal] Received buffer
for correlation 80
ReceiveSerializer-Channel[1, CLIENT, cdo] [debug.signal] Got signalID: -3
Thread-11 [debug.signal] ================ Indicating:
Signal[protocol=cdo, id=-3, name=MonitorProgressIndication, correlation=-80]
Thread-11 [debug.buffer] Retaining Buffer@4[RELEASED]
Thread-11 [debug.signal] Progress of signal 1: totalWork=100, work=1


So in cdo-server.xml I declared

<acceptor type="jvm"/>

and I typed in the OpenSessionDialog

jvm://:


The same result I get when declaring

<acceptor type="jvm" listenAddr="myAcceptorName"/>

and I typed in the OpenSessionDialog

jvm://myAcceptorName:

(note that the : must always be entered! Somewhere in the code,
xmlElement.getAttribute("port") was executed, which returns never null,
but the CDO code checks for null to determine whether a port is
specified or not => should also check for empty string).

Maybe you can yourself try to define a cdo-server.xml, with jvm-acceptor
and use the OpenSessionDialog in the same JVM.




>> Hi, I started a CDO server in my Eclipse application, now in the same
>> Eclipse instance, I wanted to use the CDO Session view to create a
>> session. This however results in a time-out. I can programmatically
>> connect to the CDO server, but the CDO Session view cannot. Can it
>> only connect to CDO servers not deployed in the same JVM?
> The only restriction of the CDO session view is that it can only connect
> to repositories through Net4j protocols (but there are no otheres that I
> know of :P ). If your repository lives in the same JVM as your client
> (e.g. the CDO sessions view) you should setup a JVMConnector as shown
> in, e.g., org.gastro.server.internal.web.GastroServlet.init():
>
> |acceptor =
> (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors",
> "jvm", ||"myAcceptorName"||);
> connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, "jvm",
> ||"myAcceptorName"||||);
>
> CDOSessionConfiguration config = CDONet4jUtil.createSessionConfiguration();
> config.setConnector(connector);
> config.setRepositoryName(repositoryName);
>
> CDOSession session = config.openSession();|
>
>
> Don't forget to deploy these plugins:
>
> org.eclipse.emf.cdo.net4j
> org.eclipse.emf.cdo.server.net4j
> org.eclipse.net4j.jvm
>
> And note, the "Server Description" in the OpenSessionDialog should then
> look like "jvm://myAcceptorName".
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
Re: [CDO] access CDO server in same JVM like CDO Sessions view [message #687535 is a reply to message #687529] Wed, 22 June 2011 07:43 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 22.06.2011 06:09, schrieb exquisitus:
> Doing it like GastroServlet works, however I want to use the OpenSessionDialog to build up the session and let the session display in the session view. There is some kind of racing condition I guess, as I get this log infinitely repeated:
>
> monitor-timer [debug.signal] ================ Requesting: Signal[protocol=cdo, id=-3, name=MonitorProgressRequest, correlation=80]
> monitor-timer [debug.signal] Progress of signal 1: totalWork=100, work=1
> monitor-timer [debug.buffer] Obtained Buffer@4[INITIAL]
> monitor-timer [debug.buffer.stream] Put signal id -3
> monitor-timer [debug.channel] Handling buffer: Buffer@4[PUTTING] --> Channel[1, SERVER, cdo]
> monitor-timer [debug.channel] Handling buffer from multiplexer: Buffer@4[GETTING] --> Channel[1, CLIENT, cdo]
> ReceiveSerializer-Channel[1, CLIENT, cdo] [debug.signal] Received buffer for correlation 80
> ReceiveSerializer-Channel[1, CLIENT, cdo] [debug.signal] Got signalID: -3
> Thread-11 [debug.signal] ================ Indicating: Signal[protocol=cdo, id=-3, name=MonitorProgressIndication, correlation=-80]
> Thread-11 [debug.buffer] Retaining Buffer@4[RELEASED]
> Thread-11 [debug.signal] Progress of signal 1: totalWork=100, work=1
>
>
> So in cdo-server.xml I declared <acceptor type="jvm"/> and I typed in the OpenSessionDialog jvm://:
The version below looks better.

>
>
> The same result I get when declaring
>
> <acceptor type="jvm" listenAddr="myAcceptorName"/>
>
> and I typed in the OpenSessionDialog
>
> jvm://myAcceptorName:
>
> (note that the : must always be entered! Somewhere in the code, xmlElement.getAttribute("port") was executed, which returns never null, but the CDO code checks for null to determine whether a port is specified or not => should also check for empty string).
Can you please file a bugzilla for this bug?

Additionally we can introduce a pure description="..." attribute to make this more flexible. We'd need a separate bugzilla for this.

>
> Maybe you can yourself try to define a cdo-server.xml, with jvm-acceptor and use the OpenSessionDialog in the same JVM.
I will do so when I come to your bugzilla. Due to the recent release preparations the queue is not very short!

Cheers
/Eike

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


>
>
>
>
>>> Hi, I started a CDO server in my Eclipse application, now in the same
>>> Eclipse instance, I wanted to use the CDO Session view to create a
>>> session. This however results in a time-out. I can programmatically
>>> connect to the CDO server, but the CDO Session view cannot. Can it
>>> only connect to CDO servers not deployed in the same JVM?
>> The only restriction of the CDO session view is that it can only connect
>> to repositories through Net4j protocols (but there are no otheres that I
>> know of :P ). If your repository lives in the same JVM as your client
>> (e.g. the CDO sessions view) you should setup a JVMConnector as shown
>> in, e.g., org.gastro.server.internal.web.GastroServlet.init():
>>
>> |acceptor =
>> (IAcceptor)IPluginContainer.INSTANCE.getElement("org.eclipse.net4j.acceptors",
>> "jvm", ||"myAcceptorName"||);
>> connector = Net4jUtil.getConnector(IPluginContainer.INSTANCE, "jvm",
>> ||"myAcceptorName"||||);
>>
>> CDOSessionConfiguration config = CDONet4jUtil.createSessionConfiguration();
>> config.setConnector(connector);
>> config.setRepositoryName(repositoryName);
>>
>> CDOSession session = config.openSession();|
>>
>>
>> Don't forget to deploy these plugins:
>>
>> org.eclipse.emf.cdo.net4j
>> org.eclipse.emf.cdo.server.net4j
>> org.eclipse.net4j.jvm
>>
>> And note, the "Server Description" in the OpenSessionDialog should then
>> look like "jvm://myAcceptorName".
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>


Previous Topic:Common editor for model + model extension
Next Topic:[CDO] CDO4 depends on which EMF version?
Goto Forum:
  


Current Time: Fri Apr 19 06:23:17 GMT 2024

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

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

Back to the top