Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Server error with MySQL DBStore(Initialization error when using MySQL)
[CDO] Server error with MySQL DBStore [message #1708252] Tue, 15 September 2015 03:46 Go to next message
Greg Babcock is currently offline Greg BabcockFriend
Messages: 39
Registered: October 2012
Member
I am new to CDO and am using version 4.4. I have not had any problems with the H2 DBStore, but when I use the same configuration and change the DB to MySQL I get a exception when I try to create a resource.

java.lang.IllegalStateException: RootResourceID is null; is the repository not yet initialized?
at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getRootResource(AbstractCDOView.java:374)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.attachNewResourceNode(CDOTransactionImpl.java:1089)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.attachNewResource(CDOTransactionImpl.java:1013)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.attachResource(CDOTransactionImpl.java:1002)
at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.basicSetResourceSet(CDOResourceImpl.java:1658)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$ResourcesEList.inverseAdd(ResourceSetImpl.java:586)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:286)
at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:435)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:423)
at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.createResource(CDOTransactionImpl.java:881)
at com.peacemkr.config.app.emf.DomainImpl.openTransaction(DomainImpl.java:72)
at com.peacemkr.config.app.handlers.OpenTransactionHandler.execute(OpenTransactionHandler.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)


DB tables are getting created so I know there are no connection issues.

I had to build the MySQL (org.eclipse.net4j.db.mysql_4.2.2) plugin from the GIT repository because Net4J DB Framework only included the source jar, but I don't think that is the issue.

I copied the example cdo-server.xml file from the product project.

<?xml version="1.0" encoding="UTF-8"?>
<cdoServer>

<!-- ============================================================== -->
<!-- See http://wiki.eclipse.org/CDO/Server_Configuration_Reference -->
<!-- ============================================================== -->

<acceptor type="tcp" listenAddr="0.0.0.0" port="2036"/>

<!-- Examples:
<acceptor type="ssl" listenAddr="0.0.0.0" port="2036"/>
<acceptor type="http"/>
-->

<repository name="repo1">

<property name="overrideUUID" value=""/>
<property name="supportingAudits" value="true"/>
<property name="supportingBranches" value="true"/>
<property name="ensureReferentialIntegrity" value="false"/>
<property name="allowInterruptRunningQueries" value="true"/>
<property name="idGenerationLocation" value="STORE"/> <!-- Possible values: STORE | CLIENT -->
<property name="serializeCommits" value="false"/>
<property name="optimisticLockingTimeout" value="10000"/>

<!-- Example http://wiki.eclipse.org/CDO/Security_Manager
<securityManager type="default" description="/security:annotation:home(/home)"/> -->


<!-- Example http://bugs.eclipse.org/302775
<authenticator type="file" description="_database/repo1.users"/>
-->

<!-- Example http://bugs.eclipse.org/345431
<initialPackage nsURI="http://www.eclipse.org/emf/CDO/examples/company/1.0.0"/>
-->

<store type="db">

<!-- Example http://bugs.eclipse.org/396379 (if idGenerationLocation == CLIENT)
<property name="idColumnLength" value="34"/>
-->

<!-- Period at which to execute an SQL statement to keep DB connection alive, in minutes -->
<property name="connectionKeepAlivePeriod" value="60"/>

<!-- Maximum number of store accessors (JDBC connections) to keep in the reader pool. The default value is 15. -->
<property name="readerPoolCapacity" value="20"/>

<!-- Maximum number of store accessors (JDBC connections) to keep in the writer pool. The default value is 15. -->
<property name="writerPoolCapacity" value="20"/>

<mappingStrategy type="horizontal"> <!-- callout -->
<property name="qualifiedNames" value="true"/>

<!--
Per default, the objectTypeCache is in-memory and contains
100,000 cache entries. If you want to change the size,
uncomment the following line and set the desired size.
The cache can be disabled by setting a size of 0.
-->

