Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 366162 - [Hibernate] CDO with hibernate cannot be used standalone due to NPE in HibernateUtil.createMappingProviderFactory
Summary: [Hibernate] CDO with hibernate cannot be used standalone due to NPE in Hibern...
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.core (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Martin Taal CLA
QA Contact: Eike Stepper CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-09 04:54 EST by Missing name Mising name CLA
Modified: 2019-11-08 03:13 EST (History)
2 users (show)

See Also:


Attachments
Stack trace (819 bytes, text/plain)
2011-12-09 04:54 EST, Missing name Mising name CLA
no flags Details
List of jar files used (901 bytes, text/plain)
2011-12-09 04:55 EST, Missing name Mising name CLA
no flags Details
config xml file (1.55 KB, text/xml)
2011-12-09 04:55 EST, Missing name Mising name CLA
no flags Details
Main java file (2.61 KB, text/x-java)
2011-12-09 04:56 EST, Missing name Mising name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name Mising name CLA 2011-12-09 04:54:27 EST
Build Identifier: 4.0.0.v20110608-1440

Attempting to run a CDO server with a hibernate store, but without an equinox environment (simple Java main class).

Having posted on the forum:

http://www.eclipse.org/forums/index.php/m/763125/#msg_763125

I cannot get any further due to the HibernateUtil.createMappingProviderFactory making a static all to get the extension registry, but in my case it is null as I'm not running inside equinox:

IExtensionRegistry registry = Platform.getExtensionRegistry(); - Line 193

This code should work outside of Equinox. My original problem in the repositoryConfigurator was solved by manually adding the storeFactory. Possibly a similar technique could be used here to prevent HibernateStoreFactory.getMappingProvider() method going to the registry to find a mapping provider if one has already been configured, or just allowing manual addition of mapping providers and failing gracefully with a null check on the extension point code.

Reproducible: Always

Steps to Reproduce:
1. Import attached java main and supplied cdo-server.xml configuration file into an eclipse Java project
2. Use attached list of jar files in the class path
2. Run java main file
3. Observe attached stack trace.
Comment 1 Missing name Mising name CLA 2011-12-09 04:54:58 EST
Created attachment 208150 [details]
Stack trace
Comment 2 Missing name Mising name CLA 2011-12-09 04:55:18 EST
Created attachment 208151 [details]
List of jar files used
Comment 3 Missing name Mising name CLA 2011-12-09 04:55:47 EST
Created attachment 208152 [details]
config xml file
Comment 4 Missing name Mising name CLA 2011-12-09 04:56:03 EST
Created attachment 208153 [details]
Main java file
Comment 5 Martin Taal CLA 2011-12-13 13:32:30 EST
Solved in 4.0, use the static:
HibernateUtil.setMappingProviderFactoryInstance(new TeneoHibernateMappingProviderFactory());

call to set a mapping provider.
Comment 6 Eike Stepper CLA 2012-09-21 06:50:32 EDT
Closing.