CC license process fails with java.lang.NegativeArraySizeException.
-------------------------------------------------------------------
Key: DS-1090
URL: https://jira.duraspace.org/browse/DS-1090
Project: DSpace
Issue Type: Bug
Components: JSPUI, XMLUI
Affects Versions: 1.8.0, 1.7.2
Reporter: Dan Ishimitsu
version 1.8.0 has no error, but fails silently.
version 1.7.X gives an error and cannot continue.
When adding CC license to a submission, we get the following error
Exception:
java.lang.NegativeArraySizeException
at org.dspace.license.CreativeCommons.fetchURL(CreativeCommons.java:393)
at org.dspace.license.CreativeCommons.fetchLicenseText(CreativeCommons.java:268)
at org.dspace.license.CreativeCommons.setLicense(CreativeCommons.java:130)
at
org.dspace.app.webui.servlet.admin.EditItemServlet.showEditForm(EditItemServlet.java:379)
at
org.dspace.app.webui.servlet.admin.EditItemServlet.doDSGet(EditItemServlet.java:135)
...
The line
byte[] bytes = new byte[connection.getContentLength()];
fails because it presumably can't get the content-length of the license upfront.
Possible Workaround:
Add to the imports...
import java.io.BufferedReader;
import java.io.InputStreamReader;
Replace everything in the try{} block with...
String line = "";
URL url = new URL(url_string);
URLConnection connection = url.openConnection();
InputStream inputStream = connection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder sb = new StringBuilder();
while ((line = reader.readLine()) != null)
sb.append(line);
return sb.toString().getBytes();
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://jira.duraspace.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel