<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Criar sessão cmis  in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/criar-sess%C3%A3o-cmis/m-p/97168#M66848</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tentei criar um conector cmis no bonita soft versão 5.9.1 e quando tento criar um sessão devolve o seguinte erro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpl&lt;BR /&gt;java.lang.ClassNotFoundException: org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl in classloader MyExtensionsClassLoader&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No conector tenho o seguinte código&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;import java.util.HashMap;&lt;BR /&gt;import java.util.List;&lt;BR /&gt;import java.util.Map;&lt;BR /&gt;import java.util.concurrent.ConcurrentHashMap;&lt;/P&gt;&lt;P&gt;import org.apache.chemistry.opencmis.client.api.Repository;&lt;BR /&gt;import org.apache.chemistry.opencmis.client.api.Session;&lt;BR /&gt;import org.apache.chemistry.opencmis.client.api.SessionFactory;&lt;BR /&gt;import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl;&lt;BR /&gt;import org.apache.chemistry.opencmis.commons.SessionParameter;&lt;BR /&gt;import org.apache.chemistry.opencmis.commons.enums.BindingType;&lt;BR /&gt;import org.ow2.bonita.connector.core.ConnectorError;&lt;BR /&gt;import org.ow2.bonita.connector.core.ProcessConnector;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;public class CMISTESTE extends ProcessConnector {&lt;/P&gt;&lt;P&gt;// DO NOT REMOVE NOR RENAME THIS FIELD&lt;BR /&gt; public String password;&lt;BR /&gt; // DO NOT REMOVE NOR RENAME THIS FIELD&lt;BR /&gt; public String username;&lt;BR /&gt; public String resultado;&lt;BR /&gt; &lt;BR /&gt; private static Map&amp;lt;String, Session&amp;gt; connections = new ConcurrentHashMap&amp;lt;String, Session&amp;gt;();&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; @Override&lt;BR /&gt; protected void executeConnector() throws Exception {&lt;BR /&gt; // TODO Auto-generated method stub&lt;BR /&gt; getSession( username, password);&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; public String getSession(String username, String password) {&lt;/P&gt;&lt;P&gt;System.out.println("Metodo CreateSession");&lt;BR /&gt; &lt;BR /&gt; // Ver se existe uma sessão existente para o utilizador&lt;BR /&gt; Session session = connections.get(username);&lt;/P&gt;&lt;P&gt;// Criar uma nova sessão no Alfresco&lt;BR /&gt; if (session == null) {&lt;BR /&gt; System.out.println("Not connected, creating new connection to" + " Alfresco with the connection id (" + username&lt;BR /&gt; + ")");&lt;/P&gt;&lt;P&gt;// Implementação da fabrica padrão&lt;BR /&gt; SessionFactory sessionFactory = SessionFactoryImpl.newInstance();&lt;BR /&gt; Map&amp;lt;String, String&amp;gt; parameters = new HashMap&amp;lt;String, String&amp;gt;();&lt;/P&gt;&lt;P&gt;// Parametros para a conecção&lt;BR /&gt; parameters.put(SessionParameter.USER, username);&lt;BR /&gt; parameters.put(SessionParameter.PASSWORD, password);&lt;BR /&gt;&lt;SPAN&gt; parameters.put(SessionParameter.ATOMPUB_URL,"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://localhost:8089/alfresco/cmisatom" rel="nofollow noopener noreferrer" target="_blank"&gt;http://localhost:8089/alfresco/cmisatom&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt; parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());&lt;BR /&gt; //parameters.put(SessionParameter.OBJECT_FACTORY_CLASS, "org.alfresco.cmis.client.impl.AlfrescoObjectFactoryImpl");&lt;/P&gt;&lt;P&gt;// Recebe a lista de repositorios fornecidos pelo endpoint&lt;BR /&gt; List&amp;lt;Repository&amp;gt; repositories = sessionFactory.getRepositories(parameters);&lt;/P&gt;&lt;P&gt;// Como só é devolvido um repositorio, irá estar na posição 0&lt;BR /&gt; Repository alfrescoRepository = null;&lt;BR /&gt; alfrescoRepository = repositories.get(0);&lt;/P&gt;&lt;P&gt;// Criar conecção com o repositorio&lt;BR /&gt; session = alfrescoRepository.createSession();&lt;/P&gt;&lt;P&gt;// Salvar coneção&lt;BR /&gt; connections.put(username, session);&lt;/P&gt;&lt;P&gt;} else {&lt;BR /&gt; System.out.println("Already connected to Alfresco with the " + "connection id (" + username + ")");&lt;BR /&gt; }&lt;BR /&gt; resultado="OK";&lt;BR /&gt; return resultado;&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; @Override&lt;BR /&gt; protected List&amp;lt;ConnectorError&amp;gt; validateValues() {&lt;BR /&gt; // TODO Auto-generated method stub&lt;BR /&gt; return null;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt; * Setter for input argument 'password'&lt;BR /&gt; * DO NOT REMOVE NOR RENAME THIS SETTER, unless you also change the related entry in the XML descriptor file&lt;BR /&gt; */&lt;BR /&gt; public void setPassword(java.lang.String password) {&lt;BR /&gt; this.password = password;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt; * Setter for input argument 'username'&lt;BR /&gt; * DO NOT REMOVE NOR RENAME THIS SETTER, unless you also change the related entry in the XML descriptor file&lt;BR /&gt; */&lt;BR /&gt; public void setUsername(java.lang.String username) {&lt;BR /&gt; this.username = username;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt; * Getter for output argument 'resultado'&lt;BR /&gt; * DO NOT REMOVE NOR RENAME THIS GETTER, unless you also change the related entry in the XML descriptor file&lt;BR /&gt; */&lt;BR /&gt; public java.lang.String getResultado() {&lt;BR /&gt; // TODO Add return value for the output here&lt;BR /&gt; return this.resultado;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Como devo corrigir?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Jan 2018 15:17:14 GMT</pubDate>
    <dc:creator>patricia_lopes</dc:creator>
    <dc:date>2018-01-22T15:17:14Z</dc:date>
    <item>
      <title>Criar sessão cmis</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/criar-sess%C3%A3o-cmis/m-p/97168#M66848</link>
      <description>Tentei criar um conector cmis no bonita soft versão 5.9.1 e quando tento criar um sessão devolve o seguinte erro.java.lang.NoClassDefFoundError: org/apache/chemistry/opencmis/client/runtime/SessionFactoryImpljava.lang.ClassNotFoundException: org.apache.chemistry.opencmis.client.runtime.SessionFactor</description>
      <pubDate>Mon, 22 Jan 2018 15:17:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/criar-sess%C3%A3o-cmis/m-p/97168#M66848</guid>
      <dc:creator>patricia_lopes</dc:creator>
      <dc:date>2018-01-22T15:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Criar sessão cmis</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/criar-sess%C3%A3o-cmis/m-p/97169#M66849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Boa noite.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eu diria que essa sua pergunta não tem muita relação com o Alfresco, mesmo que você esteja tentando se conectar nele.&lt;/P&gt;&lt;P&gt;Se esse seu código é executado no Bonita, então o problema está lá, e não no Alfresco.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Esse é&amp;nbsp;um erro bem comum no Java, e quer dizer que a JVM onde o projeto está rodando (imagino que você esteja usando o Tomcat) não tem o jar da biblioteca disponível no classpath (normalmente &amp;lt;tomcat&amp;gt;/lib)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Verifique se você baixou a biblioteca do CMIS e se colocou em um local onde a JVM possa acessá-la.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jan 2018 23:15:48 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/criar-sess%C3%A3o-cmis/m-p/97169#M66849</guid>
      <dc:creator>douglascrp</dc:creator>
      <dc:date>2018-01-22T23:15:48Z</dc:date>
    </item>
  </channel>
</rss>

