Unsolved
This post is more than 5 years old
8 Posts
0
3502
December 13th, 2010 03:00
solved !!! FP_RETENTION_OUT_OF_BOUNDS_ERR during commit
I want to write a file to the centera via XAM java api. When I set the BaseRetentionduration to a special value, in this example 3000 ms, everytime i get this Exception. When i test with no retention periode, with a different "pea-Key" and write the file, i can see with the Commandline Tools that the periode is set to -1 and not 3000 ms and i have no exception (FP_RETENTION_OUT_OF_BOUNDS_ERR).
What ist wrong on my source ? any suggestion ?
@SuppressWarnings("unused")
public XUID write(String filename) throws XAMException, TransportException {
XUID xuID =
null;
long totalRead = 0;
long totalWrite = 0;
String duration =
"3000";
try {
BufferedInputStream inputStream =
new BufferedInputStream(new FileInputStream(new File(filename)));
LOG.info("Create XSet");
XSet xSet =
xSystem.createXSet(XSet.MODE_UNRESTRICTED);
LOG.info("Set application properties");
solved Wrong !!!!!
(xSet.createProperty("app-vendor", false, appVendor);
xSet.createProperty("app-name", false, appName);
xSet.createProperty("app-version", false, appVersion);)
Right !!!!! boolean to true
xSet.createProperty("app-vendor", true, appVendor);
xSet.createProperty("app-name", true, appName);
xSet.createProperty("app-version", true, appVersion);
LOG.info("Set filename property");
xSet.createProperty(
"filename", true, filename);
LOG.info("Create XStream !");
XStream xStream = xSet.createXStream(
"tgsacs", true, XAMLibrary.DEFAULT_MIME_TYPE);
byte[] buffer = new byte[BUFFER_SIZE];
long bytesRead = 0;
while((bytesRead = inputStream.read(buffer)) > 0) {
long bytesPos = 0;
while(bytesPos < bytesRead) {
long bytesWrite = xStream.write(buffer, bytesPos, bytesRead - bytesPos);
LOG.debug("XStream Write: " + bytesWrite);
bytesPos += bytesWrite;
}
totalRead += bytesRead;
totalWrite += bytesPos;
}
inputStream.close();
LOG.info("Total Bytes Read From File: " + totalRead);
LOG.info("Total Bytes Written to XStream: " + totalWrite);
xStream.close();
LOG.info("XSet Commit");
xSet.setBaseRetention(
true, Long.parseLong(duration));
xuID = xSet.commit();
LOG.info("Returned XUID: " + xuID.toString());
xSet.close();
saveIDToFile(xuID, filename);
long q = System.currentTimeMillis();
xSystem.close();
}
catch (FileNotFoundException fe) {
throw new IllegalArgumentException(
"Could not open file \"" + filename + "\" for reading");
}
catch (IOException ioe) {
LOG.error("Error reading from file \"" + filename + "\"");
ioe.printStackTrace();
}
catch (XAMException e) {
long q = System.currentTimeMillis();
LOG.error("Error writing ile \"" + filename + e.getStatusCode() + " to xam \"");
e.printStackTrace();
}
return (xuID);
}
gstuartemc
2 Intern
•
417 Posts
0
January 27th, 2011 15:00
All you have done by changing "false" to "true" in the creation of the property is to change the binding state of the field i.e. you have made it a binding piece of metadata. This has absolutely nothing to do with the subject line you have posted so please explain the relevance of what you have posted!!