java - 将 Grails (2.2.4) 应用程序从 JBoss 5.1 迁移到 Wildfly 8.2.1
问题描述
我是 grails 新手,正在尝试将 Grails (2.2.4) 应用程序(在 jdk 1.6 上)从 JBOSS 5.1 迁移到 Wildfly 8.2.1 服务器。由于 wildfly 采用默认的类加载器,我在 jboss-web.xml 中注释掉了类加载标签。在此之后,我做了以下步骤。
- 运行命令:grails test war。
- 在 Wildfly 8.2.1 上部署
部署失败并出现错误:
ERROR [StackTrace] (MSC service thread 1-5) Full Stack Trace:: org.springframework.beans.factory.BeanCreationException: **Error creating bean with name 'pluginManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: ** Invocation of init method failed; nested exception is java.lang.NullPointerException: Cannot invoke method getAt() on null object
ApplicationContext.xml 如下所示:
<?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-2.5.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>
</beans>
根据其他帖子中给出的建议,我尝试在删除“grailsResourceLoader”bean(因为它已被弃用)及其参考后进行部署,但仍然出现同样的问题。我使用 jdk 1.6 和 1.7 进行应用,但没有用。
需要更改配置才能在 wildfly 8.2.1 上运行的任何其他文件?任何想法可能是什么问题?谢谢。
解决方案
能够通过将项目的 jdk 版本更改为 1.7 以及 Wildfly 8.2.1 来部署战争
推荐阅读
- spring-boot - 编写 Spring Boot 应用程序的实时场景
- webpack - 构建后用于电子的外部 webpack 模块不起作用
- javascript - 将承诺转换为等待/异步
- c++ - 如果我使用 malloc() 而不是堆栈数组,OpenGL 不会渲染对象?
- javascript - 有什么方法可以改变 Slick carousel 中从左到右的方向吗?默认它是从右到左的方向
- python - OpenCV AttributeError 模块“cv2.cv2”没有属性“Tracker_create”
- matlab - 将交叉功能从 R2019a 更改为 R2019b
- reactjs - 从一个 redux-saga 调用两种不同的动作类型
- python-3.x - 性能问题:查找 python 字典的子值,如果它匹配另一个值
- python - 我收到此错误。我无法解决此问题