`
fancyboy2050
  • 浏览: 238809 次
  • 性别: Icon_minigender_1
  • 来自: 皇城根儿下
社区版块
存档分类
最新评论

resin容器配置影响listener加载时机

    博客分类:
  • java
阅读更多
项目使用resin容器,发现resin容器启动时不加载listener,而需要在应用被首次访问时才会加载listener,完成bean的实例化,这样会导致服务重启后第一次的请求需要更长的时间来完成。

为什么?找啊找。网上的资料都说这个加载的顺序是。。。??

我们的resin.conf的虚拟主机配置
<host regexp='*\.*\.com' root-directory="/data/resin/">
       <character-encoding>utf-8</character-encoding>
       <web-app id='/' document-directory='*'>
       </web-app>
</host>


修改成
<host id='*.*.com' root-directory="/data/resin/">
       <character-encoding>utf-8</character-encoding>
       <web-app id='/' document-directory='*'>
       </web-app>
</host>

发现这样的配置下resin容器启动时会加载listener了,当然启动的时间也相应的长了些!

关于host的配置:

Defines a virtual host. If no hosts are specified, or if a request doesn't match a host, configuration in http-server will be used instead.
The id may contain a list of hosts. Any host in the list will match.
See application configuration for servlet configuration.
Hosts can use regexp instead of id to dynamically create new hosts.

不确定原因?难道是动态主机的设置下resin不会加载listener,不能一对一的确定相应工程的配置文件?

有知道的牛们解释下哈^_^
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics