Saludos estimados, al momento estoy tratando de subir un documento a mi repositorio de Alfresco mediante CMIS 1.1, tengo instalado Alfresco 5.1 , pero tengo el siguiente error: adjunto el error y el código que estoy usando.
ERROR:
18-Feb-2016 11:57:34.557 SEVERE [http-apr-8989-exec-198] org.apache.catalina.core.StandardWrapperValve.invoke El Servlet.service() para el servlet [PasaDatos] en el contexto con ruta [/IntegracionAlfrescoTomcat] lanzó la excepción [La ejecución del Servlet lanzó una excepción] con causa raíz java.lang.NoSuchMethodError: org.apache.chemistry.opencmis.client.api.OperationContext.loadSecondaryTypeProperties()Z at org.apache.chemistry.opencmis.client.runtime.OperationContextImpl.<init>(OperationContextImpl.java:78) at org.apache.chemistry.opencmis.client.runtime.AbstractCmisObject.initialize(AbstractCmisObject.java:108) at org.alfresco.cmis.client.impl.AlfrescoFolderImpl.initialize(AlfrescoFolderImpl.java:46) at org.apache.chemistry.opencmis.client.runtime.FolderImpl.<init>(FolderImpl.java:70) at org.alfresco.cmis.client.impl.AlfrescoFolderImpl.<init>(AlfrescoFolderImpl.java:39) at org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl.convertObject(AlfrescoObjectFactoryImpl.java:297) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getObject(SessionImpl.java:523) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:735) at org.apache.chemistry.opencmis.client.runtime.SessionImpl.getRootFolder(SessionImpl.java:729) at utpl.webservice.MyViewModel.conecta(MyViewModel.java:88) at utpl.procesamiento.ObtieneArchivo.enviaDatos(ObtieneArchivo.java:150) at utpl.servlet.PasaDatos.processRequest(PasaDatos.java:72) at utpl.servlet.PasaDatos.doPost(PasaDatos.java:131) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2500) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2489) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
List<Repository> repos = sessionFactory.getRepositories(params); if (repos.isEmpty()) { throw new RuntimeException("Server has no repositories!"); } Session session = repos.get(0).createSession();
AlfrescoFolder folder1 = (AlfrescoFolder) session.getObjectByPath("/Clasificacion"); String aux = "C:/Users/utpl/Documents/UIFCE.pdf"; File file = new File(aux);
InputStream fis = new FileInputStream(file); VersioningState vs = VersioningState.MAJOR; DataInputStream dis = new DataInputStream(fis); byte[] bytes = new byte[(int) file.length()]; dis.readFully(bytes); ContentStream contentStream = new ContentStreamImpl(file.getAbsolutePath(), null, "application/pdf", new ByteArrayInputStream(bytes));