ClassNotFoundException:org.hibernate.event.spi.PreLoadEventListener

时间:2014-06-19 14:56:58

标签: grails

当我尝试运行我的Grails 2.4.1应用程序时,我得到以下异常,我不太了解。

| 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

请注意,到目前为止,我的应用程序中没有任何复杂的代码,只有一些域类使用db-reverse-engineer插件从现有数据库进行逆向工程。

1 个答案:

答案 0 :(得分:9)

我想错误来自db-reverse-engineer插件,它可能依赖于来自Hibernate 3的类,而Grails 2.4默认使用Hibernate 4.尝试降级Hibernate 3插件或删除db-reverse-engineer插件你不再需要它