<!-- Optional:
<property name="objectTypeCacheSize" value="100000"/>
-->

</mappingStrategy>


<!-- <dbAdapter name="h2"/>
<dataSource class="org.h2.jdbcx.JdbcDataSource"
URL="jdbc:h2:/database/repo1"/> -->

<!-- Example: -->
<dbAdapter name="mysql"/>
<dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
url="jdbc:mysql://localhost:3306/model?createDatabaseIfNotExist=true"
user="user"
password="password"/>

</store>

</repository>

</cdoServer>

Thanks,

Greg Babcock
Re: [CDO] Server error with MySQL DBStore [message #1710721 is a reply to message #1708252] Thu, 08 October 2015 16:04 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6446
Registered: July 2009
Senior Member
Hi Greg,

Sorry for the delay. Mysql issues are comparingly hard for me to reproduce because I don't permanently operate a Mysql
server. So, first I'm concerned about your statement "because Net4J DB Framework only included the source jar". I
checked the p2 repos for Luna, Mars and Neon. They all contain the org.eclipse.net4j.db.mysql plugin:

Luna: 4.2.100.v20140114-0640
Mars+Neon: 4.2.200.v20150911-1807

What exactly do you mean by "not included"?

Does the problem still occur if you use one of those plugins?

Cheers
/Eike

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


Am 15.09.2015 um 05:46 schrieb Greg Babcock:
> I am new to CDO and am using version 4.4. I have not had any problems with the H2 DBStore, but when I use the same
> configuration and change the DB to MySQL I get a exception when I try to create a resource.
> java.lang.IllegalStateException: RootResourceID is null; is the repository not yet initialized?
> at org.eclipse.emf.internal.cdo.view.AbstractCDOView.getRootResource(AbstractCDOView.java:374)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.attachNewResourceNode(CDOTransactionImpl.java:1089)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.attachNewResource(CDOTransactionImpl.java:1013)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.attachResource(CDOTransactionImpl.java:1002)
> at org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl.basicSetResourceSet(CDOResourceImpl.java:1658)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$ResourcesEList.inverseAdd(ResourceSetImpl.java:586)
> at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:286)
> at org.eclipse.emf.common.util.AbstractEList.add(AbstractEList.java:303)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:435)
> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:423)
> at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.createResource(CDOTransactionImpl.java:881)
> at com.peacemkr.config.app.emf.DomainImpl.openTransaction(DomainImpl.java:72)
> at com.peacemkr.config.app.handlers.OpenTransactionHandler.execute(OpenTransactionHandler.java:25)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
>
>
> DB tables are getting created so I know there are no connection issues.
> I had to build the MySQL (org.eclipse.net4j.db.mysql_4.2.2) plugin from the GIT repository because Net4J DB Framework
> only included the source jar, but I don't think that is the issue.
> I copied the example cdo-server.xml file from the product project.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cdoServer>
>
> <!-- ============================================================== -->
> <!-- See http://wiki.eclipse.org/CDO/Server_Configuration_Reference -->
> <!-- ============================================================== -->
>
> <acceptor type="tcp" listenAddr="0.0.0.0" port="2036"/>
>
> <!-- Examples:
> <acceptor type="ssl" listenAddr="0.0.0.0" port="2036"/>
> <acceptor type="http"/>
> -->
>
> <repository name="repo1">
>
> <property name="overrideUUID" value=""/>
> <property name="supportingAudits" value="true"/>
> <property name="supportingBranches" value="true"/>
> <property name="ensureReferentialIntegrity" value="false"/>
> <property name="allowInterruptRunningQueries" value="true"/>
> <property name="idGenerationLocation" value="STORE"/> <!-- Possible values: STORE | CLIENT -->
> <property name="serializeCommits" value="false"/>
> <property name="optimisticLockingTimeout" value="10000"/>
>
> <!-- Example http://wiki.eclipse.org/CDO/Security_Manager
> <securityManager type="default" description="/security:annotation:home(/home)"/> -->
>
> <!-- Example http://bugs.eclipse.org/302775
> <authenticator type="file" description="_database/repo1.users"/>
> -->
>
> <!-- Example http://bugs.eclipse.org/345431
> <initialPackage nsURI="http://www.eclipse.org/emf/CDO/examples/company/1.0.0"/>
> -->
>
> <store type="db">
>
> <!-- Example http://bugs.eclipse.org/396379 (if idGenerationLocation == CLIENT)
> <property name="idColumnLength" value="34"/>
> -->
>
> <!-- Period at which to execute an SQL statement to keep DB connection alive, in minutes -->
> <property name="connectionKeepAlivePeriod" value="60"/>
>
> <!-- Maximum number of store accessors (JDBC connections) to keep in the reader pool. The default value is 15. -->
> <property name="readerPoolCapacity" value="20"/>
>
> <!-- Maximum number of store accessors (JDBC connections) to keep in the writer pool. The default value is 15. -->
> <property name="writerPoolCapacity" value="20"/>
>
> <mappingStrategy type="horizontal"> <!-- callout -->
> <property name="qualifiedNames" value="true"/>
>
> <!--
> Per default, the objectTypeCache is in-memory and contains
> 100,000 cache entries. If you want to change the size,
> uncomment the following line and set the desired size.
> The cache can be disabled by setting a size of 0.
> -->
>
> <!-- Optional:
> <property name="objectTypeCacheSize" value="100000"/>
> -->
>
> </mappingStrategy>
> <!-- <dbAdapter name="h2"/>
> <dataSource class="org.h2.jdbcx.JdbcDataSource"
> URL="jdbc:h2:/database/repo1"/> -->
> <!-- Example: -->
> <dbAdapter name="mysql"/>
> <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
> url="jdbc:mysql://localhost:3306/model?createDatabaseIfNotExist=true"
> user="user"
> password="password"/>
> </store>
>
> </repository>
>
> </cdoServer>
>
> Thanks,
>
> Greg Babcock


