Hi Graeme,
I suspect that the problem lies here:
>
>> WARN 2010-05-24 15:28:59.282 [http-8080-2] (DatastreamResource) Bad request;
>> unable to fulfill REST API request
>> java.lang.NumberFormatException: For input string: "2326355355"
>> at
>> java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>> at java.lang.Integer.parseInt(Integer.java:461)
The maximum size of an integer in Java is 2^31-1, or 2147483648. That
is a smaller value than the size here. To confirm, I wrote a short Java
app that attempted to convert a String to an int using
Integer.parseInt() and encountered the same error if I made the number
too large. I am including the code here:
public class Test {
public static void main(String[] args) {
try {
int i = Integer.parseInt("3922823822822");
System.out.println(i);
} catch (NumberFormatException e) {
System.out.println("Exception caught: " + e.toString());
}
}
}
compile with "javac Test.java" and then run with "java Test". If you
make the number in the parseInt call nice and small, it works without
problem.
I believe the fix here is to use a long datatype instead of an int, in
the Fedora code. This may impact database storage requirements and
other methods in the code that depend on being handed an integer,
though, and those would need to be looked at as well.
Jason
--
Jason Nugent
Systems Programmer/Database Developer
Electronic Text Centre
University of New Brunswick
[email protected]
(506) 447 3177
------------------------------------------------------------------------------
_______________________________________________
Fedora-commons-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-users