博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
resin容器配置影响listener加载时机
阅读量:7165 次
发布时间:2019-06-29

本文共 785 字,大约阅读时间需要 2 分钟。

hot3.png

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

为什么?找啊找。网上的资料都说这个加载的顺序是。。。??
我们的resin.conf的虚拟主机配置

utf-8

 

修改成

 

 

utf-8

发现这样的配置下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,不能一对一的确定相应工程的配置文件?
有知道的牛们解释下哈^_^

 

转载于:https://my.oschina.net/dreamnight/blog/695064

你可能感兴趣的文章