[jbosstools-issues] [JBoss JIRA] (JBIDE-15577) Hibernate Console problem while creating session factory

Luke Maurer (JIRA) issues at jboss.org
Sun Aug 24 02:27:00 EDT 2014


    [ https://issues.jboss.org/browse/JBIDE-15577?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12995253#comment-12995253 ] 

Luke Maurer edited comment on JBIDE-15577 at 8/24/14 2:26 AM:
--------------------------------------------------------------

I'm having the same problem, only it doesn't go away if I add the C3P0 properties to the hibernate.cfg.xml. When I go to the Hibernate Configurations tab, I can expand the configuration to see the Configuration, Session Factory, and Database nodes, but expanding either Session Factory or Database gives me the NoSuchMethodError. I'm using MySQL, with H2 for tests, and Tomcat 7. I've tried different versions of the Hibernate Tools, including (according to the Installation Details window) 3.7.1 final and 3.8.0 beta 2 and beta 3. I'm running Eclipse Luna (4.4.0).

I started a Dynamic Web Project from scratch and added a single entity class, then copied the Hibernate 4.1.12 jars from the distribution (required/*, optional/ehcache/*, and optional/c3p0/*) into WEB-INF/lib and created a hibernate.cfg.xml. If I don't configure c3p0 or ehcache, the Session Factory opens happily; otherwise I get a NoSuchMethodError about Logger.getMessageLogger. (Hibernate 4.1.12 includes jboss-logging-3.1.0.GA.jar; looking inside, I find it does in fact have the method that's allegedly missing. I don't know where a conflicting jar might be living.) This minimal setup used H2, not MySQL.


was (Author: luke.maurer):
I'm having the same problem, only it doesn't go away if I add the C3P0 properties to the hibernate.cfg.xml. When I go to the Hibernate Configurations tab, I can expand the configuration to see the Configuration, Session Factory, and Database nodes, but expanding either Session Factory or Database gives me the NoSuchMethodError. I'm using MySQL and Tomcat 7. I've tried different versions of the Hibernate Tools, including (according to the Installation Details window) 3.7.1 final and 3.8.0 beta 2 and beta 3. I'm running Eclipse Luna (4.4.0).

I started a Dynamic Web Project from scratch and added a single entity class, then copied the Hibernate 4.1.12 jars from the distribution (required/*, optional/ehcache/*, and optional/c3p0/*) into WEB-INF/lib and created a hibernate.cfg.xml. If I don't configure c3p0 or ehcache, the Session Factory opens happily; otherwise I get a NoSuchMethodError about Logger.getMessageLogger. (Hibernate 4.1.12 includes jboss-logging-3.1.0.GA.jar; looking inside, I find it does in fact have the method that's allegedly missing. I don't know where a conflicting jar might be living.)

> Hibernate Console problem while creating session factory
> --------------------------------------------------------
>
>                 Key: JBIDE-15577
>                 URL: https://issues.jboss.org/browse/JBIDE-15577
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: hibernate
>    Affects Versions: 4.2.x
>         Environment: Eclipse 4.3 (kepler), hibernate tools 3.7.0, Hibernate 4.2.2, jdk1.6.0.38
>            Reporter: Guillaume JOUVELOT
>            Assignee: Koen Aers
>             Fix For: 4.2.x
>
>
> When I try to use hibernate console in order to test HQL queries I've the following error message from eclipse :
> {color:red}java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;{color}
> And the eclipse log file :
> !ENTRY org.hibernate.eclipse.console 4 4 2013-09-27 15:57:20.198
> !MESSAGE Problems while creating sessionfactory
> !SUBENTRY 1 org.hibernate.eclipse.console 4 150 2013-09-27 15:57:20.198
> !MESSAGE java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
> !STACK 0
> java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
> 	at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.<clinit>(C3P0ConnectionProvider.java:58)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
> 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
> 	at java.lang.Class.newInstance0(Unknown Source)
> 	at java.lang.Class.newInstance(Unknown Source)
> 	at org.hibernate.connection.ConnectionProviderFactory.initializeConnectionProviderFromConfig(ConnectionProviderFactory.java:174)
> 	at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:102)
> 	at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> 	at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:438)
> 	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> 	at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
> 	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
> 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
> 	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
> 	at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:278)
> 	at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
> 	at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
> 	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:53)
> !SUBENTRY 2 org.hibernate.eclipse.console 4 150 2013-09-27 15:57:20.198
> !MESSAGE java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
> !STACK 0
> java.lang.NoSuchMethodError: org.jboss.logging.Logger.getMessageLogger(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
> 	at org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider.<clinit>(C3P0ConnectionProvider.java:58)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
> 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
> 	at java.lang.Class.newInstance0(Unknown Source)
> 	at java.lang.Class.newInstance(Unknown Source)
> 	at org.hibernate.connection.ConnectionProviderFactory.initializeConnectionProviderFromConfig(ConnectionProviderFactory.java:174)
> 	at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:102)
> 	at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:84)
> 	at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:438)
> 	at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
> 	at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2163)
> 	at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2159)
> 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1383)
> 	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
> 	at org.hibernate.console.ConsoleConfiguration$5.execute(ConsoleConfiguration.java:278)
> 	at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63)
> 	at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107)
> 	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:53)
> I've well configured my session factory.



--
This message was sent by Atlassian JIRA
(v6.3.1#6329)


More information about the jbosstools-issues mailing list