cancel
Showing results for 
Search instead for 
Did you mean: 

executer programme ds une machine et alfresco dans une autre

debutant_alfres
Champ in-the-making
Champ in-the-making
bonjour tlm,
je vai expliquer mon probleme en detaille
-j'ai deux machien A(adresse ip: 10.67.27.32) et B(adresse ip: 10.67.27.12)
-sur la machine A est installé alfresco et eclipse et le sdk d'alfresco ou il y 'a l'exemple "SimpleExample.java"
-j'ai executé l'exemple sur la machine A en utilisant le serveur alfresco de la meme machine et ca marche

le programme "SimpleExample.java"
/* * Copyright (C) 2005-2010 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Alfresco is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */package org.alfresco.sample.jcr;import javax.jcr.Node;import javax.jcr.NodeIterator;import javax.jcr.Property;import javax.jcr.PropertyIterator;import javax.jcr.Repository;import javax.jcr.Session;import javax.jcr.SimpleCredentials;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;/** * Simple Example that demonstrate login and retrieval of top-level Spaces * under Company Home. *  * @author David Caruana */public class SimpleExample{    public static void main(String[] args)        throws Exception    {        // Setup Spring and Transaction Service        ApplicationContext context = new ClassPathXmlApplicationContext("classpath:alfresco/application-context.xml");                // Retrieve Repository        Repository repository = (Repository)context.getBean("JCR.Repository");        // Login to workspace        // Note: Default workspace is the one used by Alfresco Web Client which contains all the Spaces        //       and their documents        Session session = repository.login(new SimpleCredentials("admin", "alfrescoadmin".toCharArray()));        try        {            // Retrieve Company Home            Node root = session.getRootNode();            Node companyHome = root.getNode("app:company_home");                        // Iterator through children of Company Home            NodeIterator iterator = companyHome.getNodes();            while(iterator.hasNext())            {                Node child = iterator.nextNode();                System.out.println(child.getName());                PropertyIterator propIterator = child.getProperties();                while(propIterator.hasNext())                {                    Property prop = propIterator.nextProperty();                    if (!prop.getDefinition().isMultiple())                    {                        System.out.println(" " + prop.getName() + " = " + prop.getString());                    }                }            }System.out.println("pas de noeud");        }        finally        {            session.logout();            System.exit(0);        }            }    }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

jusque ici tt est normale

-j'ai installé alfresco sur la machine B
-j'ai changé la configuration du fichier "alfresco-global-properties.xml" qui se trouve dans le meme package que l'exemple "SimpleExample.java" pour que le programme "SimpleExample.java" puisse trouver la machien B
## Sample custom content and index data location#dir.root=C:/Alfresco/alf_datadb.name=alfrescodb.username=rootdb.password=alfrescodb.port=3306db.host=10.67.27.12## MySQL connection (This is default and requires mysql-connector-java-3.1.12-bin.jar, which ships with the Alfresco server)#db.driver=org.gjt.mm.mysql.Driverdb.url=jdbc:mysql://10.67.27.12:3306/alfresco## Oracle connection (requires ojdbc14_g.jar or equivalent jar in shared libraries location)##db.driver=oracle.jdbc.OracleDriver#db.url=jdbc:oracle:thin:@localhost:1521:alfresco## Sybase connection (requires jconn2d.jar or equivalent jar in shared libraries location)##db.driver=com.sybase.jdbc2.jdbc.SybDriver#db.url=jdbc:sybase:Tds:localhost:2638/alfresco# # Properties shared between the Alfresco server # and its remote clients (e.g.: the virtualization server).## Ports used by Alfresco## Note:  These ports are also used by the virtualization server#        (hence, they're in a seperate file that can be copied easily).avm.rmi.service.port=50501avmsync.rmi.service.port=50502attribute.rmi.service.port=50503authentication.rmi.service.port=50504repo.rmi.service.port=50505action.rmi.service.port=50806wcm-deployment-receiver.rmi.service.port=50507# Remote RMI servicesalfresco.rmi.services.port=50500alfresco.rmi.services.host=10.67.27.12‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

j'ai lancé l'execution du programme "SimpleExample.java" et voici le message d'erreur
Exception in thread "main" org.alfresco.error.AlfrescoRuntimeException: 05010001 Ensure that the 'dir.root' property is pointing to the correct data location.   at org.alfresco.repo.admin.ConfigurationChecker.check(ConfigurationChecker.java:332)   at org.alfresco.repo.admin.ConfigurationChecker.access$000(ConfigurationChecker.java:68)   at org.alfresco.repo.admin.ConfigurationChecker$1.execute(ConfigurationChecker.java:180)   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:377)   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:270)   at org.alfresco.repo.admin.ConfigurationChecker.onBootstrap(ConfigurationChecker.java:184)   at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)   at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)   at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:78)   at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:294)   at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:858)   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:419)   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)   at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)   at org.alfresco.sample.jcr.SimpleExample.main(SimpleExample.java:47)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

je sais que l'erreur du que le prg a du mal a trrouver le root au niveau de la ligne
dir.root=C:/Alfresco/alf_data‍‍

j'ai essayé tt les combinason possible (j'ai doublé les anti-slache, j'ai mis des slaches au lieu d'anti slache…)
mais ca na pasmarcher

j'espere que j'ai bien exposé mon probleme , si quelqun peut m'aider cela va me permettre d'avancer bien dans mon projet

merci d'avance pour votre aide

Cordialement
3 REPLIES 3

cleseach
Star Contributor
Star Contributor
Bonjour,

Attention à bien garder en mémoire que le SimpleExemple va démarrer sa propre instance d'Alfresco (sur la machine A).
Vous avez configuré votre application pour pouvoir utiliser le base de données de la machine B. C'est OK
Sauf que le dir.root utilisé va être celui de la machine A, et qu'il y a donc un problème de cohérence entre la base de données et les fichiers.

Cordialement,
Charles Le Seac'h

debutant_alfres
Champ in-the-making
Champ in-the-making
Bonjour,

Entendu, cela signifie que l'exécution de l'application SimpleExample.java sur la machine A, impose qu'alfresco démarre aussi sur la machine A.

Cependant, notre architecture cible est la suivante:
- machine A: application cliente écrite en JAVA qui accède à alfresco sur la machine B
- machine B: instance d'alfresco (avec sa base de données associée)

Cette solution est-elle réalisable ?


Merci d'avance,
Cordialement

cleseach
Star Contributor
Star Contributor
Bonjour,

Oui, votre organisation est tout Ă  fait possible. Il faut juste bien choisir la technologie d'appel ai serveur Alfresco.
Dans votre cas, il faut regarder du cote des API "remote", type WebScripts, CMIS ou WebServices.

Cordialement,
Charles Le Seac'h