我想使用CMIS 1.1在Alfresco 4.2上引入的浏览器绑定。我可以找到一个带有SQL92查询的文档,但我不能创建一个新的:
POST http://localhost:8180/alfresco/api/-default-/public/cmis/versions/1.1/browser?succinct=true HTTP/1.1
Host: localhost:8180
Connection: keep-alive
Content-Length: 496507
Cache-Control: no-cache
Authorization: Basic XXXXXXXXXXXXXXXXXX==
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryWVIchQ4xxZi4TwAe
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
------WebKitFormBoundaryWVIchQ4xxZi4TwAe
Content-Disposition: form-data; name="cmisaction"
createDocument
------WebKitFormBoundaryWVIchQ4xxZi4TwAe
Content-Disposition: form-data; name="propertyId[0]"
cmis:objectTypeId
------WebKitFormBoundaryWVIchQ4xxZi4TwAe
Content-Disposition: form-data; name="propertyValue[0]"
cmis:document
------WebKitFormBoundaryWVIchQ4xxZi4TwAe
Content-Disposition: form-data; name="propertyId[1]"
cmis:name
------WebKitFormBoundaryWVIchQ4xxZi4TwAe
Content-Disposition: form-data; name="propertyValue[1]"
mydoc.jpg
------WebKitFormBoundaryWVIchQ4xxZi4TwAe
Content-Disposition: form-data; name="versioningState"
none
------WebKitFormBoundaryWVIchQ4xxZi4TwAe
Content-Disposition: form-data; name="content"; filename="test.jpg"
Content-Type: image/jpeg
����
响应:{异常:"运行时"消息:nullstacktrace:"org.apache.chemistry.openmis.commons.exceptions.CmisRuntimeException at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.ioke(AlfrescoCmisExcessionInterceptor.java:80)at org.springframework.aop.framework.ReflectiveMethodInvocation.prouch(ReflectiveMethodInvocation.java:172)at。。。}
它似乎是一个NullPointerException。在日志文件中,我看到getGUID()是最后一个调用:
2014-04-14 11:49:28,701 ERROR [impl.browser.CmisBrowserBindingServlet] [http-apr-8180-exec-1]
org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException
at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:80)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at com.sun.proxy.$Proxy303.createDocument(Unknown Source)
at org.apache.chemistry.opencmis.server.support.CmisServiceWrapper.createDocument(CmisServiceWrapper.java:719)
at org.apache.chemistry.opencmis.server.impl.browser.ObjectService$CreateDocument.serve(ObjectService.java:102)
at org.apache.chemistry.opencmis.server.shared.Dispatcher.dispatch(Dispatcher.java:88)
at org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet.dispatch(CmisBrowserBindingServlet.java:352)
at org.apache.chemistry.opencmis.server.impl.browser.CmisBrowserBindingServlet.service(CmisBrowserBindingServlet.java:231)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.alfresco.opencmis.CMISServletDispatcher.execute(CMISServletDispatcher.java:173)
at org.alfresco.opencmis.CMISWebScript.execute(CMISWebScript.java:51)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:377)
at org.alfresco.rest.api.PublicApiRepositoryContainer.transactionedExecute(PublicApiRepositoryContainer.java:45)
at org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)
at org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341)
at org.alfresco.rest.api.PublicApiRepositoryContainer.access$001(PublicApiRepositoryContainer.java:26)
at org.alfresco.rest.api.PublicApiRepositoryContainer$1.doWork(PublicApiRepositoryContainer.java:81)
at org.alfresco.repo.tenant.TenantUtil.runAsWork(TenantUtil.java:119)
at org.alfresco.repo.tenant.TenantUtil.runAsTenant(TenantUtil.java:88)
at org.alfresco.rest.api.PublicApiRepositoryContainer.executeScript(PublicApiRepositoryContainer.java:77)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)
at org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)
at org.alfresco.repo.web.scripts.TenantWebScriptServlet.service(TenantWebScriptServlet.java:74)
at org.alfresco.rest.api.PublicApiWebScriptServlet.service(PublicApiWebScriptServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.alfresco.opencmis.CMISConnector.getGuid(CMISConnector.java:1139)
at org.alfresco.opencmis.CMISConnector.constructObjectId(CMISConnector.java:1194)
at org.alfresco.opencmis.CMISConnector.constructObjectId(CMISConnector.java:1181)
at org.alfresco.opencmis.CMISNodeInfoImpl.<init>(CMISNodeInfoImpl.java:91)
at org.alfresco.opencmis.CMISConnector.createNodeInfo(CMISConnector.java:1107)
at org.alfresco.opencmis.AlfrescoCmisServiceImpl.getOrCreateNodeInfo(AlfrescoCmisServiceImpl.java:207)
at org.alfresco.opencmis.AlfrescoCmisServiceImpl.getOrCreateFolderInfo(AlfrescoCmisServiceImpl.java:227)
at org.alfresco.opencmis.AlfrescoCmisServiceImpl.createDocument(AlfrescoCmisServiceImpl.java:1073)
at org.alfresco.opencmis.PublicApiAlfrescoCmisService.createDocument(PublicApiAlfrescoCmisService.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:79)
at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:452)
at org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:69)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.opencmis.AlfrescoCmisStreamInterceptor.invoke(AlfrescoCmisStreamInterceptor.java:72)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.opencmis.AlfrescoCmisServiceInterceptor.invoke(AlfrescoCmisServiceInterceptor.java:101)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.alfresco.opencmis.AlfrescoCmisExceptionInterceptor.invoke(AlfrescoCmisExceptionInterceptor.java:50)
... 48 more
是否有人尝试通过户外浏览器绑定创建文档?
使用apacheCMIS工作台。您也可以尝试在Alfresco链接的在线版本。
我们使用以下网址:
<host>/alfresco/api/-default-/public/cmis/versions/1.1/browser
使用浏览器绑定并创建一个对象,捕获url&请求发送。
这里有一个很好的浏览器绑定博客,它比Alfresco文档解释得更多。
我发现了我的错误!
为了使用cmisation"createDocument",您需要在查询字符串中指定refered folderId。像这样:
http://localhost:8180/alfresco/api/-default-/public/cmis/versions/1.1/browser
?objectId=5f2a7593-7eef-410d-9805-659dff5d4603
在这种情况下,新文档将创建到此文件夹中。