Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExceptio
[CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExceptio [message #686762] Sun, 15 May 2011 22:09 Go to next message
Goetz Botterweck is currently offline Goetz BotterweckFriend
Messages: 71
Registered: July 2009
Member
Hi,

I want to access another database type that is not supported yet by CDO
Hibernate Server (e.g. Microsoft SQL Server).

What is the intended place to integrate such database drivers?

I am trying to start CDOHibernateServer.launch in
org.eclipse.emf.cdo.examples.hibernate.server with another database.

I added a corresponding section in
\org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml

Then, I tried these alternatives

ALTERNATIVE 1)
- create a separate plugin from the driver jar (File -> New -> Plugin
from existing JAR), for instance com.microsoft.sqlserver.jdbc
- list the new plugin as a dependency from
org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF

ALTERNATIVE 2)
- place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
- list jar in Manifest> Runtime > Classpath
- add packages of jar to Manifest > Runtime > Exported Packages

Nevertheless I get a ClassNotFoundException

Is there a certain way these drivers have to be made visible?

Since the CDOHibernateServer.launch specifies "Launch With = all
workspace and enabled target plugins" I thought that the new plugin
would be included when starting the server.

This was working before (with earlier versions of CDO?) but I probably
made some stupid mistake.

Any hints? Thanks,
Goetz











----trace-----
(...earlier lines omitted...)
log4j: Category org.hibernate.cache set to ERROR
log4j: Handling log4j.additivity.org.hibernate.cache=[null]
log4j: Finished configuring.
app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
for Hibernate PackageHandler
0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
at
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
at
org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
at
org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
at
org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
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(Unknown Source)
5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
org.hibernate.HibernateException: JDBC Driver class not found:
com.microsoft.sqlserver.jdbc.SQLServerDriver
at
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
at
org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
at
org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
at
org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
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(Unknown Source)
Caused by: java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
at
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
... 22 more
[INFO] No user manager configured. Users will not be authenticated
[ERROR] JDBC Driver class not found:
com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
org.eclipse.emf.cdo.server.app.0] ERROR
org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
at
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
at
org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
at
org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
at
org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
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(Unknown Source)

org.hibernate.HibernateException: JDBC Driver class not found:
com.microsoft.sqlserver.jdbc.SQLServerDriver
at
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
at
org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
at
org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
at
org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
at
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
at
org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
at
org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
at
org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
at
org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
at
org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
at
org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
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(Unknown Source)
Caused by: java.lang.ClassNotFoundException:
com.microsoft.sqlserver.jdbc.SQLServerDriver
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
at
org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
... 22 more
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExce [message #686763 is a reply to message #686762] Mon, 16 May 2011 05:04 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Goetz,
Hmm, difficult to comment on as it works fine for me. I did the same for postgresql last week, created a plugin and
listed it as a dependency in the server plugin.

See here for how the postgresql plugin is structured:
http://www.elver.org/eclipse/update

I can try to create the ms sql jdbc plugin myself also and list it on the elver.org update site. From where did you
download the jdbc driver?

gr. Martin

On 05/16/2011 12:09 AM, Goetz Botterweck wrote:
> Hi,
>
> I want to access another database type that is not supported yet by CDO
> Hibernate Server (e.g. Microsoft SQL Server).
>
> What is the intended place to integrate such database drivers?
>
> I am trying to start CDOHibernateServer.launch in
> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>
> I added a corresponding section in
> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>
> Then, I tried these alternatives
>
> ALTERNATIVE 1)
> - create a separate plugin from the driver jar (File -> New -> Plugin
> from existing JAR), for instance com.microsoft.sqlserver.jdbc
> - list the new plugin as a dependency from
> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>
> ALTERNATIVE 2)
> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
> - list jar in Manifest> Runtime> Classpath
> - add packages of jar to Manifest> Runtime> Exported Packages
>
> Nevertheless I get a ClassNotFoundException
>
> Is there a certain way these drivers have to be made visible?
>
> Since the CDOHibernateServer.launch specifies "Launch With = all
> workspace and enabled target plugins" I thought that the new plugin
> would be included when starting the server.
>
> This was working before (with earlier versions of CDO?) but I probably
> made some stupid mistake.
>
> Any hints? Thanks,
> Goetz
>
>
>
>
>
>
>
>
>
>
>
> ----trace-----
> (...earlier lines omitted...)
> log4j: Category org.hibernate.cache set to ERROR
> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
> log4j: Finished configuring.
> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
> for Hibernate PackageHandler
> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
> java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
> org.hibernate.HibernateException: JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> ... 22 more
> [INFO] No user manager configured. Users will not be authenticated
> [ERROR] JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
> org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
> java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> at
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
>
> org.hibernate.HibernateException: JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> at
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> ... 22 more


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExce [message #686764 is a reply to message #686762] Mon, 16 May 2011 06:24 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Goetz,

The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate bundle's manifest reveals:

Eclipse-BuddyPolicy: dependent

So, have you already tried to make your driver bundle depend on the hibernate bundle?

Personally I have the feeling that the buddy policy should rather be "registered" because that would be:

1) More selective ("does hibernate need to see all dependent bundles?")
2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")

Cheers
/Eike

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



