Fedora add datastream Exception

Today, when I deployed my application on a production server and tested it, I received this exception:

fedora.server.errors.GeneralException: Unable to add or modify object (commit canceled)

This is caused by fedora.API-M.addDatastream() method. It turned out that the issue is because I used null value for an alternateid, instead of an empty array of string. This is quite strange because everything works fine on my development machine. Anyway, this is the correct syntax.

apim.addDatastream(“changeme:1”, “DsId”, new String[] {}, …);

This is “NOT QUITE RIGHT”:

apim.addDatastream(“changeme:1”, “DsId”, null, …);

Source: [1], [2].

Advertisements