Re: [CDO] Server error with MySQL DBStore [message #1710750 is a reply to message #1710721] Thu, 08 October 2015 20:39 Go to previous messageGo to next message
Greg Babcock is currently offline Greg BabcockFriend
Messages: 39
Registered: October 2012
Member
Hi Eike,

There is a Net4J DB Framework feature listed on the Mars update site, but not in Git, so I am guessing that it is a description given to the org.eclipse.net4j.sdk feature. I had assumed that the MySQL feature was part of that because it references the source plugin.

After looking at the update site again, I can see that the H2 feature is listed separately, which makes me think that the MySQL and possibly some of the other adapters are missing from the catagory.xml file. Where can I get the MySQL Adapter executable.

/GB
Re: [CDO] Server error with MySQL DBStore [message #1710762 is a reply to message #1710750] Fri, 09 October 2015 05:03 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6446
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Greg,<br>
<br>
Build and distribution of these DB adapter plugins has always been a
little tricky, mostly because of the IP issues that are associated
with most of the driver bundles. Only the H2 driver has an
EPL-compatible license, so the H2 adapter is the only one *included*
in the core Net4j DB feature. But a few years ago we've made most of
the driver dependencies in the adapter plugins optional+greedy, so I
assume we could re-include their adapter plugins, especially because
those are generally ~20KB small each. On the other hand the
greediness moves the decision wthere the drivers get installed or
not to the list of configured 2 repositories, which is also not
ideal.<br>
<br>
More comments below...<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>
<br>
Am 08.10.2015 um 22:39 schrieb Greg Babcock:<br>
<blockquote cite="mid:mv6kan$fv7$1@xxxxxxxxe.org" type="cite">Hi
Eike,
<br>
<br>
There is a Net4J DB Framework feature listed on the Mars update
site, but not in Git, </blockquote>
What do you mean by "listed" and by "not in Git"?<br>
<br>
<blockquote cite="mid:mv6kan$fv7$1@xxxxxxxxe.org" type="cite">so
I am guessing that it is a description given to the
org.eclipse.net4j.sdk feature. <br>
</blockquote>
I'm also unsure what this part of your sentence means. Are you
trying to say that one of the feature description texts is wrong?<br>
<br>
<blockquote cite="mid:mv6kan$fv7$1@xxxxxxxxe.org" type="cite"> I
had assumed that the MySQL feature was part of that because it
references the source plugin.  <br>
</blockquote>
The SDK feature includes all source features/plugins because source
plugins generally don't depend on other plugins, especially not on
IP-problematic plugins such as DB drivers.<br>
<br>
<blockquote cite="mid:mv6kan$fv7$1@xxxxxxxxe.org" type="cite">After
looking at the update site again, I can see that the H2 feature is
listed separately, which makes me think that the MySQL and
possibly some of the other adapters are missing from the
catagory.xml file.  Where can I get the MySQL Adapter executable.
<br>
</blockquote>
When I look at it I see this:<br>
<br>
<img src="https://www.eclipse.org/forums/index.php?t=getfile&amp;id=23489" alt=""><br>
<br>
The Net4j DB Framework MYSQL Adapter feature has the following
description text, indicating that the (IP-problematic) JDBC driver
IS NOT part of it:<br>
<br>
featureName = Net4j DB Framework MYSQL Adapter<br>
description = Contains the MYSQL Adapter matching the Net4j DB
Framework BUT NOT the database driver bundle for MYSQL. This needs
to be installed separately, for example from
<a class="moz-txt-link-freetext" href="http://www.elver.org/eclipse/2.1.0/update">http://www.elver.org/eclipse/2.1.0/update</a><br>
<br>
</body>
</html>
  • Attachment: ihbiafde.png
    (Size: 3.92KB, Downloaded 124 times)


Re: [CDO] Server error with MySQL DBStore [message #1710927 is a reply to message #1710762] Sun, 11 October 2015 09:21 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6446
Registered: July 2009
Senior Member
Am 09.10.2015 um 07:03 schrieb Eike Stepper:
>
>> so I am guessing that it is a description given to the org.eclipse.net4j.sdk feature.
> I'm also unsure what this part of your sentence means. Are you trying to say that one of the feature description texts
> is wrong?
I've enhanced the feature description:

description = Contains the database core framework, the H2 database adapter plugin, and optionally/greedily the H2
database driver.\
Separate database adapter features are available for Derby, Mysql, HSQLDB, Oracle, DB2, and PostgreSQL.\
Additional database drivers are available via http://www.elver.org/eclipse/2.1.0/update (read the license informations).

Cheers
/Eike

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


Re: [CDO] Server error with MySQL DBStore [message #1710962 is a reply to message #1710927] Mon, 12 October 2015 02:37 Go to previous message
Greg Babcock is currently offline Greg BabcockFriend
Messages: 39
Registered: October 2012
Member
Thanks Eike,

I found the MySql driver on the CDO download page in emf-cdo-R20150916-0434-Site.zip, but unfortunately I am still experiencing the same error. I have also experienced some other interesting things that I didn't notice before.

The first time run the server after dropping the database from the eclipse environment I get the exception "org.eclipse.net4j.db.DBException: Schema locked: REPO1 exception". The second time I start the server it starts without error. Once the Server is running I can create a session and branches using the CDO explorer, but I get an exception "java.lang.IllegalStateException: RootResourceID is null; is the repository not yet initialized" when I try to open a transaction.

When the server I exported from eclipse is started using the same configuration a null RootResourceID exception is thrown. Everything works when I change the DB to H2.

/GB
Previous Topic:[CDO] Automatic committing turned on and automatic locking
Next Topic:Disable generation of validation package from Xcore
Goto Forum:
  


Current Time: Sun Oct 20 18:57:01 GMT 2019

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

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

Back to the top