Am 16.05.2011 00:09, schrieb Goetz Botterweck:
> Hi,
>
> I want to access another database type that is not supported yet by CDO
> Hibernate Server (e.g. Microsoft SQL Server).
>
> What is the intended place to integrate such database drivers?
>
> I am trying to start CDOHibernateServer.launch in
> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>
> I added a corresponding section in
> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>
> Then, I tried these alternatives
>
> ALTERNATIVE 1)
> - create a separate plugin from the driver jar (File -> New -> Plugin
> from existing JAR), for instance com.microsoft.sqlserver.jdbc
> - list the new plugin as a dependency from
> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>
> ALTERNATIVE 2)
> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
> - list jar in Manifest> Runtime> Classpath
> - add packages of jar to Manifest> Runtime> Exported Packages
>
> Nevertheless I get a ClassNotFoundException
>
> Is there a certain way these drivers have to be made visible?
>
> Since the CDOHibernateServer.launch specifies "Launch With = all
> workspace and enabled target plugins" I thought that the new plugin
> would be included when starting the server.
>
> This was working before (with earlier versions of CDO?) but I probably
> made some stupid mistake.
>
> Any hints? Thanks,
> Goetz
>
>
>
>
>
>
>
>
>
>
>
> ----trace-----
> (...earlier lines omitted...)
> log4j: Category org.hibernate.cache set to ERROR
> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
> log4j: Finished configuring.
> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
> for Hibernate PackageHandler
> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
> java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
> org.hibernate.HibernateException: JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> ... 22 more
> [INFO] No user manager configured. Users will not be authenticated
> [ERROR] JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
> org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
> java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> at
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
>
> org.hibernate.HibernateException: JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> at
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> ... 22 more


Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExce [message #686765 is a reply to message #686764] Mon, 16 May 2011 07:18 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I have this as dependencies in server plugin I use:
Require-Bundle: org.eclipse.core.runtime,
org.hsqldb;bundle-version="1.8.1",
org.postgresql;bundle-version="9.0.0",
org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="3.0.100",
org.eclipse.net4j.util;bundle-version="3.1.0",
org.eclipse.emf.ecore;bundle-version="2.7.0"

This works for me. The postgresql plugin I created does not depend on Hibernate and it is not needed afaics.

I agree with Eike that buddy policy registered is more selective, the reason that I choose dependent is that I wanted to
make it as easy as possible for people to use the hibernate plugin...

gr. Martin

On 05/16/2011 08:24 AM, Eike Stepper wrote:
> Hi Goetz,
>
> The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate
> bundle's manifest reveals:
>
> Eclipse-BuddyPolicy: dependent
>
> So, have you already tried to make your driver bundle depend on the hibernate bundle?
>
> Personally I have the feeling that the buddy policy should rather be "registered" because that would be:
>
> 1) More selective ("does hibernate need to see all dependent bundles?")
> 2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 16.05.2011 00:09, schrieb Goetz Botterweck:
>> Hi,
>>
>> I want to access another database type that is not supported yet by CDO
>> Hibernate Server (e.g. Microsoft SQL Server).
>>
>> What is the intended place to integrate such database drivers?
>>
>> I am trying to start CDOHibernateServer.launch in
>> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>>
>> I added a corresponding section in
>> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>>
>> Then, I tried these alternatives
>>
>> ALTERNATIVE 1)
>> - create a separate plugin from the driver jar (File -> New -> Plugin
>> from existing JAR), for instance com.microsoft.sqlserver.jdbc
>> - list the new plugin as a dependency from
>> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>>
>> ALTERNATIVE 2)
>> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
>> - list jar in Manifest> Runtime> Classpath
>> - add packages of jar to Manifest> Runtime> Exported Packages
>>
>> Nevertheless I get a ClassNotFoundException
>>
>> Is there a certain way these drivers have to be made visible?
>>
>> Since the CDOHibernateServer.launch specifies "Launch With = all
>> workspace and enabled target plugins" I thought that the new plugin
>> would be included when starting the server.
>>
>> This was working before (with earlier versions of CDO?) but I probably
>> made some stupid mistake.
>>
>> Any hints? Thanks,
>> Goetz
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ----trace-----
>> (...earlier lines omitted...)
>> log4j: Category org.hibernate.cache set to ERROR
>> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
>> log4j: Finished configuring.
>> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
>> for Hibernate PackageHandler
>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>> java.lang.ClassNotFoundException:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>> at
>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>> at
>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>> at
>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> 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(Unknown Source)
>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
>> org.hibernate.HibernateException: JDBC Driver class not found:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>> at
>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>> at
>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>> at
>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> 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(Unknown Source)
>> Caused by: java.lang.ClassNotFoundException:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>> ... 22 more
>> [INFO] No user manager configured. Users will not be authenticated
>> [ERROR] JDBC Driver class not found:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
>> org.eclipse.emf.cdo.server.app.0] ERROR
>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>> java.lang.ClassNotFoundException:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>> at
>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>> at
>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>> at
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>> at
>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>> at
>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> 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(Unknown Source)
>>
>> org.hibernate.HibernateException: JDBC Driver class not found:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>> at
>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>> at
>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>> at
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>> at
>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>> at
>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> 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(Unknown Source)
>> Caused by: java.lang.ClassNotFoundException:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>> ... 22 more


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExce [message #686766 is a reply to message #686765] Mon, 16 May 2011 07:48 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.05.2011 09:18, schrieb Martin Taal:
> I have this as dependencies in server plugin I use:
What do you by "server plugin I use"? Does that ean you have to manually change the manifest of our shipped (and signed) cdo.server plugin? Or of our shipped (and signed) cdo.server.hibernate plugin?

> Require-Bundle: org.eclipse.core.runtime,
> org.hsqldb;bundle-version="1.8.1",
> org.postgresql;bundle-version="9.0.0",
> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="3.0.100",
> org.eclipse.net4j.util;bundle-version="3.1.0",
> org.eclipse.emf.ecore;bundle-version="2.7.0"
>
> This works for me. The postgresql plugin I created does not depend on Hibernate and it is not needed afaics.
>
> I agree with Eike that buddy policy registered is more selective, the reason that I choose dependent is that I wanted to make it as easy as possible for people to use the hibernate plugin...
I would certainly not call the unpacking and changing of shipped binary plugins easy. But maybe I still not fully understand what you're doing...

Cheers
/Eike

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


>
> gr. Martin
>
> On 05/16/2011 08:24 AM, Eike Stepper wrote:
>> Hi Goetz,
>>
>> The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate
>> bundle's manifest reveals:
>>
>> Eclipse-BuddyPolicy: dependent
>>
>> So, have you already tried to make your driver bundle depend on the hibernate bundle?
>>
>> Personally I have the feeling that the buddy policy should rather be "registered" because that would be:
>>
>> 1) More selective ("does hibernate need to see all dependent bundles?")
>> 2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 16.05.2011 00:09, schrieb Goetz Botterweck:
>>> Hi,
>>>
>>> I want to access another database type that is not supported yet by CDO
>>> Hibernate Server (e.g. Microsoft SQL Server).
>>>
>>> What is the intended place to integrate such database drivers?
>>>
>>> I am trying to start CDOHibernateServer.launch in
>>> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>>>
>>> I added a corresponding section in
>>> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>>>
>>> Then, I tried these alternatives
>>>
>>> ALTERNATIVE 1)
>>> - create a separate plugin from the driver jar (File -> New -> Plugin
>>> from existing JAR), for instance com.microsoft.sqlserver.jdbc
>>> - list the new plugin as a dependency from
>>> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>>>
>>> ALTERNATIVE 2)
>>> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
>>> - list jar in Manifest> Runtime> Classpath
>>> - add packages of jar to Manifest> Runtime> Exported Packages
>>>
>>> Nevertheless I get a ClassNotFoundException
>>>
>>> Is there a certain way these drivers have to be made visible?
>>>
>>> Since the CDOHibernateServer.launch specifies "Launch With = all
>>> workspace and enabled target plugins" I thought that the new plugin
>>> would be included when starting the server.
>>>
>>> This was working before (with earlier versions of CDO?) but I probably
>>> made some stupid mistake.
>>>
>>> Any hints? Thanks,
>>> Goetz
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ----trace-----
>>> (...earlier lines omitted...)
>>> log4j: Category org.hibernate.cache set to ERROR
>>> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
>>> log4j: Finished configuring.
>>> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
>>> for Hibernate PackageHandler
>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> java.lang.ClassNotFoundException:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at
>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>> at
>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>> at
>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>> at
>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> 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(Unknown Source)
>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>> at
>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>> at
>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>> at
>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> 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(Unknown Source)
>>> Caused by: java.lang.ClassNotFoundException:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at
>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>> ... 22 more
>>> [INFO] No user manager configured. Users will not be authenticated
>>> [ERROR] JDBC Driver class not found:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
>>> org.eclipse.emf.cdo.server.app.0] ERROR
>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> java.lang.ClassNotFoundException:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at
>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>> at
>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>> at
>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>> at
>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>> at
>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>> at
>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>> at
>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> 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(Unknown Source)
>>>
>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>> at
>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>> at
>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>> at
>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>> at
>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>> at
>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>> at
>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> 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(Unknown Source)
>>> Caused by: java.lang.ClassNotFoundException:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at
>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>> ... 22 more
>
>


Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExce [message #686767 is a reply to message #686766] Mon, 16 May 2011 08:08 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
I don't need to unpack or change shipped binaries/plugins, my postgresql jdbc plugin does not contain any reference to
the hibernate plugin.

The 'server' plugin is something I created so not part of cdo, hibernate or something else. It contains code to
customize the mapping or to add other server side stuff. It also contains the cdo-server.xml for example and it contains
dependencies on cdo.server.hibernate.teneo and on the postgresql plugin.

gr. Martin

On 05/16/2011 09:48 AM, Eike Stepper wrote:
> Am 16.05.2011 09:18, schrieb Martin Taal:
>> I have this as dependencies in server plugin I use:
> What do you by "server plugin I use"? Does that ean you have to manually change the manifest of our shipped (and signed)
> cdo.server plugin? Or of our shipped (and signed) cdo.server.hibernate plugin?
>
>> Require-Bundle: org.eclipse.core.runtime,
>> org.hsqldb;bundle-version="1.8.1",
>> org.postgresql;bundle-version="9.0.0",
>> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="3.0.100",
>> org.eclipse.net4j.util;bundle-version="3.1.0",
>> org.eclipse.emf.ecore;bundle-version="2.7.0"
>>
>> This works for me. The postgresql plugin I created does not depend on Hibernate and it is not needed afaics.
>>
>> I agree with Eike that buddy policy registered is more selective, the reason that I choose dependent is that I wanted
>> to make it as easy as possible for people to use the hibernate plugin...
> I would certainly not call the unpacking and changing of shipped binary plugins easy. But maybe I still not fully
> understand what you're doing...
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/16/2011 08:24 AM, Eike Stepper wrote:
>>> Hi Goetz,
>>>
>>> The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate
>>> bundle's manifest reveals:
>>>
>>> Eclipse-BuddyPolicy: dependent
>>>
>>> So, have you already tried to make your driver bundle depend on the hibernate bundle?
>>>
>>> Personally I have the feeling that the buddy policy should rather be "registered" because that would be:
>>>
>>> 1) More selective ("does hibernate need to see all dependent bundles?")
>>> 2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 16.05.2011 00:09, schrieb Goetz Botterweck:
>>>> Hi,
>>>>
>>>> I want to access another database type that is not supported yet by CDO
>>>> Hibernate Server (e.g. Microsoft SQL Server).
>>>>
>>>> What is the intended place to integrate such database drivers?
>>>>
>>>> I am trying to start CDOHibernateServer.launch in
>>>> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>>>>
>>>> I added a corresponding section in
>>>> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>>>>
>>>> Then, I tried these alternatives
>>>>
>>>> ALTERNATIVE 1)
>>>> - create a separate plugin from the driver jar (File -> New -> Plugin
>>>> from existing JAR), for instance com.microsoft.sqlserver.jdbc
>>>> - list the new plugin as a dependency from
>>>> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>>>>
>>>> ALTERNATIVE 2)
>>>> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
>>>> - list jar in Manifest> Runtime> Classpath
>>>> - add packages of jar to Manifest> Runtime> Exported Packages
>>>>
>>>> Nevertheless I get a ClassNotFoundException
>>>>
>>>> Is there a certain way these drivers have to be made visible?
>>>>
>>>> Since the CDOHibernateServer.launch specifies "Launch With = all
>>>> workspace and enabled target plugins" I thought that the new plugin
>>>> would be included when starting the server.
>>>>
>>>> This was working before (with earlier versions of CDO?) but I probably
>>>> made some stupid mistake.
>>>>
>>>> Any hints? Thanks,
>>>> Goetz
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ----trace-----
>>>> (...earlier lines omitted...)
>>>> log4j: Category org.hibernate.cache set to ERROR
>>>> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
>>>> log4j: Finished configuring.
>>>> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
>>>> for Hibernate PackageHandler
>>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
>>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
>>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> java.lang.ClassNotFoundException:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at
>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.Class.forName0(Native Method)
>>>> at java.lang.Class.forName(Unknown Source)
>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>> at
>>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> 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(Unknown Source)
>>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
>>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>> at
>>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> 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(Unknown Source)
>>>> Caused by: java.lang.ClassNotFoundException:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at
>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.Class.forName0(Native Method)
>>>> at java.lang.Class.forName(Unknown Source)
>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>> ... 22 more
>>>> [INFO] No user manager configured. Users will not be authenticated
>>>> [ERROR] JDBC Driver class not found:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
>>>> org.eclipse.emf.cdo.server.app.0] ERROR
>>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> java.lang.ClassNotFoundException:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at
>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.Class.forName0(Native Method)
>>>> at java.lang.Class.forName(Unknown Source)
>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>> at
>>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>>> at
>>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>>> at
>>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> 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(Unknown Source)
>>>>
>>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>> at
>>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>>> at
>>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>>> at
>>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> 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(Unknown Source)
>>>> Caused by: java.lang.ClassNotFoundException:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at
>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.Class.forName0(Native Method)
>>>> at java.lang.Class.forName(Unknown Source)
>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>> ... 22 more
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExce [message #686768 is a reply to message #686767] Mon, 16 May 2011 09:01 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.05.2011 10:08, schrieb Martin Taal:
> Hi Eike,
> I don't need to unpack or change shipped binaries/plugins, my postgresql jdbc plugin does not contain any reference to the hibernate plugin.
>
> The 'server' plugin is something I created so not part of cdo, hibernate or something else. It contains code to customize the mapping or to add other server side stuff. It also contains the cdo-server.xml for example and it contains dependencies on cdo.server.hibernate.teneo and on the postgresql plugin.
I see. That makes sense.

Cheers
/Eike

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


>
> gr. Martin
>
> On 05/16/2011 09:48 AM, Eike Stepper wrote:
>> Am 16.05.2011 09:18, schrieb Martin Taal:
>>> I have this as dependencies in server plugin I use:
>> What do you by "server plugin I use"? Does that ean you have to manually change the manifest of our shipped (and signed)
>> cdo.server plugin? Or of our shipped (and signed) cdo.server.hibernate plugin?
>>
>>> Require-Bundle: org.eclipse.core.runtime,
>>> org.hsqldb;bundle-version="1.8.1",
>>> org.postgresql;bundle-version="9.0.0",
>>> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="3.0.100",
>>> org.eclipse.net4j.util;bundle-version="3.1.0",
>>> org.eclipse.emf.ecore;bundle-version="2.7.0"
>>>
>>> This works for me. The postgresql plugin I created does not depend on Hibernate and it is not needed afaics.
>>>
>>> I agree with Eike that buddy policy registered is more selective, the reason that I choose dependent is that I wanted
>>> to make it as easy as possible for people to use the hibernate plugin...
>> I would certainly not call the unpacking and changing of shipped binary plugins easy. But maybe I still not fully
>> understand what you're doing...
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/16/2011 08:24 AM, Eike Stepper wrote:
>>>> Hi Goetz,
>>>>
>>>> The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate
>>>> bundle's manifest reveals:
>>>>
>>>> Eclipse-BuddyPolicy: dependent
>>>>
>>>> So, have you already tried to make your driver bundle depend on the hibernate bundle?
>>>>
>>>> Personally I have the feeling that the buddy policy should rather be "registered" because that would be:
>>>>
>>>> 1) More selective ("does hibernate need to see all dependent bundles?")
>>>> 2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 16.05.2011 00:09, schrieb Goetz Botterweck:
>>>>> Hi,
>>>>>
>>>>> I want to access another database type that is not supported yet by CDO
>>>>> Hibernate Server (e.g. Microsoft SQL Server).
>>>>>
>>>>> What is the intended place to integrate such database drivers?
>>>>>
>>>>> I am trying to start CDOHibernateServer.launch in
>>>>> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>>>>>
>>>>> I added a corresponding section in
>>>>> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>>>>>
>>>>> Then, I tried these alternatives
>>>>>
>>>>> ALTERNATIVE 1)
>>>>> - create a separate plugin from the driver jar (File -> New -> Plugin
>>>>> from existing JAR), for instance com.microsoft.sqlserver.jdbc
>>>>> - list the new plugin as a dependency from
>>>>> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>>>>>
>>>>> ALTERNATIVE 2)
>>>>> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
>>>>> - list jar in Manifest> Runtime> Classpath
>>>>> - add packages of jar to Manifest> Runtime> Exported Packages
>>>>>
>>>>> Nevertheless I get a ClassNotFoundException
>>>>>
>>>>> Is there a certain way these drivers have to be made visible?
>>>>>
>>>>> Since the CDOHibernateServer.launch specifies "Launch With = all
>>>>> workspace and enabled target plugins" I thought that the new plugin
>>>>> would be included when starting the server.
>>>>>
>>>>> This was working before (with earlier versions of CDO?) but I probably
>>>>> made some stupid mistake.
>>>>>
>>>>> Any hints? Thanks,
>>>>> Goetz
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ----trace-----
>>>>> (...earlier lines omitted...)
>>>>> log4j: Category org.hibernate.cache set to ERROR
>>>>> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
>>>>> log4j: Finished configuring.
>>>>> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
>>>>> for Hibernate PackageHandler
>>>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
>>>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
>>>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> java.lang.ClassNotFoundException:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at
>>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Unknown Source)
>>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>>> at
>>>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> 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(Unknown Source)
>>>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
>>>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>>> at
>>>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> 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(Unknown Source)
>>>>> Caused by: java.lang.ClassNotFoundException:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at
>>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Unknown Source)
>>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>>> ... 22 more
>>>>> [INFO] No user manager configured. Users will not be authenticated
>>>>> [ERROR] JDBC Driver class not found:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
>>>>> org.eclipse.emf.cdo.server.app.0] ERROR
>>>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> java.lang.ClassNotFoundException:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at
>>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Unknown Source)
>>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>>> at
>>>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>>>> at
>>>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>>>> at
>>>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> 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(Unknown Source)
>>>>>
>>>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>>> at
>>>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>>>> at
>>>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>>>> at
>>>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> 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(Unknown Source)
>>>>> Caused by: java.lang.ClassNotFoundException:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at
>>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Unknown Source)
>>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>>> ... 22 more
>>>
>>>
>
>


Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -> ClassNotFoundExce [message #686805 is a reply to message #686763] Thu, 19 May 2011 15:51 Go to previous messageGo to next message
Goetz Botterweck is currently offline Goetz BotterweckFriend
Messages: 71
Registered: July 2009
Member
Hi Martin,

On 16/05/2011 06:04, Martin Taal wrote:
> Hi Goetz,
> Hmm, difficult to comment on as it works fine for me. I did the same for
> postgresql last week, created a plugin and listed it as a dependency in
> the server plugin.
>
> See here for how the postgresql plugin is structured:
> http://www.elver.org/eclipse/update
>
> I can try to create the ms sql jdbc plugin myself also and list it on
> the elver.org update site. From where did you download the jdbc driver?
http://msdn.microsoft.com/en-us/sqlserver/aa937724

I then

1) used the "File > New > Other > Plugins from existing JAR" function.

