dwr 整合时报错

前端之家收集整理的这篇文章主要介绍了dwr 整合时报错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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-INF\lib目录下就可以了。

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; }

猜你在找的Ajax相关文章