Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E3BAAD99A for ; Wed, 3 Oct 2012 19:12:07 +0000 (UTC) Received: (qmail 90607 invoked by uid 500); 3 Oct 2012 19:12:07 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 90566 invoked by uid 500); 3 Oct 2012 19:12:07 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 90557 invoked by uid 99); 3 Oct 2012 19:12:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Oct 2012 19:12:07 +0000 Date: Thu, 4 Oct 2012 06:12:07 +1100 (NCT) From: =?utf-8?Q?Florian_M=C3=BCller_=28JIRA=29?= To: dev@chemistry.apache.org Message-ID: <1362577502.160302.1349291527717.JavaMail.jiratomcat@arcas> In-Reply-To: <1303489496.160068.1349289254458.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CMIS-573) CmisExtensionElement update fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CMIS-573?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D134687= 48#comment-13468748 ]=20 Florian M=C3=BCller commented on CMIS-573: ------------------------------------- I don't really understand what you are trying to achieve here. You are taki= ng the extensions of an object, attach them to the properties and send them= back. Is that correct? Extensions should only be used in one direction. No CMIS client except your= s would be able to send them back and forth. The "Object Info is missing!" issue is probably an unrelated issue in your = server implementation. It looks like it cannot find the ObjectInfo object o= f the object you just updated.=20 Btw. You should not rely on namespaces or attribute because they don't work= with the Browser Binding. You would have to write extra code on the client= and server side to handle this binding. Is there any reason for using OpenCMIS 0.6.0. OpenCMIS 0.7.0 is out for qui= te some time and the 0.8.0 release is imminent. =20 > CmisExtensionElement update fails > --------------------------------- > > Key: CMIS-573 > URL: https://issues.apache.org/jira/browse/CMIS-573 > Project: Chemistry > Issue Type: Bug > Affects Versions: OpenCMIS 0.6.0 > Environment: OSX 10.8.2 > Reporter: linzhixing > > I'm now developing a document management system implementing CMIS specifi= cation, using Apache Chemistry OpenCMIS 0.6.0. > My CMIS repository is for the present almost already working, but CmisExt= ensionElement update function fails. > I would to know if it is really an error, or there is a better and correc= t way to update CmisExtensionElement. > of course I read the following article "Adding CMIS extensions (Server)", > http://chemistry.apache.org/java/how-to/how-to-add-extension.html > but it describes ObjectDataImpl, not CmisObject or Document object's upda= te itself. > Here is my code. > -------------------------------------------------------------------------= ------------- > //Get the document to be updated > Document doc =3D (Document) facade.getSession().getObject(getModel().getI= d()); > //Prepare update properties except CmisExtensionElement > Map props =3D new HashMap(); > props.put(PropertyIds.NAME, getModel().getName()); > if (getModel().getUpload() !=3D null) setAttachment(doc); > =09=09=09 > //Prepare CmisExtensionElement > Session session =3D facade.getSession(); > String repositoryId =3D session.getRepositoryInfo().getId(); > Holder objectHolder =3D new Holder(getModel().getId()); > Set updatebility =3D new HashSet(); > updatebility.add(Updatability.READWRITE); > Properties properties =3D session.getObjectFactory().convertProperties(pr= ops, doc.getType(), updatebility); > properties.setExtensions(convertCmisExtensionElement(doc.getExtensions(Ex= tensionLevel.OBJECT))); > //Update the document with the properties including CmisExtensionElement > facade.getSession().getBinding().getObjectService().updateProperties( > =09=09=09=09=09repositoryId, objectHolder, null, properties, null); > -------------------------------------------------------------------------= ------------- > "updateProperties" method in the code fails, though when CmisExtensionEle= ment is not set successfully. > The error is as follows: > -------------------------------------------------------------------------= ------------- > org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Ex= ception: NAMESPACE_ERR: An attempt is made to create or change an object in= a way which is incorrect with regard to namespaces. > =09at org.apache.chemistry.opencmis.commons.impl.Converter.convertExtensi= on(Converter.java:2587) > =09at org.apache.chemistry.opencmis.commons.impl.Converter.convert(Conver= ter.java:1450) > =09at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectSer= viceImpl.updateProperties(ObjectServiceImpl.java:273) > =09at jp.aegif.struts2cmisexplorer.struts2actions.UpdateDocumentAction.ex= ecuteUpdate(UpdateDocumentAction.java:243) > =09at jp.aegif.struts2cmisexplorer.struts2actions.UpdateDocumentAction.ex= ecute(UpdateDocumentAction.java:82) > =09at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > =09at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp= l.java:39) > =09at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc= essorImpl.java:25) > =09at java.lang.reflect.Method.invoke(Method.java:597) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(Defaul= tActionInvocation.java:441) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(De= faultActionInvocation.java:280) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:243) > =09at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIn= tercept(DefaultWorkflowInterceptor.java:165) > =09at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.interce= pt(MethodFilterInterceptor.java:87) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept= (ValidationInterceptor.java:252) > =09at org.apache.struts2.interceptor.validation.AnnotationValidationInter= ceptor.doIntercept(AnnotationValidationInterceptor.java:68) > =09at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.interce= pt(MethodFilterInterceptor.java:87) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.inte= rcept(ConversionErrorInterceptor.java:122) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doInterce= pt(ParametersInterceptor.java:195) > =09at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.interce= pt(MethodFilterInterceptor.java:87) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doInterce= pt(ParametersInterceptor.java:195) > =09at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.interce= pt(MethodFilterInterceptor.java:87) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.int= ercept(StaticParametersInterceptor.java:179) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(Mul= tiselectInterceptor.java:75) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(Checkb= oxInterceptor.java:94) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(File= UploadInterceptor.java:306) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercep= t(ModelDrivenInterceptor.java:89) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.in= tercept(ScopedModelDrivenInterceptor.java:130) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.inter= cept(DebuggingInterceptor.java:267) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(C= hainingInterceptor.java:126) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(= PrepareInterceptor.java:138) > =09at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.interce= pt(MethodFilterInterceptor.java:87) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nI= nterceptor.java:165) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(S= ervletConfigInterceptor.java:164) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(Alia= sInterceptor.java:179) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.int= ercept(ExceptionMappingInterceptor.java:176) > =09at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActio= nInvocation.java:237) > =09at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy= .java:52) > =09at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.j= ava:488) > =09at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispa= tcher.java:395) > =09at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(Servl= etHandler.java:1212) > =09at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java= :399) > =09at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.j= ava:216) > =09at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java= :182) > =09at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java= :766) > =09at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:45= 0) > =09at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java= :152) > =09at org.mortbay.jetty.Server.handle(Server.java:326) > =09at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:= 542) > =09at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnect= ion.java:945) > =09at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756) > =09at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) > =09at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) > =09at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.= java:410) > =09at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool= .java:582) > Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to= create or change an object in a way which is incorrect with regard to name= spaces. > =09at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.setName(AttrNSImp= l.java:105) > =09at com.sun.org.apache.xerces.internal.dom.AttrNSImpl.(AttrNSImpl= .java:74) > =09at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttri= buteNS(CoreDocumentImpl.java:2138) > =09at com.sun.org.apache.xerces.internal.dom.ElementImpl.setAttributeNS(E= lementImpl.java:656) > =09at org.apache.chemistry.opencmis.commons.impl.Converter.convertCmisExt= ensionElementToNode(Converter.java:2697) > =09at org.apache.chemistry.opencmis.commons.impl.Converter.convertExtensi= on(Converter.java:2582) > =09... 71 more > -------------------------------------------------------------------------= ------------- > As far as I investigated, namespace key-values are automatically included= into the CmisExtentionElement's attributes, like: > -------------------------------------------------------------------------= ------------- > [{http://hoge.jp/MyCmis/}aspects {ns3=3Dhttp://docs.oasis-open.org/ns/cmi= s/messaging/200908/, aspects=3Dhttp://hoge.jp/MyCmis/, xmlns=3Dhttp://hoge.= jp/MyCmis/}: [{http://hoge.jp/MyCmis/}customProperty1 {title=3Dcustomevalue= 1, ns0=3Dhttp://hoge.jp/MyCmis/}: ], {http://hoge.jp/MyCmis/}pastVersions {= v1=3Ddoc_5_attach_1, ns2=3Dhttp://hoge.jp/MyCmis/, v0=3Ddoc_5_attach_0, ns1= =3Dhttp://hoge.jp/MyCmis/, ns3=3Dhttp://docs.oasis-open.org/ns/cmis/messagi= ng/200908/, ns0=3Dhttp://hoge.jp/MyCmis/, v2=3Ddoc_5_attach_2, pastVersions= =3Dhttp://hoge.jp/MyCmis/, xmlns=3Dhttp://hoge.jp/MyCmis/}: dummy] > -------------------------------------------------------------------------= ------------- > "ns0","ns1","ns2", "ns3", and "xlmns" are the namespaces.=20 > My CMIS repository doesn't output any namespaces and they are already inc= luded when I got "doc.getExtensions(ExtensionLevel.OBJECT)" from my CMIS re= pository. > I debugged NAMESPACE error and the "xmlns" article is critical. > Removing "xmlns" key-value from the attribute can avoid the namespace err= or, but then I got the error: > -------------------------------------------------------------------------= ------------- > org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException: Ob= ject Info is missing! > =09at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractA= tomPubService.convertStatusCode(AbstractAtomPubService.java:452) > =09at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractA= tomPubService.put(AbstractAtomPubService.java:595) > =09at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractA= tomPubService.put(AbstractAtomPubService.java:581) > =09at org.apache.chemistry.opencmis.client.bindings.spi.atompub.ObjectSer= viceImpl.updateProperties(ObjectServiceImpl.java:278) > -------------------------------------------------------------------------= ------------- > So, what can I do to update CmisExtensionElement? > Thanks in advance. > Best regards, -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira