You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@chemistry.apache.org by "d.rotondi@computer.org" <d....@computer.org> on 2016/06/30 11:14:39 UTC
Java OpenCmis problems with special chars in the document filename
Hi All,
I'm trying to retrieve the content of a file present on my Alfresco system thought the Apache Chemistry OpenCMIS in my Java Web Application.
But when I invoke the getContentStream() method on the org.apache.chemistry.opencmis.client.api.Document interface and the document filename contains the character \u201c-\u201c (upper score), I receive the following stack trace:
org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Bad Request
org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:490)
org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getContentStream(ObjectServiceImpl.java:617)
org.apache.chemistry.opencmis.client.runtime.SessionImpl.getContentStream(SessionImpl.java:1454)
org.apache.chemistry.opencmis.client.runtime.DocumentImpl.getContentStream(DocumentImpl.java:396)
org.apache.chemistry.opencmis.client.runtime.DocumentImpl.getContentStream(DocumentImpl.java:380)
jp.aegif.struts2cmisexplorer.opencmisbinding.OpenCMISRepositoryClientFacade.getDocument(OpenCMISRepositoryClientFacade.java:227)
jp.aegif.struts2cmisexplorer.struts2actions.SendFileAction.execute(SendFileAction.java:55)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
Debugging the org.apache.chemistry.opencmis.client.runtime.DocumentImpl class, and in particular the org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getContentStream() method, in the returned link object, the \u201c-\u201c char it\u2019s translated in \u201c%5Cu\u201d (before it\u2019s translated in \u201c\u\u201d and then the URL Encodig transform it to \u201c%5Cu\u201d).
If I replace the \u201c%5Cu\u201d with the original \u201c-\u201c char, all work perfectly.
Following the details about my test environment:
org.apache.chemistry.opencmis v 0.14.0
JDK 1.8.0_91 64bit
Tomcat 7.0.69
Alfresco 5.0.d
Any idea about this issue?
Any suggestions will be appreciated.
Thanks in advance for any hints. Best regards.
Domenico
Re: Java OpenCmis problems with special chars in the document filename
Posted by Domenico Rotondi <d....@computer.org>.
On 30 Jun 2016 at 21:14, Gavin Cornwell wrote:
Hi Florian and Gavin,
thanks for your kind feedback.
After a deep debug task, we found the reason behind the issue.
The "upper score" present in a lot of filenames wasn’t the standard dash present on
the keyboard, but the "en dash" special char (with U+2013 Unicode).
It is not possible to insert this char via the Alfresco user interface, but we,
inadvertitely, were able to use such char because we uploaded some files to Alfresco
using a WebDav client.
Replacing the "en dash" with the standard dash, all problems are solved.
Best Regards.
Domenico
> Hi Domenico,
>
> Another alternative is to try a newer version of Alfresco, we fixed some issues in this area a while ago and they won’t be in the version you’re using.
>
> The latest stable Community release is 5.1.g.
>
> Regards,
>
> Gavin
>
>
> On 30/06/2016 13:05, "Florian Müller" <fm...@apache.org> wrote:
>
> >Hi Domenico,
> >
> >Could you please open an issue [1] and attach some client code to
> >reproduce it?
> >If we can reproduce it with the OpenCMIS InMemory repository, then we
> >can look into it. If not, we have to forward it to Alfresco.
> >
> >Btw. Use the browser binding. It doesn't solve your problem, but it's
> >faster. ;-)
> >
> >
> >- Florian
> >
> >[1] https://issues.apache.org/jira/browse/CMIS
> >
> >
> >
> >> Hi All,
> >> I'm trying to retrieve the content of a file present on my Alfresco
> >> system thought the Apache Chemistry OpenCMIS in my Java Web
> >> Application.
> >>
> >> But when I invoke the getContentStream() method on the
> >> org.apache.chemistry.opencmis.client.api.Document interface and the
> >> document filename contains the character “-“ (upper score), I
> >> receive the following stack trace:
> >> org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException:
> >> Bad Request
> >> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:490)
> >> org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getContentStream(ObjectServiceImpl.java:617)
> >> org.apache.chemistry.opencmis.client.runtime.SessionImpl.getContentStream(SessionImpl.java:1454)
> >> org.apache.chemistry.opencmis.client.runtime.DocumentImpl.getContentStream(DocumentImpl.java:396)
> >> org.apache.chemistry.opencmis.client.runtime.DocumentImpl.getContentStream(DocumentImpl.java:380)
> >> jp.aegif.struts2cmisexplorer.opencmisbinding.OpenCMISRepositoryClientFacade.getDocument(OpenCMISRepositoryClientFacade.java:227)
> >> jp.aegif.struts2cmisexplorer.struts2actions.SendFileAction.execute(SendFileAction.java:55)
> >> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >> java.lang.reflect.Method.invoke(Method.java:498)
> >>
> >> Debugging the
> >> org.apache.chemistry.opencmis.client.runtime.DocumentImpl class, and
> >> in particular the
> >> org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getContentStream()
> >> method, in the returned link object, the “-“ char it’s
> >> translated in “%5Cu†(before it’s translated in “\u†and then
> >> the URL Encodig transform it to “%5Cuâ€).
> >>
> >> If I replace the “%5Cu†with the original “-“ char, all work
> >> perfectly.
> >>
> >> Following the details about my test environment:
> >> org.apache.chemistry.opencmis v 0.14.0
> >> JDK 1.8.0_91 64bit
> >> Tomcat 7.0.69
> >> Alfresco 5.0.d
> >>
> >> Any idea about this issue?
> >> Any suggestions will be appreciated.
> >>
> >> Thanks in advance for any hints. Best regards.
> >> Domenico
>
Re: Java OpenCmis problems with special chars in the document
filename
Posted by Gavin Cornwell <ga...@alfresco.com>.
Hi Domenico,
Another alternative is to try a newer version of Alfresco, we fixed some issues in this area a while ago and they won’t be in the version you’re using.
The latest stable Community release is 5.1.g.
Regards,
Gavin
On 30/06/2016 13:05, "Florian Müller" <fm...@apache.org> wrote:
>Hi Domenico,
>
>Could you please open an issue [1] and attach some client code to
>reproduce it?
>If we can reproduce it with the OpenCMIS InMemory repository, then we
>can look into it. If not, we have to forward it to Alfresco.
>
>Btw. Use the browser binding. It doesn't solve your problem, but it's
>faster. ;-)
>
>
>- Florian
>
>[1] https://issues.apache.org/jira/browse/CMIS
>
>
>
>> Hi All,
>> I'm trying to retrieve the content of a file present on my Alfresco
>> system thought the Apache Chemistry OpenCMIS in my Java Web
>> Application.
>>
>> But when I invoke the getContentStream() method on the
>> org.apache.chemistry.opencmis.client.api.Document interface and the
>> document filename contains the character “-“ (upper score), I
>> receive the following stack trace:
>> org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException:
>> Bad Request
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:490)
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getContentStream(ObjectServiceImpl.java:617)
>> org.apache.chemistry.opencmis.client.runtime.SessionImpl.getContentStream(SessionImpl.java:1454)
>> org.apache.chemistry.opencmis.client.runtime.DocumentImpl.getContentStream(DocumentImpl.java:396)
>> org.apache.chemistry.opencmis.client.runtime.DocumentImpl.getContentStream(DocumentImpl.java:380)
>> jp.aegif.struts2cmisexplorer.opencmisbinding.OpenCMISRepositoryClientFacade.getDocument(OpenCMISRepositoryClientFacade.java:227)
>> jp.aegif.struts2cmisexplorer.struts2actions.SendFileAction.execute(SendFileAction.java:55)
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> java.lang.reflect.Method.invoke(Method.java:498)
>>
>> Debugging the
>> org.apache.chemistry.opencmis.client.runtime.DocumentImpl class, and
>> in particular the
>> org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getContentStream()
>> method, in the returned link object, the “-“ char it’s
>> translated in “%5Cu†(before it’s translated in “\u†and then
>> the URL Encodig transform it to “%5Cuâ€).
>>
>> If I replace the “%5Cu†with the original “-“ char, all work
>> perfectly.
>>
>> Following the details about my test environment:
>> org.apache.chemistry.opencmis v 0.14.0
>> JDK 1.8.0_91 64bit
>> Tomcat 7.0.69
>> Alfresco 5.0.d
>>
>> Any idea about this issue?
>> Any suggestions will be appreciated.
>>
>> Thanks in advance for any hints. Best regards.
>> Domenico
Re: Java OpenCmis problems with special chars in the document
filename
Posted by Florian Müller <fm...@apache.org>.
Hi Domenico,
Could you please open an issue [1] and attach some client code to
reproduce it?
If we can reproduce it with the OpenCMIS InMemory repository, then we
can look into it. If not, we have to forward it to Alfresco.
Btw. Use the browser binding. It doesn't solve your problem, but it's
faster. ;-)
- Florian
[1] https://issues.apache.org/jira/browse/CMIS
> Hi All,
> I'm trying to retrieve the content of a file present on my Alfresco
> system thought the Apache Chemistry OpenCMIS in my Java Web
> Application.
>
> But when I invoke the getContentStream() method on the
> org.apache.chemistry.opencmis.client.api.Document interface and the
> document filename contains the character �\u20ac\u0153-�\u20ac\u0153 (upper score), I
> receive the following stack trace:
> org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException:
> Bad Request
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:490)
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getContentStream(ObjectServiceImpl.java:617)
> org.apache.chemistry.opencmis.client.runtime.SessionImpl.getContentStream(SessionImpl.java:1454)
> org.apache.chemistry.opencmis.client.runtime.DocumentImpl.getContentStream(DocumentImpl.java:396)
> org.apache.chemistry.opencmis.client.runtime.DocumentImpl.getContentStream(DocumentImpl.java:380)
> jp.aegif.struts2cmisexplorer.opencmisbinding.OpenCMISRepositoryClientFacade.getDocument(OpenCMISRepositoryClientFacade.java:227)
> jp.aegif.struts2cmisexplorer.struts2actions.SendFileAction.execute(SendFileAction.java:55)
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> java.lang.reflect.Method.invoke(Method.java:498)
>
> Debugging the
> org.apache.chemistry.opencmis.client.runtime.DocumentImpl class, and
> in particular the
> org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectServiceImpl.getContentStream()
> method, in the returned link object, the �\u20ac\u0153-�\u20ac\u0153 char it�\u20ac\u2122s
> translated in �\u20ac\u0153%5Cu�\u20ac (before it�\u20ac\u2122s translated in �\u20ac\u0153\u�\u20ac and then
> the URL Encodig transform it to �\u20ac\u0153%5Cu�\u20ac).
>
> If I replace the �\u20ac\u0153%5Cu�\u20ac with the original �\u20ac\u0153-�\u20ac\u0153 char, all work
> perfectly.
>
> Following the details about my test environment:
> org.apache.chemistry.opencmis v 0.14.0
> JDK 1.8.0_91 64bit
> Tomcat 7.0.69
> Alfresco 5.0.d
>
> Any idea about this issue?
> Any suggestions will be appreciated.
>
> Thanks in advance for any hints. Best regards.
> Domenico