2) added the new plugin to the dependencies in the CDO hibernate server
plugin.

My MANIFEST.MF and server config are pasted below.

The com.microsoft.sqlserver.jdbc plugin was create by me (from the *.jar
downloaded).

Any ideas? Thanks,
Goetz

----- MANIFEST.MF ---------------------------------------------------
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server
Bundle-Version: 4.0.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.eclipse.emf.cdo.server.hibernate,
org.eclipse.emf.cdo.server.hibernate.teneo
Require-Bundle:
org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
com.microsoft.sqlserver.jdbc;bundle-version="3.0.0"
Import-Package:
org.eclipse.emf.teneo.annotations.mapper;version="[1.1.2,2.0.0)",
org.eclipse.emf.teneo.annotations.pamodel;version="[1.1.2,2.0.0)",
org.eclipse.emf.teneo.annotations.pannotation;version="[1.1.2,2.0.0)",
org.eclipse.emf.cdo.server.hibernate.internal.teneo;version="[3.0.0,4.0.0)",
org.hibernate.engine;version="[3.3.2,4.0.0)",
org.hibernate.id;version="[3.3.2,4.0.0)",
org.hibernate.persister.entity;version="[3.3.2,4.0.0)"
Export-Package: com.microsoft.sqlserver.jdbc,
microsoft.sql,
org.eclipse.emf.cdo.examples.hibernate.server;version="4.0.0"
Bundle-ClassPath: .,
lib/sqljdbc4.jar

--- cdo-server.xml (extract) ----------------------
<property name="hibernate.dialect"
value="org.hibernate.dialect.SQLServerDialect"/>

<property name="hibernate.connection.driver_class"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

<property name="hibernate.connection.url"
value="jdbc:sqlserver://INSERTSERVERNAMEHERE:1433;databaseName=INSERTDATABASEHERE;"/>

<property name="hibernate.connection.username" value="INSERTUSERNAMEHERE"/>

<property name="hibernate.connection.password" value="INSERTPASSWORDHERE"/>
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686808 is a reply to message #686805] Thu, 19 May 2011 16:22 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Goetz,
Afaics you don't need all the teneo dependencies or hibernate dependencies.

I will make one and put it on the elver.org eclipse update site. Did you use the sqljdbc.jar or the sqljdbc4.jar file
from microsoft?

gr. Martin

On 05/20/2011 02:51 AM, Goetz Botterweck wrote:
> Hi Martin,
>
> On 16/05/2011 06:04, Martin Taal wrote:
>> Hi Goetz,
>> Hmm, difficult to comment on as it works fine for me. I did the same for
>> postgresql last week, created a plugin and listed it as a dependency in
>> the server plugin.
>>
>> See here for how the postgresql plugin is structured:
>> http://www.elver.org/eclipse/update
>>
>> I can try to create the ms sql jdbc plugin myself also and list it on
>> the elver.org update site. From where did you download the jdbc driver?
> http://msdn.microsoft.com/en-us/sqlserver/aa937724
>
> I then
>
> 1) used the "File> New> Other> Plugins from existing JAR" function.
>
> 2) added the new plugin to the dependencies in the CDO hibernate server
> plugin.
>
> My MANIFEST.MF and server config are pasted below.
>
> The com.microsoft.sqlserver.jdbc plugin was create by me (from the *.jar
> downloaded).
>
> Any ideas? Thanks,
> Goetz
>
> ----- MANIFEST.MF ---------------------------------------------------
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: %pluginName
> Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server
> Bundle-Version: 4.0.0.qualifier
> Bundle-Vendor: %providerName
> Bundle-Localization: plugin
> Bundle-RequiredExecutionEnvironment: J2SE-1.5
> Eclipse-RegisterBuddy: org.eclipse.emf.cdo.server.hibernate,
> org.eclipse.emf.cdo.server.hibernate.teneo
> Require-Bundle:
> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)",
> org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
> org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
> org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
> com.microsoft.sqlserver.jdbc;bundle-version="3.0.0"
> Import-Package:
> org.eclipse.emf.teneo.annotations.mapper;version="[1.1.2,2.0.0)",
> org.eclipse.emf.teneo.annotations.pamodel;version="[1.1.2,2.0.0)",
> org.eclipse.emf.teneo.annotations.pannotation;version="[1.1.2,2.0.0)",
> org.eclipse.emf.cdo.server.hibernate.internal.teneo;version="[3.0.0,4.0.0)",
> org.hibernate.engine;version="[3.3.2,4.0.0)",
> org.hibernate.id;version="[3.3.2,4.0.0)",
> org.hibernate.persister.entity;version="[3.3.2,4.0.0)"
> Export-Package: com.microsoft.sqlserver.jdbc,
> microsoft.sql,
> org.eclipse.emf.cdo.examples.hibernate.server;version="4.0.0"
> Bundle-ClassPath: .,
> lib/sqljdbc4.jar
>
> --- cdo-server.xml (extract) ----------------------
> <property name="hibernate.dialect"
> value="org.hibernate.dialect.SQLServerDialect"/>
>
> <property name="hibernate.connection.driver_class"
> value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>
> <property name="hibernate.connection.url"
> value="jdbc:sqlserver://INSERTSERVERNAMEHERE:1433;databaseName=INSERTDATABASEHERE;"/>
>
> <property name="hibernate.connection.username" value="INSERTUSERNAMEHERE"/>
>
> <property name="hibernate.connection.password" value="INSERTPASSWORDHERE"/>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686809 is a reply to message #686808] Thu, 19 May 2011 16:23 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I see now that jdbc4.jar is for java 6, I will use that one.

gr. Martin

