[ 
https://jira.duraspace.org/browse/DS-1090?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Dietz updated DS-1090:
----------------------------

    Attachment: cc-license-url.patch
    
> 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.7.0, 1.7.1, 1.7.2, 1.8.0
>            Reporter: Dan Ishimitsu
>            Assignee: Peter Dietz
>         Attachments: cc-license-url.patch
>
>
> 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

        

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel

Reply via email to