Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] dbAdapter MySQL Problem
[CDO] dbAdapter MySQL Problem [message #903355] Thu, 23 August 2012 09:44 Go to next message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hello!

First to all, thanks for your help Wink

I'm trying use CDO with a MySQL database. In my cdo-server.xml I have uncommented the lines for it, and my cdo-server.xml looks like:


<?xml version="1.0" encoding="UTF-8"?>
<cdoServer>
	
	<!--acceptor type="http"/ -->
	
	<acceptor type="tcp" listenAddr="0.0.0.0" port="2036">
		<!-- negotiator type="challenge" description="/temp/users.db"/ -->
	</acceptor>
	
	<repository name="repo1">
		<property name="overrideUUID" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f"/>
		<property name="supportingAudits" value="true"/>

		<store type="db">
			<mappingStrategy type="horizontal">
				<property name="qualifiedNames" value="false"/>
				<property name="toManyReferences" value="ONE_TABLE_PER_REFERENCE"/>
				<property name="toOneReferences" value="LIKE_ATTRIBUTES"/>
			</mappingStrategy>
			
		      <dbAdapter name="mysql"/>
		      <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
			url="jdbc:mysql://localhost/cdoTest"
			user="root"/>			
		</store>
	</repository>
	
</cdoServer> 



However, when I try start the server, I always get the follow exception:

!MESSAGE Unknown DB adapter: mysql
!STACK 0
java.lang.IllegalArgumentException: Unknown DB adapter: mysql
	at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.getDBAdapter(DBStoreFactory.java:105)
	at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.createStore(DBStoreFactory.java:52)
	at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.createStore(RepositoryConfigurator.java:292)
	at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:164)
	at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:106)
	at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
	at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
	at java.lang.Thread.run(Thread.java:679)



I have tried using a h2 database, and there is not problem.

Anyone know what is happening with mysql?

Thanks for your help!
Re: [CDO] dbAdapter MySQL Problem [message #903358 is a reply to message #903355] Thu, 23 August 2012 10:01 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 23.08.2012 11:44, schrieb José Miguel P.:
> Hello!
>
> First to all, thanks for your help ;)
>
> I'm trying use CDO with a MySQL database. In my cdo-server.xml I have uncommented the lines for it, and my
> cdo-server.xml looks like:
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <cdoServer>
>
> <!--acceptor type="http"/ -->
>
> <acceptor type="tcp" listenAddr="0.0.0.0" port="2036">
> <!-- negotiator type="challenge" description="/temp/users.db"/ -->
> </acceptor>
>
> <repository name="repo1">
> <property name="overrideUUID" value="1ff5d226-b1f0-40fb-aba2-0c31b38c764f"/>
Just a note: This property is used with value="" (the empty string) to bypass the automatic UUID generation and use the
repository's name as a UUID instead.

> <property name="supportingAudits" value="true"/>
>
> <store type="db">
> <mappingStrategy type="horizontal">
> <property name="qualifiedNames" value="false"/>
> <property name="toManyReferences" value="ONE_TABLE_PER_REFERENCE"/>
> <property name="toOneReferences" value="LIKE_ATTRIBUTES"/>
The preceeding two properties are no longer recognized.

> </mappingStrategy>
>
> <dbAdapter name="mysql"/>
> <dataSource class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
> url="jdbc:mysql://localhost/cdoTest"
> user="root"/>
> </store>
> </repository>
>
> </cdoServer>
>
>
> However, when I try start the server, I always get the follow exception:
>
>
> !MESSAGE Unknown DB adapter: mysql
That's usually an indication that one of the following statements is true:

1) You're running in OSGi and forgot to deploy the org.eclipse.net4j.db.mysql bundle, *or*

2) Your're running standalone and forgot to IDBAdapter.REGISTRY.put(MYSQLAdapter.NAME, new MYSQLAdapter());

Does this fix the problem?

Cheers
/Eike

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


> !STACK 0
> java.lang.IllegalArgumentException: Unknown DB adapter: mysql
> at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.getDBAdapter(DBStoreFactory.java:105)
> at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.createStore(DBStoreFactory.java:52)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.createStore(RepositoryConfigurator.java:292)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:164)
> at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:106)
> at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
> at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
> at java.lang.Thread.run(Thread.java:679)
>
>
>
> I have tried using a h2 database, and there is not problem.
>
> Anyone know what is happening with mysql?
> Thanks for your help!


Re: [CDO] dbAdapter MySQL Problem [message #903376 is a reply to message #903358] Thu, 23 August 2012 11:56 Go to previous message
José Miguel P. is currently offline José Miguel P.Friend
Messages: 66
Registered: March 2010
Member

Hi Eike.

This was the problem, I was running the server with a product that used h2, so was not loading org.eclipse.net4j.db.mysql.

I have created my own eclipse product for running the CDO server, including the bundles, and it now running.

Sorry for this clumsy question, the "Unknown DB adapter: mysql" message was confusing me, I was thinking this was a mistake in the configuration file.

Thanks! Very Happy
Previous Topic:EPackage.Registry woes with different ClassLoaders
Next Topic:Teneo/hibernate
Goto Forum:
  


Current Time: Tue Apr 23 08:57:06 GMT 2024

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

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

Back to the top