On 05/20/2011 03:22 AM, Martin Taal wrote:
> Hi Goetz,
> Afaics you don't need all the teneo dependencies or hibernate dependencies.
>
> I will make one and put it on the elver.org eclipse update site. Did you use the sqljdbc.jar or the sqljdbc4.jar file
> from microsoft?
>
> gr. Martin
>
> On 05/20/2011 02:51 AM, Goetz Botterweck wrote:
>> Hi Martin,
>>
>> On 16/05/2011 06:04, Martin Taal wrote:
>>> Hi Goetz,
>>> Hmm, difficult to comment on as it works fine for me. I did the same for
>>> postgresql last week, created a plugin and listed it as a dependency in
>>> the server plugin.
>>>
>>> See here for how the postgresql plugin is structured:
>>> http://www.elver.org/eclipse/update
>>>
>>> I can try to create the ms sql jdbc plugin myself also and list it on
>>> the elver.org update site. From where did you download the jdbc driver?
>> http://msdn.microsoft.com/en-us/sqlserver/aa937724
>>
>> I then
>>
>> 1) used the "File> New> Other> Plugins from existing JAR" function.
>>
>> 2) added the new plugin to the dependencies in the CDO hibernate server
>> plugin.
>>
>> My MANIFEST.MF and server config are pasted below.
>>
>> The com.microsoft.sqlserver.jdbc plugin was create by me (from the *.jar
>> downloaded).
>>
>> Any ideas? Thanks,
>> Goetz
>>
>> ----- MANIFEST.MF ---------------------------------------------------
>> Manifest-Version: 1.0
>> Bundle-ManifestVersion: 2
>> Bundle-Name: %pluginName
>> Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server
>> Bundle-Version: 4.0.0.qualifier
>> Bundle-Vendor: %providerName
>> Bundle-Localization: plugin
>> Bundle-RequiredExecutionEnvironment: J2SE-1.5
>> Eclipse-RegisterBuddy: org.eclipse.emf.cdo.server.hibernate,
>> org.eclipse.emf.cdo.server.hibernate.teneo
>> Require-Bundle:
>> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)",
>> org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
>> org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
>> org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
>> com.microsoft.sqlserver.jdbc;bundle-version="3.0.0"
>> Import-Package:
>> org.eclipse.emf.teneo.annotations.mapper;version="[1.1.2,2.0.0)",
>> org.eclipse.emf.teneo.annotations.pamodel;version="[1.1.2,2.0.0)",
>> org.eclipse.emf.teneo.annotations.pannotation;version="[1.1.2,2.0.0)",
>> org.eclipse.emf.cdo.server.hibernate.internal.teneo;version="[3.0.0,4.0.0)",
>> org.hibernate.engine;version="[3.3.2,4.0.0)",
>> org.hibernate.id;version="[3.3.2,4.0.0)",
>> org.hibernate.persister.entity;version="[3.3.2,4.0.0)"
>> Export-Package: com.microsoft.sqlserver.jdbc,
>> microsoft.sql,
>> org.eclipse.emf.cdo.examples.hibernate.server;version="4.0.0"
>> Bundle-ClassPath: .,
>> lib/sqljdbc4.jar
>>
>> --- cdo-server.xml (extract) ----------------------
>> <property name="hibernate.dialect"
>> value="org.hibernate.dialect.SQLServerDialect"/>
>>
>> <property name="hibernate.connection.driver_class"
>> value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>>
>> <property name="hibernate.connection.url"
>> value="jdbc:sqlserver://INSERTSERVERNAMEHERE:1433;databaseName=INSERTDATABASEHERE;"/>
>>
>> <property name="hibernate.connection.username" value="INSERTUSERNAMEHERE"/>
>>
>> <property name="hibernate.connection.password" value="INSERTPASSWORDHERE"/>
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686810 is a reply to message #686809] Thu, 19 May 2011 16:55 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I published a ms jdbc driver on elver.org/eclipse/update. Can you try it?

gr. Martin

On 05/20/2011 03:23 AM, Martin Taal wrote:
> I see now that jdbc4.jar is for java 6, I will use that one.
>
> gr. Martin
>
> On 05/20/2011 03:22 AM, Martin Taal wrote:
>> Hi Goetz,
>> Afaics you don't need all the teneo dependencies or hibernate dependencies.
>>
>> I will make one and put it on the elver.org eclipse update site. Did you use the sqljdbc.jar or the sqljdbc4.jar file
>> from microsoft?
>>
>> gr. Martin
>>
>> On 05/20/2011 02:51 AM, Goetz Botterweck wrote:
>>> Hi Martin,
>>>
>>> On 16/05/2011 06:04, Martin Taal wrote:
>>>> Hi Goetz,
>>>> Hmm, difficult to comment on as it works fine for me. I did the same for
>>>> postgresql last week, created a plugin and listed it as a dependency in
>>>> the server plugin.
>>>>
>>>> See here for how the postgresql plugin is structured:
>>>> http://www.elver.org/eclipse/update
>>>>
>>>> I can try to create the ms sql jdbc plugin myself also and list it on
>>>> the elver.org update site. From where did you download the jdbc driver?
>>> http://msdn.microsoft.com/en-us/sqlserver/aa937724
>>>
>>> I then
>>>
>>> 1) used the "File> New> Other> Plugins from existing JAR" function.
>>>
>>> 2) added the new plugin to the dependencies in the CDO hibernate server
>>> plugin.
>>>
>>> My MANIFEST.MF and server config are pasted below.
>>>
>>> The com.microsoft.sqlserver.jdbc plugin was create by me (from the *.jar
>>> downloaded).
>>>
>>> Any ideas? Thanks,
>>> Goetz
>>>
>>> ----- MANIFEST.MF ---------------------------------------------------
>>> Manifest-Version: 1.0
>>> Bundle-ManifestVersion: 2
>>> Bundle-Name: %pluginName
>>> Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server
>>> Bundle-Version: 4.0.0.qualifier
>>> Bundle-Vendor: %providerName
>>> Bundle-Localization: plugin
>>> Bundle-RequiredExecutionEnvironment: J2SE-1.5
>>> Eclipse-RegisterBuddy: org.eclipse.emf.cdo.server.hibernate,
>>> org.eclipse.emf.cdo.server.hibernate.teneo
>>> Require-Bundle:
>>> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)",
>>> org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
>>> org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
>>> org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
>>> com.microsoft.sqlserver.jdbc;bundle-version="3.0.0"
>>> Import-Package:
>>> org.eclipse.emf.teneo.annotations.mapper;version="[1.1.2,2.0.0)",
>>> org.eclipse.emf.teneo.annotations.pamodel;version="[1.1.2,2.0.0)",
>>> org.eclipse.emf.teneo.annotations.pannotation;version="[1.1.2,2.0.0)",
>>> org.eclipse.emf.cdo.server.hibernate.internal.teneo;version="[3.0.0,4.0.0)",
>>> org.hibernate.engine;version="[3.3.2,4.0.0)",
>>> org.hibernate.id;version="[3.3.2,4.0.0)",
>>> org.hibernate.persister.entity;version="[3.3.2,4.0.0)"
>>> Export-Package: com.microsoft.sqlserver.jdbc,
>>> microsoft.sql,
>>> org.eclipse.emf.cdo.examples.hibernate.server;version="4.0.0"
>>> Bundle-ClassPath: .,
>>> lib/sqljdbc4.jar
>>>
>>> --- cdo-server.xml (extract) ----------------------
>>> <property name="hibernate.dialect"
>>> value="org.hibernate.dialect.SQLServerDialect"/>
>>>
>>> <property name="hibernate.connection.driver_class"
>>> value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>>>
>>> <property name="hibernate.connection.url"
>>> value="jdbc:sqlserver://INSERTSERVERNAMEHERE:1433;databaseName=INSERTDATABASEHERE;"/>
>>>
>>> <property name="hibernate.connection.username" value="INSERTUSERNAMEHERE"/>
>>>
>>> <property name="hibernate.connection.password" value="INSERTPASSWORDHERE"/>
>>>
>>
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686832 is a reply to message #686810] Sun, 22 May 2011 20:00 Go to previous message
Goetz Botterweck is currently offline Goetz BotterweckFriend
Messages: 71
Registered: July 2009
Member
On 19/05/2011 06:55, Martin Taal wrote:
> I published a ms jdbc driver on elver.org/eclipse/update. Can you try it?

Hi Martin, this seems to be working. Thanks! I document my steps below
so that maybe others can reproduce them.


NOTES
A remark about the link between launch config and cdo-server.xml. This
can be a bit tricky. The launch configuration in
CDOHibernateServer.launch does NOT refer to the cdo-server.xml in the
CURRENT project. Instead it uses VM Arguments to refer to a fixed path
/org.eclipse.emf.cdo.examples.hibernate.server/config/cdo-server.xml. =>
During analysis of the problem with the ClassNotFound exception, I was
experimenting with some settings in cdo-server.xml seemed to have no
effect. That was because I was editing a file that was not used at all.

HOWTO
Here the summary of my steps:

- In SQL Server create a database and corresponding login

- Install Microsoft SQL Server JDBC driver via Help > Install
additional software, work with = http://elver.org/eclipse/update/

- Check out org.eclipse.emf.cdo.examples.hibernate.server from
http://dev.eclipse.org/svnroot/modeling/org.eclipse.emf.cdo/trunk/plugins/org.eclipse.emf.cdo.examples.hibernate.server


OPTIONALLY: TEST WITH HSQLDB
- Run CDOHibernateServer.launch (no changes to cdo-server.xml yet, this
will use hsqldb) --> server should start OK

- Run tests in HibernateQueryTest in
org.eclipse.emf.cdo.examples.hibernate.client (Right click > Run As >
JUnit test)
See
/org.eclipse.emf.cdo.examples.hibernate.client/src/org/eclipse/emf/cdo/examples/hibernate/client/HibernateQueryTest.java
--> all tests should be successful

- Terminate CDOHibernateServer


TEST WITH MICROSOFT SQL SERVER
- Switch to Microsoft SQL Server by applying the following steps
1) Add com.microsoft.sqlserver.jdbc as a dependency to MANIFEST.MF
2) Edit cdo-server.xml: comment out the „Setting for hsqldb“ section
and add the following lines as an alternative

<!-- Settings for Microsoft SQL Server -->
<property name="hibernate.dialect"
value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.connection.driver_class"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="hibernate.connection.url"
value="jdbc:sqlserver://INSERTSERVER:1433;databaseName=INSERTDATABASENAME;"/>
<property name="hibernate.connection.username" value="INSERTUSER"/>
<property name="hibernate.connection.password" value="INSERTPASSWORD"/>

- Run CDOHibernateServer.launch (with changes to cdo-server.xml, will
now use Microsoft SQL Server) --> server should start OK

- Run tests in HibernateQueryTest in
org.eclipse.emf.cdo.examples.hibernate.client (Right click > Run As >
JUnit test)
See
/org.eclipse.emf.cdo.examples.hibernate.client/src/org/eclipse/emf/cdo/examples/hibernate/client/HibernateQueryTest.java
--> all tests should be successful
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686926 is a reply to message #686762] Mon, 16 May 2011 05:04 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Goetz,
Hmm, difficult to comment on as it works fine for me. I did the same for postgresql last week, created a plugin and
listed it as a dependency in the server plugin.

See here for how the postgresql plugin is structured:
http://www.elver.org/eclipse/update

I can try to create the ms sql jdbc plugin myself also and list it on the elver.org update site. From where did you
download the jdbc driver?

gr. Martin

