加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

dwr 整合时报错

发布时间:2020-12-16 01:33:06 所属栏目:百科 来源:网络整理
导读:java.lang.NumberFormatException: null at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at org.directwebremoting.util.VersionUtil.loadProperties(VersionUtil.java:119) 看了下源代码,会读取dwr-versio

java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at org.directwebremoting.util.VersionUtil.loadProperties(VersionUtil.java:119)

看了下源代码,会读取dwr-version.properties文件,这个在dwr.jar中。

使用eclipse,原来是因为没有把这个jar放到lib目录下,放到WEB-INFlib目录下就可以了。

InputStream in = LocalUtil.getInternalResourceAsStream("/dwr-version.properties");
Properties props = new Properties();
props.load(in);

major = Integer.parseInt(props.getProperty("major"));
minor = Integer.parseInt(props.getProperty("minor"));
revision = Integer.parseInt(props.getProperty("revision"));
String buildString = props.getProperty("bamboo.build.number");
if ((null != buildString) && (buildString.length() > 0))
build = Integer.parseInt(props.getProperty("bamboo.build.number"));

title = props.getProperty("title");

if (title.length() == 0) { label = major + "." + minor + "." + revision; } else if (build > -1) { label = major + "." + minor + "." + revision + "-" + title + "-" + build; } else { label = major + "." + minor + "." + revision + "-" + title; }

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读