处理国际化文件频繁加载导致java.net.SocketException: Too many open files的问题
This commit is contained in:
@@ -910,17 +910,17 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
Properties msgProp = new Properties();
|
||||
try {
|
||||
String language = LocaleContextHolder.getLocale().getLanguage();
|
||||
if(language.equals("zh_cn")||language.equals("zh")){
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_zh_CN.properties"));
|
||||
}else if(language.equals("ru")){
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_ru.properties"));
|
||||
}else{
|
||||
msgProp.load(Configurations.class.getResourceAsStream("/messages/message_en.properties"));
|
||||
if (language.equals("zh_cn") || language.equals("zh")) {
|
||||
msgProp=Configurations.getMsgPropZh();
|
||||
} else if (language.equals("ru")) {
|
||||
msgProp=Configurations.getMsgPropRu();
|
||||
} else {
|
||||
msgProp=Configurations.getMsgPropEn();
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
msgProp = null;
|
||||
logger.error("未知i18n消息配置文件,请确定文件是否存在!",e);
|
||||
logger.error("未知i18n消息配置文件,请确定文件是否存在!", e);
|
||||
}
|
||||
return msgProp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user