On 05/16/2011 12:09 AM, Goetz Botterweck wrote:
> Hi,
>
> I want to access another database type that is not supported yet by CDO
> Hibernate Server (e.g. Microsoft SQL Server).
>
> What is the intended place to integrate such database drivers?
>
> I am trying to start CDOHibernateServer.launch in
> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>
> I added a corresponding section in
> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>
> Then, I tried these alternatives
>
> ALTERNATIVE 1)
> - create a separate plugin from the driver jar (File -> New -> Plugin
> from existing JAR), for instance com.microsoft.sqlserver.jdbc
> - list the new plugin as a dependency from
> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>
> ALTERNATIVE 2)
> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
> - list jar in Manifest> Runtime> Classpath
> - add packages of jar to Manifest> Runtime> Exported Packages
>
> Nevertheless I get a ClassNotFoundException
>
> Is there a certain way these drivers have to be made visible?
>
> Since the CDOHibernateServer.launch specifies "Launch With = all
> workspace and enabled target plugins" I thought that the new plugin
> would be included when starting the server.
>
> This was working before (with earlier versions of CDO?) but I probably
> made some stupid mistake.
>
> Any hints? Thanks,
> Goetz
>
>
>
>
>
>
>
>
>
>
>
> ----trace-----
> (...earlier lines omitted...)
> log4j: Category org.hibernate.cache set to ERROR
> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
> log4j: Finished configuring.
> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
> for Hibernate PackageHandler
> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
> java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
> org.hibernate.HibernateException: JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> ... 22 more
> [INFO] No user manager configured. Users will not be authenticated
> [ERROR] JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
> org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
> java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> at
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
>
> org.hibernate.HibernateException: JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> at
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> ... 22 more


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686927 is a reply to message #686762] Mon, 16 May 2011 06:24 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi Goetz,

The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate bundle's manifest reveals:

Eclipse-BuddyPolicy: dependent

So, have you already tried to make your driver bundle depend on the hibernate bundle?

Personally I have the feeling that the buddy policy should rather be "registered" because that would be:

1) More selective ("does hibernate need to see all dependent bundles?")
2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")

Cheers
/Eike

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



Am 16.05.2011 00:09, schrieb Goetz Botterweck:
> Hi,
>
> I want to access another database type that is not supported yet by CDO
> Hibernate Server (e.g. Microsoft SQL Server).
>
> What is the intended place to integrate such database drivers?
>
> I am trying to start CDOHibernateServer.launch in
> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>
> I added a corresponding section in
> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>
> Then, I tried these alternatives
>
> ALTERNATIVE 1)
> - create a separate plugin from the driver jar (File -> New -> Plugin
> from existing JAR), for instance com.microsoft.sqlserver.jdbc
> - list the new plugin as a dependency from
> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>
> ALTERNATIVE 2)
> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
> - list jar in Manifest> Runtime> Classpath
> - add packages of jar to Manifest> Runtime> Exported Packages
>
> Nevertheless I get a ClassNotFoundException
>
> Is there a certain way these drivers have to be made visible?
>
> Since the CDOHibernateServer.launch specifies "Launch With = all
> workspace and enabled target plugins" I thought that the new plugin
> would be included when starting the server.
>
> This was working before (with earlier versions of CDO?) but I probably
> made some stupid mistake.
>
> Any hints? Thanks,
> Goetz
>
>
>
>
>
>
>
>
>
>
>
> ----trace-----
> (...earlier lines omitted...)
> log4j: Category org.hibernate.cache set to ERROR
> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
> log4j: Finished configuring.
> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
> for Hibernate PackageHandler
> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
> java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
> org.hibernate.HibernateException: JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> ... 22 more
> [INFO] No user manager configured. Users will not be authenticated
> [ERROR] JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
> org.eclipse.emf.cdo.server.app.0] ERROR
> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
> java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> at
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
>
> org.hibernate.HibernateException: JDBC Driver class not found:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
> at
> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> at
> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> at
> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
> at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
> at
> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
> at
> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
> at
> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
> at
> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
> at
> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
> at
> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
> 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(Unknown Source)
> Caused by: java.lang.ClassNotFoundException:
> com.microsoft.sqlserver.jdbc.SQLServerDriver
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Unknown Source)
> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
> at
> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
> ... 22 more


Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686928 is a reply to message #686764] Mon, 16 May 2011 07:18 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I have this as dependencies in server plugin I use:
Require-Bundle: org.eclipse.core.runtime,
org.hsqldb;bundle-version="1.8.1",
org.postgresql;bundle-version="9.0.0",
org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="3.0.100",
org.eclipse.net4j.util;bundle-version="3.1.0",
org.eclipse.emf.ecore;bundle-version="2.7.0"

This works for me. The postgresql plugin I created does not depend on Hibernate and it is not needed afaics.

I agree with Eike that buddy policy registered is more selective, the reason that I choose dependent is that I wanted to
make it as easy as possible for people to use the hibernate plugin...

gr. Martin

On 05/16/2011 08:24 AM, Eike Stepper wrote:
> Hi Goetz,
>
> The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate
> bundle's manifest reveals:
>
> Eclipse-BuddyPolicy: dependent
>
> So, have you already tried to make your driver bundle depend on the hibernate bundle?
>
> Personally I have the feeling that the buddy policy should rather be "registered" because that would be:
>
> 1) More selective ("does hibernate need to see all dependent bundles?")
> 2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 16.05.2011 00:09, schrieb Goetz Botterweck:
>> Hi,
>>
>> I want to access another database type that is not supported yet by CDO
>> Hibernate Server (e.g. Microsoft SQL Server).
>>
>> What is the intended place to integrate such database drivers?
>>
>> I am trying to start CDOHibernateServer.launch in
>> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>>
>> I added a corresponding section in
>> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>>
>> Then, I tried these alternatives
>>
>> ALTERNATIVE 1)
>> - create a separate plugin from the driver jar (File -> New -> Plugin
>> from existing JAR), for instance com.microsoft.sqlserver.jdbc
>> - list the new plugin as a dependency from
>> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>>
>> ALTERNATIVE 2)
>> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
>> - list jar in Manifest> Runtime> Classpath
>> - add packages of jar to Manifest> Runtime> Exported Packages
>>
>> Nevertheless I get a ClassNotFoundException
>>
>> Is there a certain way these drivers have to be made visible?
>>
>> Since the CDOHibernateServer.launch specifies "Launch With = all
>> workspace and enabled target plugins" I thought that the new plugin
>> would be included when starting the server.
>>
>> This was working before (with earlier versions of CDO?) but I probably
>> made some stupid mistake.
>>
>> Any hints? Thanks,
>> Goetz
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ----trace-----
>> (...earlier lines omitted...)
>> log4j: Category org.hibernate.cache set to ERROR
>> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
>> log4j: Finished configuring.
>> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
>> for Hibernate PackageHandler
>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>> java.lang.ClassNotFoundException:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>> at
>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>> at
>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>> at
>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> 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(Unknown Source)
>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
>> org.hibernate.HibernateException: JDBC Driver class not found:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>> at
>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>> at
>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>> at
>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> 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(Unknown Source)
>> Caused by: java.lang.ClassNotFoundException:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>> ... 22 more
>> [INFO] No user manager configured. Users will not be authenticated
>> [ERROR] JDBC Driver class not found:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
>> org.eclipse.emf.cdo.server.app.0] ERROR
>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>> java.lang.ClassNotFoundException:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>> at
>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>> at
>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>> at
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>> at
>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>> at
>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> 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(Unknown Source)
>>
>> org.hibernate.HibernateException: JDBC Driver class not found:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>> at
>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>> at
>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>> at
>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>> at
>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>> at
>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>> at
>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>> at
>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>> at
>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>> at
>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>> at
>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>> 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(Unknown Source)
>> Caused by: java.lang.ClassNotFoundException:
>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>> at
>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>> at
>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>> at java.lang.ClassLoader.loadClass(Unknown Source)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Unknown Source)
>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>> at
>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>> ... 22 more


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686929 is a reply to message #686765] Mon, 16 May 2011 07:48 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.05.2011 09:18, schrieb Martin Taal:
> I have this as dependencies in server plugin I use:
What do you by "server plugin I use"? Does that ean you have to manually change the manifest of our shipped (and signed) cdo.server plugin? Or of our shipped (and signed) cdo.server.hibernate plugin?

> Require-Bundle: org.eclipse.core.runtime,
> org.hsqldb;bundle-version="1.8.1",
> org.postgresql;bundle-version="9.0.0",
> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="3.0.100",
> org.eclipse.net4j.util;bundle-version="3.1.0",
> org.eclipse.emf.ecore;bundle-version="2.7.0"
>
> This works for me. The postgresql plugin I created does not depend on Hibernate and it is not needed afaics.
>
> I agree with Eike that buddy policy registered is more selective, the reason that I choose dependent is that I wanted to make it as easy as possible for people to use the hibernate plugin...
I would certainly not call the unpacking and changing of shipped binary plugins easy. But maybe I still not fully understand what you're doing...

Cheers
/Eike

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


>
> gr. Martin
>
> On 05/16/2011 08:24 AM, Eike Stepper wrote:
>> Hi Goetz,
>>
>> The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate
>> bundle's manifest reveals:
>>
>> Eclipse-BuddyPolicy: dependent
>>
>> So, have you already tried to make your driver bundle depend on the hibernate bundle?
>>
>> Personally I have the feeling that the buddy policy should rather be "registered" because that would be:
>>
>> 1) More selective ("does hibernate need to see all dependent bundles?")
>> 2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 16.05.2011 00:09, schrieb Goetz Botterweck:
>>> Hi,
>>>
>>> I want to access another database type that is not supported yet by CDO
>>> Hibernate Server (e.g. Microsoft SQL Server).
>>>
>>> What is the intended place to integrate such database drivers?
>>>
>>> I am trying to start CDOHibernateServer.launch in
>>> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>>>
>>> I added a corresponding section in
>>> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>>>
>>> Then, I tried these alternatives
>>>
>>> ALTERNATIVE 1)
>>> - create a separate plugin from the driver jar (File -> New -> Plugin
>>> from existing JAR), for instance com.microsoft.sqlserver.jdbc
>>> - list the new plugin as a dependency from
>>> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>>>
>>> ALTERNATIVE 2)
>>> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
>>> - list jar in Manifest> Runtime> Classpath
>>> - add packages of jar to Manifest> Runtime> Exported Packages
>>>
>>> Nevertheless I get a ClassNotFoundException
>>>
>>> Is there a certain way these drivers have to be made visible?
>>>
>>> Since the CDOHibernateServer.launch specifies "Launch With = all
>>> workspace and enabled target plugins" I thought that the new plugin
>>> would be included when starting the server.
>>>
>>> This was working before (with earlier versions of CDO?) but I probably
>>> made some stupid mistake.
>>>
>>> Any hints? Thanks,
>>> Goetz
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> ----trace-----
>>> (...earlier lines omitted...)
>>> log4j: Category org.hibernate.cache set to ERROR
>>> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
>>> log4j: Finished configuring.
>>> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
>>> for Hibernate PackageHandler
>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> java.lang.ClassNotFoundException:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at
>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>> at
>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>> at
>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>> at
>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> 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(Unknown Source)
>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>> at
>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>> at
>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>> at
>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> 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(Unknown Source)
>>> Caused by: java.lang.ClassNotFoundException:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at
>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>> ... 22 more
>>> [INFO] No user manager configured. Users will not be authenticated
>>> [ERROR] JDBC Driver class not found:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
>>> org.eclipse.emf.cdo.server.app.0] ERROR
>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> java.lang.ClassNotFoundException:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at
>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>> at
>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>> at
>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>> at
>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>> at
>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>> at
>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>> at
>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> 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(Unknown Source)
>>>
>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>> at
>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>> at
>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>> at
>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>> at
>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>> at
>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>> at
>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>> at
>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>> at
>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>> at
>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>> at
>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>> 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(Unknown Source)
>>> Caused by: java.lang.ClassNotFoundException:
>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>> at
>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>> at
>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>> at java.lang.Class.forName0(Native Method)
>>> at java.lang.Class.forName(Unknown Source)
>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>> at
>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>> ... 22 more
>
>


Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686931 is a reply to message #686766] Mon, 16 May 2011 08:08 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Eike,
I don't need to unpack or change shipped binaries/plugins, my postgresql jdbc plugin does not contain any reference to
the hibernate plugin.

