Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » PGSimpleDataSource cannot be found by Net4j error in using PostgreSQL for CDO-Server
PGSimpleDataSource cannot be found by Net4j error in using PostgreSQL for CDO-Server [message #1803633] Tue, 05 March 2019 20:02
mostafa fard is currently offline mostafa fardFriend
Messages: 5
Registered: December 2013
Junior Member
I did the following steps:
- downloading the latest version of Eclipse (Photon-Eclipse Modeling Tools)
- install "CDO R20180613-0111->Net4j DB Framework->Net4j DB Framework PostgreSQL Adapter" from install new software in Eclipse
- create a new Java Project (called myProject)
- download PostgreSQL JDBC Driver from "https://jdbc.postgresql.org/download.html"
- create a lib folder in the myProject and past postgresql-42.2.5.jar into it, and add it to build path of the project
- create a new folder named "config", and create an xml file under the folder
- fill the xml file as follows:
- create a new Launch Configuration (Eclipse Application)
* in the main tab, select "Run an Application" and change is to "org.eclipse.emf.cdo.server.app"
* in the arguments page, in VM arguments, past "-Xms40m -Xmx1024m -Ddebug=true -Dnet4j.config=${resource_loc:/myProject/config} -Dorg.osgi.service.http.port=8080"

The content of XML file:
------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<cdoServer>
<acceptor type="tcp" listenAddr="0.0.0.0" port="2036"/>
<repository name="demo">
<store type="db">
<mappingStrategy type="horizontal"/>
<dbAdapter name="postgresql" />
<dataSource class="org.postgresql.ds.PGSimpleDataSource"
serverName="localhost"
portNumber="5432"
databaseName="cdoRun"
<!--createDatabaseIfNotExist="true"-->
user="postgres"
password="12345"/>
</store>
</repository>
</cdoServer>
------------------------------------------------------------------------------

By running this project, I get the following error:
------------------------------------------------------------------------------
!MESSAGE CDO server starting
[ERROR] java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130

!ENTRY org.eclipse.net4j.util 4 0 2019-03-05 12:11:30.086
!MESSAGE java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130
!STACK 0
org.eclipse.net4j.db.DBException: java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:347)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:336)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:331)
at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.getDataSource(DBStoreFactory.java:127)
at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.createStore(DBStoreFactory.java:53)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.createStore(RepositoryConfigurator.java:430)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:209)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:136)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:78)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:30)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.net4j.util.ReflectUtil.instantiate(ReflectUtil.java:478)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:343)
... 13 more
org.eclipse.net4j.db.DBException: java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:347)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:336)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:331)
at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.getDataSource(DBStoreFactory.java:127)
at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.createStore(DBStoreFactory.java:53)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.createStore(RepositoryConfigurator.java:430)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:209)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:136)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:78)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:30)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.net4j.util.ReflectUtil.instantiate(ReflectUtil.java:478)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:343)
... 13 more

!ENTRY org.eclipse.equinox.app 4 0 2019-03-05 12:11:30.109
!MESSAGE java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130
!STACK 0
org.eclipse.net4j.db.DBException: java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:347)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:336)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:331)
at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.getDataSource(DBStoreFactory.java:127)
at org.eclipse.emf.cdo.server.internal.db.DBStoreFactory.createStore(DBStoreFactory.java:53)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.createStore(RepositoryConfigurator.java:430)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.getRepository(RepositoryConfigurator.java:209)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:136)
at org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
at org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:78)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:63)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:30)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.postgresql.ds.PGSimpleDataSource cannot be found by org.eclipse.net4j.db_4.7.0.v20180529-1130
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:511)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.net4j.util.ReflectUtil.instantiate(ReflectUtil.java:478)
at org.eclipse.net4j.db.DBUtil.createDataSource(DBUtil.java:343)
... 13 more
------------------------------------------------------------------------------


Did I do wrong any step? Should I do anything else?
It work correctly on H2 database. But, using PostgreSQL?!
Thank you for your help
  • Attachment: Untitled.jpg
    (Size: 248.60KB, Downloaded 10 times)

[Updated on: Tue, 05 March 2019 20:32]

Report message to a moderator

Previous Topic:[CDO] Server : how to stop it properly
Next Topic:[CDO] Committing large amounts of data as a single commit
Goto Forum:
  


Current Time: Mon Jun 17 14:51:08 GMT 2019

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

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

Back to the top