项目使用resin容器,发现resin容器启动时不加载listener,而需要在应用被首次访问时才会加载listener,完成bean的实例化,这样会导致服务重启后第一次的请求需要更长的时间来完成。
为什么?找啊找。网上的资料都说这个加载的顺序是。。。??
我们的resin.conf的虚拟主机配置
项目使用resin容器,发现resin容器启动时不加载listener,而需要在应用被首次访问时才会加载listener,完成bean的实例化,这样会导致服务重启后第一次的请求需要更长的时间来完成。 <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.conf的虚拟主机配置
修改成
发现这样的配置下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,不能一对一的确定相应工程的配置文件?
有知道的牛们解释下哈^_^
免责声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,也不承认相关法律责任。如果您发现本社区中有涉嫌抄袭的内容,请发送邮件至:operations@xinnet.com进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。