本文介绍了错误context.GrailsContextLoader-初始化应用程序时出错:创建ServletContext中定义的名称为'grailsApplication'的bean时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更换了PC,然后将项目签到新PC,当我用war进行构建时,会出现此错误,但是如果我用另一台PC可以正确构建,则使用grails SDK 2.3.11.我不知道会发生什么错误.

I changed my PC, and checkout the project to the new PC, when I build with my war, it gives this error but with my another PC it builds correctly, I use grails SDK 2.3.11. I don't don't know what the error can be..

当我用旧电脑进行构建时,它可以正常工作,我仔细检查了所有配置,似乎都正确了.

when I build with my old pc it works correctly, I double checked all configuration and seems all correct.

[localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: (class: privateserver/BulkExportService$EmptyResults, method: super$1$stream signature: ()Ljava/util/stream/Stream;) Illegal use of nonvirtual function call
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.VerifyError: (class: privateserver/BulkExportService$EmptyResults, method: super$1$stream signature: ()Ljava/util/stream/Stream;) Illegal use of nonvirtual function call
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.VerifyError: (class: privateserver/BulkExportService$EmptyResults, method: super$1$stream signature: ()Ljava/util/stream/Stream;) Illegal use of nonvirtual function call
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
        at java.lang.Class.getDeclaredConstructors(Class.java:2020)
        at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
        at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
        at privateserver.BulkExportService.<clinit>(BulkExportService.groovy:198)
        at java.lang.Class.forName(Class.java:348)
        ... 5 more








<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
        <description>Grails application factory bean</description>
        <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
        <property name="grailsResourceLoader" ref="grailsResourceLoader" />
    </bean>

    <bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean">
        <description>A bean that manages Grails plugins</description>
        <property name="grailsDescriptor" value="/WEB-INF/grails.xml" />
        <property name="application" ref="grailsApplication" />
    </bean>

    <bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator">
        <constructor-arg>
            <ref bean="grailsApplication" />
        </constructor-arg>
        <property name="pluginManager" ref="pluginManager" />
    </bean>

    <bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean" />

    <bean id="characterEncodingFilter" class="org.springframework.web.filter.CharacterEncodingFilter">
        <property name="encoding">
            <value>utf-8</value>
        </property>
    </bean>

    <bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" />
</beans>

推荐答案

问题出在您的"BulkExportService"上,可能不支持Java 1.8.

The issue is on your "BulkExportService" which probably not support with java 1.8 .

这篇关于错误context.GrailsContextLoader-初始化应用程序时出错:创建ServletContext中定义的名称为'grailsApplication'的bean时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 09:00