grails项目使用maven启动时报错。

报错信息如下:

Connected to the target VM, address: '127.0.0.1:50098', transport: 'socket'
Error |
2015-12-16 09:30:57,828 [localhost-startStop-1] ERROR context.ContextLoader  - Context initialization failed
Message: tried to access method org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingletonMutex()Ljava/lang/Object; from class org.springframework.context.event.AbstractApplicationEventMulticaster
    Line | Method
->>   84 | setBeanFactory                           in org.springframework.context.event.AbstractApplicationEventMulticaster
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|     60 | <init>                                   in org.springframework.context.event.SimpleApplicationEventMulticaster
|    667 | initApplicationEventMulticaster . . . .  in org.springframework.context.support.AbstractApplicationContext
|    471 | refresh                                  in     ''
|    403 | configureAndRefreshWebApplicationContext in org.springframework.web.context.ContextLoader
|    306 | initWebApplicationContext                in     ''
|    106 | contextInitialized . . . . . . . . . . . in org.springframework.web.context.ContextLoaderListener
|   4973 | listenerStart                            in org.apache.catalina.core.StandardContext
|   5467 | startInternal . . . . . . . . . . . . .  in     ''
|    150 | start                                    in org.apache.catalina.util.LifecycleBase
|   1559 | call . . . . . . . . . . . . . . . . . . in org.apache.catalina.core.ContainerBase$StartChild
|   1549 | call                                     in     ''
|    262 | run . . . . . . . . . . . . . . . . . .  in java.util.concurrent.FutureTask
|   1145 | runWorker                                in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run                                      in java.lang.Thread
Error |
2015-12-16 09:30:57,982 [localhost-startStop-1] ERROR [localhost].[/carhotel]  - Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
Message: tried to access method org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingletonMutex()Ljava/lang/Object; from class org.springframework.context.event.AbstractApplicationEventMulticaster
    Line | Method
->>   84 | setBeanFactory                           in org.springframework.context.event.AbstractApplicationEventMulticaster
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|     60 | <init>                                   in org.springframework.context.event.SimpleApplicationEventMulticaster
|    667 | initApplicationEventMulticaster . . . .  in org.springframework.context.support.AbstractApplicationContext
|    471 | refresh                                  in     ''
|    403 | configureAndRefreshWebApplicationContext in org.springframework.web.context.ContextLoader
|    306 | initWebApplicationContext                in     ''
|    106 | contextInitialized . . . . . . . . . . . in org.springframework.web.context.ContextLoaderListener
|   4973 | listenerStart                            in org.apache.catalina.core.StandardContext
|   5467 | startInternal . . . . . . . . . . . . .  in     ''
|    150 | start                                    in org.apache.catalina.util.LifecycleBase
|   1559 | call . . . . . . . . . . . . . . . . . . in org.apache.catalina.core.ContainerBase$StartChild
|   1549 | call                                     in     ''
|    262 | run . . . . . . . . . . . . . . . . . .  in java.util.concurrent.FutureTask
|   1145 | runWorker                                in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . . . . . . . . . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run                                      in java.lang.Thread
Error |
2015-12-16 09:30:57,991 [localhost-startStop-1] ERROR core.StandardContext  - Error listenerStart
Error |
2015-12-16 09:30:57,995 [localhost-startStop-1] ERROR core.StandardContext  - Context [/myStore] startup failed due to previous errors

我是老项目集成maven,用的Grails自带的maven,在BuildingConfig.groovy中配置的,但是在项目启动时报错。

阅读 4k
1 个回答

使用grails-maven插件 开发都还是使用grails命令 只是部署的时候create-pom 就可以了

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进