springmvc问题,在linux上部署出现的BeanCreationException问题,求指点

J2EE 码拜 8年前 (2016-03-20) 1372次浏览
在windows上部署没问题,但是放到linux就报错
springmvc问题,在linux上部署出现的BeanCreationException问题,求指点
springmvc.xml配置文件

<!-- 智能表单配置引入 -->
	<import resource="classpath*:org/jeecgframework/web/cgform/common/spring-mvc-cgform.xml" />

spring-mvc-cgform.xml配置文件

<!-- FreeMarker -->
	<bean id="freemarker" class="freemarker.template.Configuration">
		<property name="templateLoader" ref="templetLoader" />
		<property name="defaultEncoding" value="UTF-8"></property>
		<property name="numberFormat" value="0"></property>
	</bean>

	<!-- update begin  online代码生成器支持 自定义word改造 -->
	<!-- FreeMarker 自定义word代码生成器 -->
	<bean id="freemarkerWord" class="freemarker.template.Configuration">
		<property name="templateLoader" ref="templetLoaderWord" />
		<property name="defaultEncoding" value="UTF-8"></property>
		<property name="numberFormat" value="0"></property>
	</bean>
	<!-- Template Context 自定义word代码生成器 -->
	<bean id="templetContextWord" class="org.jeecgframework.web.cgform.service.impl.generate.TempletContextWord">
		<property name="tags">
			<map>
				<entry key="DictData" value-ref="dictDataTag" />
			</map>
		</property>
	</bean>
	<!-- update end  online代码生成器支持 自定义word改造 -->

	<!-- Template Context -->
	<bean id="templetContext" class="org.jeecgframework.web.cgform.engine.TempletContext">
		<property name="tags">
			<map>
				<entry key="DictData" value-ref="dictDataTag" />
			</map>
		</property>
	</bean><!-- 拦截器 -->
	<mvc:interceptors>
		<!-- 表单配置更新后增加版本号 -->
		<mvc:interceptor>
			<mvc:mapping path="/**" />
			<bean
				class="org.jeecgframework.web.cgform.interceptors.CgFormVersionInterceptor">
				<property name="includeUrls">
					<list>
						<value>cgformButtonController.do?save</value>
					</list>
				</property>
			</bean>
		</mvc:interceptor>
	</mvc:interceptors>

TempletContextWord类
springmvc问题,在linux上部署出现的BeanCreationException问题,求指点

解决方案

30

从错误栈看是TempletContextWord类的static{}块代码出错,进一步定位分析,可能的原因是EhCache读取配置文件出错,例如文件权限、xml编码格式(通常Windows默认带上BOM)等等都会导致读取xml配置出错。
题主可以在static块中try…cache一下,打印错误消息看看。

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明springmvc问题,在linux上部署出现的BeanCreationException问题,求指点
喜欢 (0)
[1034331897@qq.com]
分享 (0)