无情 @ 2014-12-15 19:24:59 阅读(1782)
jboss 热部署


最近一段时间linux系统运行一段时间后会出现,系统重启后后恢复正常.


2014-12-15 13:30:32,414 INFO  [STDOUT] ERROR - ResourceManager : unable to find resource '/admin/screen/login.vm' in any resource loader.
2014-12-15 13:30:32,415 ERROR [STDERR] Unable to find resource '/admin/screen/login.vm'
2014-12-15 13:30:32,416 INFO  [STDOUT] ERROR - error 
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource '/admin/screen/login.vm'
	at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:452)
	at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
	at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
	at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1077)
	at org.apache.velocity.app.VelocityEngine.getTemplate(VelocityEngine.java:528)
	at org.springframework.web.servlet.view.velocity.VelocityView.getTemplate(VelocityView.java:499)
	at org.springframework.web.servlet.view.velocity.VelocityView.getTemplate(VelocityView.java:484)
	at org.springframework.web.servlet.view.velocity.VelocityView.doRender(VelocityView.java:462)
	at org.springframework.web.servlet.view.velocity.VelocityView.renderMergedTemplateModel(VelocityView.java:291)
	at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:167)
	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:263)
	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1208)
	at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:992)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:939)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Thread.java:745)


那么究竟是什么原因找不到文件呢! 明明工程项目都是存在的!


1:文件找不了 我第一想到的是 jboss 下面的/server/default/tmp 是否存在该工程目录。经过查询改目下本没有生成,重启后有没有生成。那么到底临时目前去那里了。我又在linux的tmp看到了 0-ROOT  这个目录里面就是工程的临时文件。


2:linux的tmp每隔一段时间就会被清除。 在  /etc/cron.daily/tmpwatch可以查看到更新的周期


3:那么是什么导致了jboss的临时文件生成在了linux的tmp下  经过查询是


    修改jboss的配置文件server/default/deploy/jboss-web.deployer/context.xml

     在Context元素中添加antiResourceLocking="true" 和  antiJARLocking="true" 属性

上面就是修改热部署的,从而也导致了 jboss的tmp生产到了系统的目录下  去掉即可。


究竟原理有待研究