Hi, Florian,
Thanks for the reply. For client developers that don't have controls
over the servers, this would be frustrating. So without touching the
server, is there any way to walk around the issue from client side?
Thanks!
David
On 10/03/2011 04:00 PM, Florian Müller wrote:
Hi David,
My guess is that the property "dc:issued" doesn't exist in the type definition.
That would be a server issue.
The Python API doesn't care, but the Java API tries to match the properties
provided for an object with its type definition.
Florian
----- Original Message -----
From: "Dazhi Jiao"<[email protected]>
To: [email protected]
Sent: Monday, October 3, 2011 8:49:55 PM GMT +00:00 GMT Britain, Ireland,
Portugal
Subject: "Property doesn't exist" error while getting an object using Java API
Hi,
I'm new to the OpenCMIS Java API. I got errors when trying to retrieve
an object (a folder) with some properties with custom extensions. But I
can retrieve normal CMIS objects without custom properties without any
problem.
Here is the error message:
Exception in thread "main"
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException:
Property 'dc:issued' doesn't exist!
at
org.apache.chemistry.opencmis.client.runtime.repository.ObjectFactoryImpl.convertProperty(ObjectFactoryImpl.java:247)
at
org.apache.chemistry.opencmis.client.runtime.repository.ObjectFactoryImpl.convertProperties(ObjectFactoryImpl.java:270)
at
org.apache.chemistry.opencmis.client.runtime.AbstractCmisObject.initialize(AbstractCmisObject.java:108)
at
org.apache.chemistry.opencmis.client.runtime.FolderImpl.<init>(FolderImpl.java:69)
at
org.apache.chemistry.opencmis.client.runtime.repository.ObjectFactoryImpl.convertObject(ObjectFactoryImpl.java:483)
at
org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:397)
at
org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:367)
at
org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:359)
at cmispageturner.CMISRequester.checkStatus(CMISRequester.java:85)
at cmispageturner.CMISRequester.main(CMISRequester.java:23)
Java Result: 1
My code where the error was thrown:
... // build a session object ...
SessionFactory f = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, user);
parameter.put(SessionParameter.PASSWORD, passwd);
parameter.put(SessionParameter.ATOMPUB_URL, url);
parameter.put(SessionParameter.BINDING_TYPE,
BindingType.ATOMPUB.value());
parameter.put(SessionParameter.REPOSITORY_ID, "content");
Session session = f.createSession(parameter);
CmisObject obj = session.getObject(objId); // error thrown!!!
...
Is it because the server is not set up correctly or do I need to some
extra coding on the client side for objects with custom properties? I
can use the Python API to retrieve the object without any problem. Here
is what python code would retrieve:
cmis:objectId: L3JlcS90ZXN0L0swMDAyNjguMDAw
bamboo:source-url:
http://ramman.grainger.uiuc.edu:8080/fedora/objects/bamboo:K000268.000
cmis:creationDate: 2011-08-23 11:22:58
cmis:objectTypeId: bamboo:book
cmis:lastModificationDate: 2011-08-23 16:22:58
cmis:baseTypeId: cmis:folder
cmis:path: /req/test/K000268.000
dc:title: Every man in his own way: An epistle to a friend. By Stephen Duck.
dc:issued: 1741.
cmis:lastModifiedBy: bamboo
bamboo:source: tcp
cmis:name: Every man in his own way: An epistle to a friend. By Stephen
Duck.
cmis:createdBy: bamboo
dc:date: 1741.
dc:identifier: bamboo:K000268.000
cmis:parentId: L3JlcS90ZXN0
dc:publisher: printed for J. Roberts; and R. Dodsley,
dc:creator: Duck, Stephen, 1705-1756.
Apparently there exists an "dc:issued" property. so I am guess it's the
client Java code. Any ideas?
Thank you very much!
David