[
https://issues.jboss.org/browse/JBIDE-10497?page=com.atlassian.jira.plugi...
]
Juergen Zimmermann commented on JBIDE-10497:
--------------------------------------------
I just realized the comment about buildSessionFactory. I used this code (and get the
stacktrace below);
Properties props = new Properties();
try (InputStream inputStream = new
FileInputStream("C:/path/to/hibernate.console.properties")) {
props.load(inputStream);
}
catch (IOException e) {
throw new RuntimeException(e);
}
Configuration config = new Configuration();
config = config.addProperties(props);
//config = config.configure(); // no hibernate.cfg.xml, but only persistence.xml
SessionFactory sessionFactory = config.buildSessionFactory();
Stacktrace (probabely due to persistence.xml instead of hibernate.cfg.xml):
Dez 28, 2011 6:54:53 AM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Dez 28, 2011 6:54:53 AM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.0.0.Final}
Dez 28, 2011 6:54:53 AM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
Dez 28, 2011 6:54:53 AM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Dez 28, 2011 6:54:53 AM
org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator
initiateService
WARN: HHH000181: No appropriate connection provider encountered, assuming application will
be supplying connections
Exception in thread "main" org.hibernate.HibernateException: Connection cannot
be null when 'hibernate.dialect' not set
at
org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:97)
at
org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:67)
at
org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:170)
at
org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:75)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:159)
at
org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:131)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:71)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2270)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2266)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1735)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1775)
at testcase.Testcase.main(Testcase.java:26)
"could not instantiate RegionFactory" due to CNFE
-------------------------------------------------
Key: JBIDE-10497
URL:
https://issues.jboss.org/browse/JBIDE-10497
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: hibernate
Affects Versions: 3.3.0.M4, 3.3.0.M5
Reporter: Juergen Zimmermann
Assignee: Dmitry Geraskov
Fix For: 3.3.0.Beta1
I upgraded from M4 to M5a using
http://download.jboss.org/jbosstools/builds/development/3.3.0.M5a.core/20....
When opening the "Session Factory" in the Hibernate Console I get the following
stacktrace:
!ENTRY org.hibernate.eclipse.console 4 4 2011-12-16 10:24:32.898
!MESSAGE Problems while creating sessionfactory
!SUBENTRY 1 org.hibernate.eclipse.console 4 150 2011-12-16 10:24:32.898
!MESSAGE org.hibernate.HibernateException: could not instantiate RegionFactory []
!STACK 0
org.hibernate.HibernateException: could not instantiate RegionFactory []
at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:432)
at
org.hibernate.cfg.AnnotationBinder.determineCacheConcurrencyStrategy(AnnotationBinder.java:1039)
at org.hibernate.cfg.AnnotationBinder.buildCacheMock(AnnotationBinder.java:1009)
at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:966)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:576)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3395)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3349)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1323)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1713)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0$1.execute(HibernateExtension4_0.java:143)
at
org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0.execute(HibernateExtension4_0.java:248)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0.buildSessionFactory(HibernateExtension4_0.java:135)
at
org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:273)
at
org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:43)
at
org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100)
at
org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
at
org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:192)
at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:417)
... 18 more
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2011-12-16 10:24:32.898
!MESSAGE org.hibernate.HibernateException: could not instantiate RegionFactory []
!STACK 0
org.hibernate.HibernateException: could not instantiate RegionFactory []
at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:432)
at
org.hibernate.cfg.AnnotationBinder.determineCacheConcurrencyStrategy(AnnotationBinder.java:1039)
at org.hibernate.cfg.AnnotationBinder.buildCacheMock(AnnotationBinder.java:1009)
at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:966)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:576)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3395)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3349)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1323)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1713)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0$1.execute(HibernateExtension4_0.java:143)
at
org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0.execute(HibernateExtension4_0.java:248)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0.buildSessionFactory(HibernateExtension4_0.java:135)
at
org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:273)
at
org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:43)
at
org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100)
at
org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
at
org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:192)
at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:417)
... 18 more
!SUBENTRY 2 org.hibernate.eclipse.console 4 150 2011-12-16 10:24:32.898
!MESSAGE java.lang.ClassNotFoundException:
!STACK 0
java.lang.ClassNotFoundException:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at org.hibernate.internal.util.ReflectHelper.classForName(ReflectHelper.java:192)
at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:417)
at
org.hibernate.cfg.AnnotationBinder.determineCacheConcurrencyStrategy(AnnotationBinder.java:1039)
at org.hibernate.cfg.AnnotationBinder.buildCacheMock(AnnotationBinder.java:1009)
at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:966)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:576)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3395)
at
org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3349)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1323)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1713)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0$1.execute(HibernateExtension4_0.java:143)
at
org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0.execute(HibernateExtension4_0.java:248)
at
org.jboss.tools.hibernate4_0.HibernateExtension4_0.buildSessionFactory(HibernateExtension4_0.java:135)
at
org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:273)
at
org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:43)
at
org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100)
at
org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
at
org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira