4 Replies Last post: Feb 12, 2013 12:58 AM by Miguel Guilherme  
Miguel Guilherme Newbie 5 posts since
Feb 10, 2013
Currently Being Moderated

Feb 10, 2013 9:53 PM

Hibernate Console

Hi,

I'm using IntelliJ IDEA 12 with Spring 3.2.0 and Hibernate 4.1.9 and JDK 7.0 with Jersey for a Rest project.

Everything is working fine, the thing is, I cannot use hibernate console from Intellij.

I'm not using hibernate.cfg.xml, spring is managing everything, I've added Hibernate Support and IntelliJ detected my SessionFactory and my Entity classes but I cannot use the hql editor.

This is really important to me because I'm trying to change to Intellij.

Some times it gives-me:

 

java.lang.ClassNotFoundException: org.apache.log4j.Level

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:423)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)

at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:107)

at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:295)

at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)

at org.jboss.logging.Slf4jLoggerProvider.getLogger(Slf4jLoggerProvider.java:33)

at org.jboss.logging.LoggerProviders.find(LoggerProviders.java:37)

at org.jboss.logging.LoggerProviders.<clinit>(LoggerProviders.java:32)

at org.jboss.logging.Logger.getLogger(Logger.java:2163)

at org.jboss.logging.Logger.getMessageLogger(Logger.java:2259)

at org.jboss.logging.Logger.getMessageLogger(Logger.java:2214)

at org.hibernate.cfg.Configuration.<clinit>(Configuration.java:176)

at com.intellij.hibernate.console4.remote.HibernateFacadeImpl.createConfiguration(HibernateFacadeImpl.java:20)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)

at sun.rmi.transport.Transport$1.run(Transport.java:177)

at sun.rmi.transport.Transport$1.run(Transport.java:174)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:173)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

 

When I try again it gives me this:

 

 

java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.cfg.AnnotationConfiguration

at com.intellij.hibernate.console4.remote.HibernateFacadeImpl.createConfiguration(HibernateFacadeImpl.java:20)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:601)

at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)

at sun.rmi.transport.Transport$1.run(Transport.java:177)

at sun.rmi.transport.Transport$1.run(Transport.java:174)

at java.security.AccessController.doPrivileged(Native Method)

at sun.rmi.transport.Transport.serviceCall(Transport.java:173)

at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)

at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)

at java.lang.Thread.run(Thread.java:722)

 

Thanks.

Richard Osbaldeston Novice 253 posts since
Aug 21, 2002
Currently Being Moderated
Feb 11, 2013 5:22 PM in response to: Miguel Guilherme
Re: Hibernate Console

That simply looks like you're missing Apache log4j from the project classpath.

 

But this might just be obsurring an underlying issue such as: IDEA-78953

More Like This

  • Retrieving data ...