The 'server' plugin is something I created so not part of cdo, hibernate or something else. It contains code to
customize the mapping or to add other server side stuff. It also contains the cdo-server.xml for example and it contains
dependencies on cdo.server.hibernate.teneo and on the postgresql plugin.

gr. Martin

On 05/16/2011 09:48 AM, Eike Stepper wrote:
> Am 16.05.2011 09:18, schrieb Martin Taal:
>> I have this as dependencies in server plugin I use:
> What do you by "server plugin I use"? Does that ean you have to manually change the manifest of our shipped (and signed)
> cdo.server plugin? Or of our shipped (and signed) cdo.server.hibernate plugin?
>
>> Require-Bundle: org.eclipse.core.runtime,
>> org.hsqldb;bundle-version="1.8.1",
>> org.postgresql;bundle-version="9.0.0",
>> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="3.0.100",
>> org.eclipse.net4j.util;bundle-version="3.1.0",
>> org.eclipse.emf.ecore;bundle-version="2.7.0"
>>
>> This works for me. The postgresql plugin I created does not depend on Hibernate and it is not needed afaics.
>>
>> I agree with Eike that buddy policy registered is more selective, the reason that I choose dependent is that I wanted
>> to make it as easy as possible for people to use the hibernate plugin...
> I would certainly not call the unpacking and changing of shipped binary plugins easy. But maybe I still not fully
> understand what you're doing...
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> gr. Martin
>>
>> On 05/16/2011 08:24 AM, Eike Stepper wrote:
>>> Hi Goetz,
>>>
>>> The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate
>>> bundle's manifest reveals:
>>>
>>> Eclipse-BuddyPolicy: dependent
>>>
>>> So, have you already tried to make your driver bundle depend on the hibernate bundle?
>>>
>>> Personally I have the feeling that the buddy policy should rather be "registered" because that would be:
>>>
>>> 1) More selective ("does hibernate need to see all dependent bundles?")
>>> 2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 16.05.2011 00:09, schrieb Goetz Botterweck:
>>>> Hi,
>>>>
>>>> I want to access another database type that is not supported yet by CDO
>>>> Hibernate Server (e.g. Microsoft SQL Server).
>>>>
>>>> What is the intended place to integrate such database drivers?
>>>>
>>>> I am trying to start CDOHibernateServer.launch in
>>>> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>>>>
>>>> I added a corresponding section in
>>>> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>>>>
>>>> Then, I tried these alternatives
>>>>
>>>> ALTERNATIVE 1)
>>>> - create a separate plugin from the driver jar (File -> New -> Plugin
>>>> from existing JAR), for instance com.microsoft.sqlserver.jdbc
>>>> - list the new plugin as a dependency from
>>>> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>>>>
>>>> ALTERNATIVE 2)
>>>> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
>>>> - list jar in Manifest> Runtime> Classpath
>>>> - add packages of jar to Manifest> Runtime> Exported Packages
>>>>
>>>> Nevertheless I get a ClassNotFoundException
>>>>
>>>> Is there a certain way these drivers have to be made visible?
>>>>
>>>> Since the CDOHibernateServer.launch specifies "Launch With = all
>>>> workspace and enabled target plugins" I thought that the new plugin
>>>> would be included when starting the server.
>>>>
>>>> This was working before (with earlier versions of CDO?) but I probably
>>>> made some stupid mistake.
>>>>
>>>> Any hints? Thanks,
>>>> Goetz
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ----trace-----
>>>> (...earlier lines omitted...)
>>>> log4j: Category org.hibernate.cache set to ERROR
>>>> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
>>>> log4j: Finished configuring.
>>>> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
>>>> for Hibernate PackageHandler
>>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
>>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
>>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> java.lang.ClassNotFoundException:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at
>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.Class.forName0(Native Method)
>>>> at java.lang.Class.forName(Unknown Source)
>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>> at
>>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> 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(Unknown Source)
>>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
>>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>> at
>>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> 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(Unknown Source)
>>>> Caused by: java.lang.ClassNotFoundException:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at
>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.Class.forName0(Native Method)
>>>> at java.lang.Class.forName(Unknown Source)
>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>> ... 22 more
>>>> [INFO] No user manager configured. Users will not be authenticated
>>>> [ERROR] JDBC Driver class not found:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
>>>> org.eclipse.emf.cdo.server.app.0] ERROR
>>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> java.lang.ClassNotFoundException:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at
>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.Class.forName0(Native Method)
>>>> at java.lang.Class.forName(Unknown Source)
>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>> at
>>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>>> at
>>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>>> at
>>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> 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(Unknown Source)
>>>>
>>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>> at
>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>> at
>>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>>> at
>>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>>> at
>>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>>> at
>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>> at
>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>> at
>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>> at
>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>> at
>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>> 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(Unknown Source)
>>>> Caused by: java.lang.ClassNotFoundException:
>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>> at
>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>> at
>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>> at java.lang.Class.forName0(Native Method)
>>>> at java.lang.Class.forName(Unknown Source)
>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>> at
>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>> ... 22 more
>>
>>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686932 is a reply to message #686767] Mon, 16 May 2011 09:01 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 16.05.2011 10:08, schrieb Martin Taal:
> Hi Eike,
> I don't need to unpack or change shipped binaries/plugins, my postgresql jdbc plugin does not contain any reference to the hibernate plugin.
>
> The 'server' plugin is something I created so not part of cdo, hibernate or something else. It contains code to customize the mapping or to add other server side stuff. It also contains the cdo-server.xml for example and it contains dependencies on cdo.server.hibernate.teneo and on the postgresql plugin.
I see. That makes sense.

Cheers
/Eike

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


>
> gr. Martin
>
> On 05/16/2011 09:48 AM, Eike Stepper wrote:
>> Am 16.05.2011 09:18, schrieb Martin Taal:
>>> I have this as dependencies in server plugin I use:
>> What do you by "server plugin I use"? Does that ean you have to manually change the manifest of our shipped (and signed)
>> cdo.server plugin? Or of our shipped (and signed) cdo.server.hibernate plugin?
>>
>>> Require-Bundle: org.eclipse.core.runtime,
>>> org.hsqldb;bundle-version="1.8.1",
>>> org.postgresql;bundle-version="9.0.0",
>>> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="3.0.100",
>>> org.eclipse.net4j.util;bundle-version="3.1.0",
>>> org.eclipse.emf.ecore;bundle-version="2.7.0"
>>>
>>> This works for me. The postgresql plugin I created does not depend on Hibernate and it is not needed afaics.
>>>
>>> I agree with Eike that buddy policy registered is more selective, the reason that I choose dependent is that I wanted
>>> to make it as easy as possible for people to use the hibernate plugin...
>> I would certainly not call the unpacking and changing of shipped binary plugins easy. But maybe I still not fully
>> understand what you're doing...
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> gr. Martin
>>>
>>> On 05/16/2011 08:24 AM, Eike Stepper wrote:
>>>> Hi Goetz,
>>>>
>>>> The stack trace implies that it's the hibernate bundle that can't find the driver code. A quick look into that hibernate
>>>> bundle's manifest reveals:
>>>>
>>>> Eclipse-BuddyPolicy: dependent
>>>>
>>>> So, have you already tried to make your driver bundle depend on the hibernate bundle?
>>>>
>>>> Personally I have the feeling that the buddy policy should rather be "registered" because that would be:
>>>>
>>>> 1) More selective ("does hibernate need to see all dependent bundles?")
>>>> 2) Less impacting ("can the JDBC driver also work if hibernate is not installed?")
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 16.05.2011 00:09, schrieb Goetz Botterweck:
>>>>> Hi,
>>>>>
>>>>> I want to access another database type that is not supported yet by CDO
>>>>> Hibernate Server (e.g. Microsoft SQL Server).
>>>>>
>>>>> What is the intended place to integrate such database drivers?
>>>>>
>>>>> I am trying to start CDOHibernateServer.launch in
>>>>> org.eclipse.emf.cdo.examples.hibernate.server with another database.
>>>>>
>>>>> I added a corresponding section in
>>>>> \org.eclipse.emf.cdo.examples.hibernate.server\config\cdo-server.xml
>>>>>
>>>>> Then, I tried these alternatives
>>>>>
>>>>> ALTERNATIVE 1)
>>>>> - create a separate plugin from the driver jar (File -> New -> Plugin
>>>>> from existing JAR), for instance com.microsoft.sqlserver.jdbc
>>>>> - list the new plugin as a dependency from
>>>>> org.eclipse.emf.cdo.examples.hibernate.server/MANIFEST.MF
>>>>>
>>>>> ALTERNATIVE 2)
>>>>> - place driver jar in org.eclipse.emf.cdo.examples.hibernate.server/lib/
>>>>> - list jar in Manifest> Runtime> Classpath
>>>>> - add packages of jar to Manifest> Runtime> Exported Packages
>>>>>
>>>>> Nevertheless I get a ClassNotFoundException
>>>>>
>>>>> Is there a certain way these drivers have to be made visible?
>>>>>
>>>>> Since the CDOHibernateServer.launch specifies "Launch With = all
>>>>> workspace and enabled target plugins" I thought that the new plugin
>>>>> would be included when starting the server.
>>>>>
>>>>> This was working before (with earlier versions of CDO?) but I probably
>>>>> made some stupid mistake.
>>>>>
>>>>> Any hints? Thanks,
>>>>> Goetz
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> ----trace-----
>>>>> (...earlier lines omitted...)
>>>>> log4j: Category org.hibernate.cache set to ERROR
>>>>> log4j: Handling log4j.additivity.org.hibernate.cache=[null]
>>>>> log4j: Finished configuring.
>>>>> app thread - org.eclipse.emf.cdo.server.app.0 [debug] Updating db schema
>>>>> for Hibernate PackageHandler
>>>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
>>>>> 0 [app thread - org.eclipse.emf.cdo.server.app.0] INFO
>>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
>>>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> java.lang.ClassNotFoundException:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at
>>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Unknown Source)
>>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>>> at
>>>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> 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(Unknown Source)
>>>>> 5 [app thread - org.eclipse.emf.cdo.server.app.0] ERROR
>>>>> org.hibernate.tool.hbm2ddl.SchemaUpdate - could not complete schema update
>>>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>>> at
>>>>> org.hibernate.tool.hbm2ddl.ManagedProviderConnectionHelper.prepare(ManagedProviderConnectionHelper.java:51)
>>>>> at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.initSchema(HibernatePackageHandler.java:564)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.doActivate(HibernatePackageHandler.java:375)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.doActivate(HibernateStore.java:427)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1534)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> 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(Unknown Source)
>>>>> Caused by: java.lang.ClassNotFoundException:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at
>>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Unknown Source)
>>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>>> ... 22 more
>>>>> [INFO] No user manager configured. Users will not be authenticated
>>>>> [ERROR] JDBC Driver class not found:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver79 [app thread -
>>>>> org.eclipse.emf.cdo.server.app.0] ERROR
>>>>> org.hibernate.connection.DriverManagerConnectionProvider - JDBC Driver
>>>>> class not found: com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> java.lang.ClassNotFoundException:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at
>>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Unknown Source)
>>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>>> at
>>>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>>>> at
>>>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>>>> at
>>>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> 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(Unknown Source)
>>>>>
>>>>> org.hibernate.HibernateException: JDBC Driver class not found:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:89)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
>>>>> at
>>>>> org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
>>>>> at
>>>>> org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:459)
>>>>> at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
>>>>> at
>>>>> org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
>>>>> at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
>>>>> at
>>>>> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSessionFactory(HibernatePackageHandler.java:344)
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernatePackageHandler.getSystemInformation(HibernatePackageHandler.java:444)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getSystemInformation(HibernateStore.java:575)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.internal.hibernate.HibernateStore.getCreationTime(HibernateStore.java:409)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.Repository.doActivate(Repository.java:1547)
>>>>> at org.eclipse.net4j.util.lifecycle.Lifecycle.activate(Lifecycle.java:72)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:99)
>>>>> at
>>>>> org.eclipse.net4j.util.lifecycle.LifecycleUtil.activate(LifecycleUtil.java:89)
>>>>> at
>>>>> org.eclipse.emf.cdo.server.CDOServerUtil.addRepository(CDOServerUtil.java:201)
>>>>> at
>>>>> org.eclipse.emf.cdo.spi.server.RepositoryConfigurator.configure(RepositoryConfigurator.java:110)
>>>>> at
>>>>> org.eclipse.emf.cdo.internal.server.bundle.CDOServerApplication.doStart(CDOServerApplication.java:61)
>>>>> at org.eclipse.net4j.util.om.OSGiApplication.start(OSGiApplication.java:61)
>>>>> 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(Unknown Source)
>>>>> Caused by: java.lang.ClassNotFoundException:
>>>>> com.microsoft.sqlserver.jdbc.SQLServerDriver
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
>>>>> at
>>>>> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
>>>>> at
>>>>> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
>>>>> at java.lang.ClassLoader.loadClass(Unknown Source)
>>>>> at java.lang.Class.forName0(Native Method)
>>>>> at java.lang.Class.forName(Unknown Source)
>>>>> at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)
>>>>> at
>>>>> org.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:84)
>>>>> ... 22 more
>>>
>>>
>
>


Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686980 is a reply to message #686763] Thu, 19 May 2011 15:51 Go to previous message
Goetz Botterweck is currently offline Goetz BotterweckFriend
Messages: 71
Registered: July 2009
Member
Hi Martin,

