Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClassNotFoundException: org.hibernate.event.spi.PreLoadEventListener

Tags:

grails

When I try to run my Grails 2.4.1 app, I get the following exception, which I don't really understand.

| Running Grails application
objc[15346]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
| Error 2014-06-19 16:54:40,048 [localhost-startStop-1] ERROR context.GrailsContextLoaderListener  - Error initializing the application: org/hibernate/event/spi/PreLoadEventListener
Message: org/hibernate/event/spi/PreLoadEventListener
    Line | Method
->>  800 | defineClass               in java.lang.ClassLoader
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    142 | defineClass               in java.security.SecureClassLoader
|    449 | defineClass . . . . . . . in java.net.URLClassLoader
|     71 | access$100                in     ''
|    361 | run . . . . . . . . . . . in java.net.URLClassLoader$1
|    355 | run                       in     ''
|    354 | findClass . . . . . . . . in java.net.URLClassLoader
|    425 | loadClass                 in java.lang.ClassLoader
|     94 | doCall . . . . . . . . .  in grails.plugin.hibernate4.HibernatePluginSupport$__clinit__closure1
|    754 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
|    584 | beans . . . . . . . . . . in     ''
|    527 | invokeMethod              in     ''
|    262 | run . . . . . . . . . . . in java.util.concurrent.FutureTask
|   1145 | runWorker                 in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    744 | run                       in java.lang.Thread
Caused by ClassNotFoundException: org.hibernate.event.spi.PreLoadEventListener
->>  366 | run                       in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    355 | run                       in     ''
|    354 | findClass . . . . . . . . in java.net.URLClassLoader
|    425 | loadClass                 in java.lang.ClassLoader
|    800 | defineClass . . . . . . . in     ''
|    142 | defineClass               in java.security.SecureClassLoader
|    449 | defineClass . . . . . . . in java.net.URLClassLoader
|     71 | access$100                in     ''
|    361 | run . . . . . . . . . . . in java.net.URLClassLoader$1
|    355 | run                       in     ''
|    354 | findClass . . . . . . . . in java.net.URLClassLoader
|    425 | loadClass                 in java.lang.ClassLoader
|     94 | doCall . . . . . . . . .  in grails.plugin.hibernate4.HibernatePluginSupport$__clinit__closure1
|    754 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
|    584 | beans . . . . . . . . . . in     ''
|    527 | invokeMethod              in     ''
|    262 | run . . . . . . . . . . . in java.util.concurrent.FutureTask
|   1145 | runWorker                 in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    744 | run                       in java.lang.Thread
| Error Forked Grails VM exited with error

Note that I don't have any complex code in my app so far, just a few domain classes reverse-engineered from an existing database using db-reverse-engineer plugin.

like image 311
Sebastien Avatar asked Jun 19 '14 14:06

Sebastien


1 Answers

I imagine the error is coming from the db-reverse-engineer plugin which may rely on classes from Hibernate 3 whilst Grails 2.4 by default uses Hibernate 4. Try downgrade the Hibernate 3 plugin or remove the db-reverse-engineer plugin if you no longer need it

like image 175
Graeme Rocher Avatar answered Nov 09 '22 18:11

Graeme Rocher