Forum: Installation

Post: SystemStatsCollector getting NumberFormatException

SystemStatsCollector getting NumberFormatException
khronnuz
Feb 19, 2011
Hello, I just tried voltdb ( the java hello world). This exception appears on console:


Exception in thread "Thread-16" java.lang.NumberFormatException: For input string: "2,8"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
at java.lang.Double.valueOf(Double.java:475)
at org.voltdb.utils.SystemStatsCollector$PSScraper.getPSData(SystemStatsCollector.java:151)
at org.voltdb.utils.SystemStatsCollector.initialize(SystemStatsCollector.java:291)
at org.voltdb.utils.SystemStatsCollector.generateCurrentSample(SystemStatsCollector.java:346)
at org.voltdb.utils.SystemStatsCollector.sampleSystemNow(SystemStatsCollector.java:231)
at org.voltdb.utils.SystemStatsCollector$1.run(SystemStatsCollector.java:263)
at java.lang.Thread.run(Thread.java:680)
Exception in thread "Thread-17" java.lang.NumberFormatException: For input string: "2,8"
at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
at java.lang.Double.valueOf(Double.java:475)
at org.voltdb.utils.SystemStatsCollector$PSScraper.getPSData(SystemStatsCollector.java:151)
at org.voltdb.utils.SystemStatsCollector.generateCurrentSample(SystemStatsCollector.java:357)
at org.voltdb.utils.SystemStatsCollector.sampleSystemNow(SystemStatsCollector.java:231)
at org.voltdb.utils.SystemStatsCollector$1.run(SystemStatsCollector.java:263)
at java.lang.Thread.run(Thread.java:680)



I'm running Mac OS X 10.6.6 in french/portuguese (that might cause the system to return the value in unexpected format).
Localization issue
jhugg
Feb 21, 2011
We use the command, "ps" internally (to give us some stats). In some localizations it reports numbers with "," where VoltDB is expecting ".".
Here's a workaround:

Add a LANG environment variable to the ant target that runs your server like so:


<env key="LANG" value="en_US.UTF-8"/>


For example, we added this to the auction example build file and got:


<target name="server" description="Start the server and load the catalog.">
<java classname="org.voltdb.VoltDB" fork="yes">
<jvmarg value="-Djava.library.path=${voltdb.dir}"/>
<jvmarg value="-server"/>
<jvmarg value="-Xmx512m"/>
<jvmarg value="-XX:+HeapDumpOnOutOfMemoryError"/>
<jvmarg value="-XX:HeapDumpPath=/tmp"/>
<jvmarg value="-XX:-ReduceInitialCardMarks"/>
<jvmarg value="-Dlog4j.configuration=file://${log4j.configuration}"/>
<arg value="catalog"/>
<arg value="${catalog}"/>
<arg value="deployment"/>
<arg value="deployment.xml"/>
<env key="LANG" value="en_US.UTF-8"/>
<classpath refid="project.classpath"/>
<assertions>
<disable/>
</assertions>
</java>
</target>



We hope to improve our support more more localizations in future versions of VoltDB.