On 16/05/2011 06:04, Martin Taal wrote:
> Hi Goetz,
> Hmm, difficult to comment on as it works fine for me. I did the same for
> postgresql last week, created a plugin and listed it as a dependency in
> the server plugin.
>
> See here for how the postgresql plugin is structured:
> http://www.elver.org/eclipse/update
>
> I can try to create the ms sql jdbc plugin myself also and list it on
> the elver.org update site. From where did you download the jdbc driver?
http://msdn.microsoft.com/en-us/sqlserver/aa937724

I then

1) used the "File > New > Other > Plugins from existing JAR" function.

2) added the new plugin to the dependencies in the CDO hibernate server
plugin.

My MANIFEST.MF and server config are pasted below.

The com.microsoft.sqlserver.jdbc plugin was create by me (from the *.jar
downloaded).

Any ideas? Thanks,
Goetz

----- MANIFEST.MF ---------------------------------------------------
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server
Bundle-Version: 4.0.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Eclipse-RegisterBuddy: org.eclipse.emf.cdo.server.hibernate,
org.eclipse.emf.cdo.server.hibernate.teneo
Require-Bundle:
org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
com.microsoft.sqlserver.jdbc;bundle-version="3.0.0"
Import-Package:
org.eclipse.emf.teneo.annotations.mapper;version="[1.1.2,2.0.0)",
org.eclipse.emf.teneo.annotations.pamodel;version="[1.1.2,2.0.0)",
org.eclipse.emf.teneo.annotations.pannotation;version="[1.1.2,2.0.0)",
org.eclipse.emf.cdo.server.hibernate.internal.teneo;version="[3.0.0,4.0.0)",
org.hibernate.engine;version="[3.3.2,4.0.0)",
org.hibernate.id;version="[3.3.2,4.0.0)",
org.hibernate.persister.entity;version="[3.3.2,4.0.0)"
Export-Package: com.microsoft.sqlserver.jdbc,
microsoft.sql,
org.eclipse.emf.cdo.examples.hibernate.server;version="4.0.0"
Bundle-ClassPath: .,
lib/sqljdbc4.jar

--- cdo-server.xml (extract) ----------------------
<property name="hibernate.dialect"
value="org.hibernate.dialect.SQLServerDialect"/>

<property name="hibernate.connection.driver_class"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>

<property name="hibernate.connection.url"
value="jdbc:sqlserver://INSERTSERVERNAMEHERE:1433;databaseName=INSERTDATABASEHERE;"/>

<property name="hibernate.connection.username" value="INSERTUSERNAMEHERE"/>

<property name="hibernate.connection.password" value="INSERTPASSWORDHERE"/>
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686984 is a reply to message #686805] Thu, 19 May 2011 16:22 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Goetz,
Afaics you don't need all the teneo dependencies or hibernate dependencies.

I will make one and put it on the elver.org eclipse update site. Did you use the sqljdbc.jar or the sqljdbc4.jar file
from microsoft?

gr. Martin

On 05/20/2011 02:51 AM, Goetz Botterweck wrote:
> Hi Martin,
>
> On 16/05/2011 06:04, Martin Taal wrote:
>> Hi Goetz,
>> Hmm, difficult to comment on as it works fine for me. I did the same for
>> postgresql last week, created a plugin and listed it as a dependency in
>> the server plugin.
>>
>> See here for how the postgresql plugin is structured:
>> http://www.elver.org/eclipse/update
>>
>> I can try to create the ms sql jdbc plugin myself also and list it on
>> the elver.org update site. From where did you download the jdbc driver?
> http://msdn.microsoft.com/en-us/sqlserver/aa937724
>
> I then
>
> 1) used the "File> New> Other> Plugins from existing JAR" function.
>
> 2) added the new plugin to the dependencies in the CDO hibernate server
> plugin.
>
> My MANIFEST.MF and server config are pasted below.
>
> The com.microsoft.sqlserver.jdbc plugin was create by me (from the *.jar
> downloaded).
>
> Any ideas? Thanks,
> Goetz
>
> ----- MANIFEST.MF ---------------------------------------------------
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: %pluginName
> Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server
> Bundle-Version: 4.0.0.qualifier
> Bundle-Vendor: %providerName
> Bundle-Localization: plugin
> Bundle-RequiredExecutionEnvironment: J2SE-1.5
> Eclipse-RegisterBuddy: org.eclipse.emf.cdo.server.hibernate,
> org.eclipse.emf.cdo.server.hibernate.teneo
> Require-Bundle:
> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)",
> org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
> org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
> org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
> com.microsoft.sqlserver.jdbc;bundle-version="3.0.0"
> Import-Package:
> org.eclipse.emf.teneo.annotations.mapper;version="[1.1.2,2.0.0)",
> org.eclipse.emf.teneo.annotations.pamodel;version="[1.1.2,2.0.0)",
> org.eclipse.emf.teneo.annotations.pannotation;version="[1.1.2,2.0.0)",
> org.eclipse.emf.cdo.server.hibernate.internal.teneo;version="[3.0.0,4.0.0)",
> org.hibernate.engine;version="[3.3.2,4.0.0)",
> org.hibernate.id;version="[3.3.2,4.0.0)",
> org.hibernate.persister.entity;version="[3.3.2,4.0.0)"
> Export-Package: com.microsoft.sqlserver.jdbc,
> microsoft.sql,
> org.eclipse.emf.cdo.examples.hibernate.server;version="4.0.0"
> Bundle-ClassPath: .,
> lib/sqljdbc4.jar
>
> --- cdo-server.xml (extract) ----------------------
> <property name="hibernate.dialect"
> value="org.hibernate.dialect.SQLServerDialect"/>
>
> <property name="hibernate.connection.driver_class"
> value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>
> <property name="hibernate.connection.url"
> value="jdbc:sqlserver://INSERTSERVERNAMEHERE:1433;databaseName=INSERTDATABASEHERE;"/>
>
> <property name="hibernate.connection.username" value="INSERTUSERNAMEHERE"/>
>
> <property name="hibernate.connection.password" value="INSERTPASSWORDHERE"/>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686985 is a reply to message #686808] Thu, 19 May 2011 16:23 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I see now that jdbc4.jar is for java 6, I will use that one.

gr. Martin

On 05/20/2011 03:22 AM, Martin Taal wrote:
> Hi Goetz,
> Afaics you don't need all the teneo dependencies or hibernate dependencies.
>
> I will make one and put it on the elver.org eclipse update site. Did you use the sqljdbc.jar or the sqljdbc4.jar file
> from microsoft?
>
> gr. Martin
>
> On 05/20/2011 02:51 AM, Goetz Botterweck wrote:
>> Hi Martin,
>>
>> On 16/05/2011 06:04, Martin Taal wrote:
>>> Hi Goetz,
>>> Hmm, difficult to comment on as it works fine for me. I did the same for
>>> postgresql last week, created a plugin and listed it as a dependency in
>>> the server plugin.
>>>
>>> See here for how the postgresql plugin is structured:
>>> http://www.elver.org/eclipse/update
>>>
>>> I can try to create the ms sql jdbc plugin myself also and list it on
>>> the elver.org update site. From where did you download the jdbc driver?
>> http://msdn.microsoft.com/en-us/sqlserver/aa937724
>>
>> I then
>>
>> 1) used the "File> New> Other> Plugins from existing JAR" function.
>>
>> 2) added the new plugin to the dependencies in the CDO hibernate server
>> plugin.
>>
>> My MANIFEST.MF and server config are pasted below.
>>
>> The com.microsoft.sqlserver.jdbc plugin was create by me (from the *.jar
>> downloaded).
>>
>> Any ideas? Thanks,
>> Goetz
>>
>> ----- MANIFEST.MF ---------------------------------------------------
>> Manifest-Version: 1.0
>> Bundle-ManifestVersion: 2
>> Bundle-Name: %pluginName
>> Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server
>> Bundle-Version: 4.0.0.qualifier
>> Bundle-Vendor: %providerName
>> Bundle-Localization: plugin
>> Bundle-RequiredExecutionEnvironment: J2SE-1.5
>> Eclipse-RegisterBuddy: org.eclipse.emf.cdo.server.hibernate,
>> org.eclipse.emf.cdo.server.hibernate.teneo
>> Require-Bundle:
>> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)",
>> org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
>> org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
>> org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
>> com.microsoft.sqlserver.jdbc;bundle-version="3.0.0"
>> Import-Package:
>> org.eclipse.emf.teneo.annotations.mapper;version="[1.1.2,2.0.0)",
>> org.eclipse.emf.teneo.annotations.pamodel;version="[1.1.2,2.0.0)",
>> org.eclipse.emf.teneo.annotations.pannotation;version="[1.1.2,2.0.0)",
>> org.eclipse.emf.cdo.server.hibernate.internal.teneo;version="[3.0.0,4.0.0)",
>> org.hibernate.engine;version="[3.3.2,4.0.0)",
>> org.hibernate.id;version="[3.3.2,4.0.0)",
>> org.hibernate.persister.entity;version="[3.3.2,4.0.0)"
>> Export-Package: com.microsoft.sqlserver.jdbc,
>> microsoft.sql,
>> org.eclipse.emf.cdo.examples.hibernate.server;version="4.0.0"
>> Bundle-ClassPath: .,
>> lib/sqljdbc4.jar
>>
>> --- cdo-server.xml (extract) ----------------------
>> <property name="hibernate.dialect"
>> value="org.hibernate.dialect.SQLServerDialect"/>
>>
>> <property name="hibernate.connection.driver_class"
>> value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>>
>> <property name="hibernate.connection.url"
>> value="jdbc:sqlserver://INSERTSERVERNAMEHERE:1433;databaseName=INSERTDATABASEHERE;"/>
>>
>> <property name="hibernate.connection.username" value="INSERTUSERNAMEHERE"/>
>>
>> <property name="hibernate.connection.password" value="INSERTPASSWORDHERE"/>
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #686986 is a reply to message #686809] Thu, 19 May 2011 16:55 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I published a ms jdbc driver on elver.org/eclipse/update. Can you try it?

gr. Martin

On 05/20/2011 03:23 AM, Martin Taal wrote:
> I see now that jdbc4.jar is for java 6, I will use that one.
>
> gr. Martin
>
> On 05/20/2011 03:22 AM, Martin Taal wrote:
>> Hi Goetz,
>> Afaics you don't need all the teneo dependencies or hibernate dependencies.
>>
>> I will make one and put it on the elver.org eclipse update site. Did you use the sqljdbc.jar or the sqljdbc4.jar file
>> from microsoft?
>>
>> gr. Martin
>>
>> On 05/20/2011 02:51 AM, Goetz Botterweck wrote:
>>> Hi Martin,
>>>
>>> On 16/05/2011 06:04, Martin Taal wrote:
>>>> Hi Goetz,
>>>> Hmm, difficult to comment on as it works fine for me. I did the same for
>>>> postgresql last week, created a plugin and listed it as a dependency in
>>>> the server plugin.
>>>>
>>>> See here for how the postgresql plugin is structured:
>>>> http://www.elver.org/eclipse/update
>>>>
>>>> I can try to create the ms sql jdbc plugin myself also and list it on
>>>> the elver.org update site. From where did you download the jdbc driver?
>>> http://msdn.microsoft.com/en-us/sqlserver/aa937724
>>>
>>> I then
>>>
>>> 1) used the "File> New> Other> Plugins from existing JAR" function.
>>>
>>> 2) added the new plugin to the dependencies in the CDO hibernate server
>>> plugin.
>>>
>>> My MANIFEST.MF and server config are pasted below.
>>>
>>> The com.microsoft.sqlserver.jdbc plugin was create by me (from the *.jar
>>> downloaded).
>>>
>>> Any ideas? Thanks,
>>> Goetz
>>>
>>> ----- MANIFEST.MF ---------------------------------------------------
>>> Manifest-Version: 1.0
>>> Bundle-ManifestVersion: 2
>>> Bundle-Name: %pluginName
>>> Bundle-SymbolicName: org.eclipse.emf.cdo.examples.hibernate.server
>>> Bundle-Version: 4.0.0.qualifier
>>> Bundle-Vendor: %providerName
>>> Bundle-Localization: plugin
>>> Bundle-RequiredExecutionEnvironment: J2SE-1.5
>>> Eclipse-RegisterBuddy: org.eclipse.emf.cdo.server.hibernate,
>>> org.eclipse.emf.cdo.server.hibernate.teneo
>>> Require-Bundle:
>>> org.eclipse.emf.cdo.server.hibernate.teneo;bundle-version="[3.0.0,4.0.0)",
>>> org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
>>> org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)",
>>> org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)",
>>> com.microsoft.sqlserver.jdbc;bundle-version="3.0.0"
>>> Import-Package:
>>> org.eclipse.emf.teneo.annotations.mapper;version="[1.1.2,2.0.0)",
>>> org.eclipse.emf.teneo.annotations.pamodel;version="[1.1.2,2.0.0)",
>>> org.eclipse.emf.teneo.annotations.pannotation;version="[1.1.2,2.0.0)",
>>> org.eclipse.emf.cdo.server.hibernate.internal.teneo;version="[3.0.0,4.0.0)",
>>> org.hibernate.engine;version="[3.3.2,4.0.0)",
>>> org.hibernate.id;version="[3.3.2,4.0.0)",
>>> org.hibernate.persister.entity;version="[3.3.2,4.0.0)"
>>> Export-Package: com.microsoft.sqlserver.jdbc,
>>> microsoft.sql,
>>> org.eclipse.emf.cdo.examples.hibernate.server;version="4.0.0"
>>> Bundle-ClassPath: .,
>>> lib/sqljdbc4.jar
>>>
>>> --- cdo-server.xml (extract) ----------------------
>>> <property name="hibernate.dialect"
>>> value="org.hibernate.dialect.SQLServerDialect"/>
>>>
>>> <property name="hibernate.connection.driver_class"
>>> value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>>>
>>> <property name="hibernate.connection.url"
>>> value="jdbc:sqlserver://INSERTSERVERNAMEHERE:1433;databaseName=INSERTDATABASEHERE;"/>
>>>
>>> <property name="hibernate.connection.username" value="INSERTUSERNAMEHERE"/>
>>>
>>> <property name="hibernate.connection.password" value="INSERTPASSWORDHERE"/>
>>>
>>
>>
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
Re: [CDO] Hibernate Server - Trying to integrate additional JDBC drivers -&gt; ClassNotFoundExce [message #687016 is a reply to message #686810] Sun, 22 May 2011 20:00 Go to previous message
Goetz Botterweck is currently offline Goetz BotterweckFriend
Messages: 71
Registered: July 2009
Member
On 19/05/2011 06:55, Martin Taal wrote:
> I published a ms jdbc driver on elver.org/eclipse/update. Can you try it?

Hi Martin, this seems to be working. Thanks! I document my steps below
so that maybe others can reproduce them.


NOTES
A remark about the link between launch config and cdo-server.xml. This
can be a bit tricky. The launch configuration in
CDOHibernateServer.launch does NOT refer to the cdo-server.xml in the
CURRENT project. Instead it uses VM Arguments to refer to a fixed path
/org.eclipse.emf.cdo.examples.hibernate.server/config/cdo-server.xml. =>
During analysis of the problem with the ClassNotFound exception, I was
experimenting with some settings in cdo-server.xml seemed to have no
effect. That was because I was editing a file that was not used at all.

HOWTO
Here the summary of my steps:

- In SQL Server create a database and corresponding login

- Install Microsoft SQL Server JDBC driver via Help > Install
additional software, work with = http://elver.org/eclipse/update/

- Check out org.eclipse.emf.cdo.examples.hibernate.server from
http://dev.eclipse.org/svnroot/modeling/org.eclipse.emf.cdo/trunk/plugins/org.eclipse.emf.cdo.examples.hibernate.server


OPTIONALLY: TEST WITH HSQLDB
- Run CDOHibernateServer.launch (no changes to cdo-server.xml yet, this
will use hsqldb) --> server should start OK

- Run tests in HibernateQueryTest in
org.eclipse.emf.cdo.examples.hibernate.client (Right click > Run As >
JUnit test)
See
/org.eclipse.emf.cdo.examples.hibernate.client/src/org/eclipse/emf/cdo/examples/hibernate/client/HibernateQueryTest.java
--> all tests should be successful

- Terminate CDOHibernateServer


TEST WITH MICROSOFT SQL SERVER
- Switch to Microsoft SQL Server by applying the following steps
1) Add com.microsoft.sqlserver.jdbc as a dependency to MANIFEST.MF
2) Edit cdo-server.xml: comment out the „Setting for hsqldb“ section
and add the following lines as an alternative

<!-- Settings for Microsoft SQL Server -->
<property name="hibernate.dialect"
value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.connection.driver_class"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="hibernate.connection.url"
value="jdbc:sqlserver://INSERTSERVER:1433;databaseName=INSERTDATABASENAME;"/>
<property name="hibernate.connection.username" value="INSERTUSER"/>
<property name="hibernate.connection.password" value="INSERTPASSWORD"/>

- Run CDOHibernateServer.launch (with changes to cdo-server.xml, will
now use Microsoft SQL Server) --> server should start OK

- Run tests in HibernateQueryTest in
org.eclipse.emf.cdo.examples.hibernate.client (Right click > Run As >
JUnit test)
See
/org.eclipse.emf.cdo.examples.hibernate.client/src/org/eclipse/emf/cdo/examples/hibernate/client/HibernateQueryTest.java
--> all tests should be successful
Previous Topic:Using the RepositoryUserManager, querying through the StoreAccessor
Next Topic:[CDO] How to do jvm connection to the same repo as the tcp acceptor/connection
Goto Forum:
  


Current Time: Thu Apr 25 08:08:27 GMT 2024

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

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

Back to the top