cancel
Showing results for 
Search instead for 
Did you mean: 

Command line org.alfresco.tools.Import failed to work

panco
Champ in-the-making
Champ in-the-making
I installed the Alfresco 2.1 into a Tomcat 5.5 + Mysql 5.0 server, I tried to import the user data from a xml file (as shown below). I write a batch and put it together with the xml in the C:\xampp\tomcat\webapps\alfresco\WEB-INF directory. I change directory to C:\xampp\tomcat\webapps\alfresco\WEB-INF and run the batch file, it throws out the java.io.IOException: Cannot bind to URL [rmi://localhost:50500/alfresco/jmxrmi].

Does anyone know how to fix this issue? please help!

Alfresco Repository Importer
The following error has occurred:
Error creating bean with name 'serverConnector' defined in class path resource [alfresco/core-services-context.xml]: Invocation of init method failed; nested exception is java.io.IOException: Cannot bind to URL [rmi://localhost:50500/alfresco/jmxrmi]: javax.naming.NameAlreadyBoundException: alfresco/jmxrmi [Root exception is java.rmi.AlreadyBoundException: alfresco/jmxrmi]


The classpath includes:
  1. all the jar files in the lib directory
  2. tomcat\common\lib\mysql-connector-java-5.0.7-bin.jar;
  3. tomcat\common\endorsed\serializer.jar;
      tomcat\common\endorsed\xalan.jar;
  4. current directory

import.bat
java -classpath classes;lib\acegi-security-0.8.2_patched.jar;lib\activation.jar;lib\addressing-1.0.jar;lib\alfresco-core.jar;lib\alfresco-deployment.jar;lib\alfresco-linkvalidation.jar;lib\alfresco-mbeans.jar;lib\alfresco-remote-api.jar;lib\alfresco-repository.jar;lib\alfresco-web-client.jar;lib\ant.jar;lib\antlr-2.7.5H3.jar;lib\aopalliance.jar;lib\avalon-framework-4.2.0.jar;lib\axis.jar;lib\bcel.jar;lib\bcprov-jdk15-129.jar;lib\bsf-2.4.0.jar;lib\bsh-1.3.0.jar;lib\catalina.jar;lib\cglib-nodep-2.2_beta1.jar;lib\chiba-1.3.0.jar;lib\commons-beanutils-1.7.0.jar;lib\commons-codec-1.3.jar;lib\commons-collections-3.1.jar;lib\commons-dbcp-1.2.1.jar;lib\commons-digester-1.6.jar;lib\commons-discovery-0.2.jar;lib\commons-el.jar;lib\commons-fileupload-1.1.1.jar;lib\commons-httpclient-3.0.jar;lib\commons-io-1.1.jar;lib\commons-jxpath-1.2.jar;lib\commons-lang-2.1.jar;lib\commons-logging-1.0.4.jar;lib\commons-modeler.jar;lib\commons-pool-1.3.jar;lib\commons-validator.jar;lib\cpool.jar;lib\cryptix-jce-provider.jar;lib\dom4j-1.6.1.jar;lib\ehcache-1.3.0.jar;lib\fontbox-0.1.0.jar;lib\fop-0.92beta.jar;lib\freemarker.jar;lib\guessencoding-1.0.jar;lib\hibernate-3.2.1.jar;lib\hrtlib.jar;lib\hsqldb.jar;lib\htmlparser-1.6.jar;lib\icu4j_3_6_1.jar;lib\jakarta-oro-2.0.8.jar;lib\jaxen-1.1-beta-8.jar;lib\jaxrpc.jar;lib\jbpm-identity-3.2.jar;lib\jbpm-jpdl-3.2-patched.jar;lib\jcr-1.0.jar;lib\jgroups-2.2.8.jar;lib\jibx-bind.jar;lib\jibx-run.jar;lib\jid3lib-0.5.jar;lib\JMagick.jar;lib\joda-time-1.2.1.jar;lib\jooconverter-2.1.0.jar;lib\json.jar;lib\jstl-1.1.0.jar;lib\jta.jar;lib\jug.jar;lib\jut.jar;lib\list.txt;lib\log4j-1.2.8.jar;lib\lucene-analyzers-2.1.0.jar;lib\lucene-core-2.1.0.jar;lib\lucene-snowball-2.1.0.jar;lib\mail.jar;lib\myfaces-api-1.1.5.jar;lib\myfaces-impl-1.1.5.jar;lib\naming-factory.jar;lib\naming-resources.jar;lib\odf_utils.jar;lib\odmg-3.0.jar;lib\openoffice-juh-2.0.3.jar;lib\openoffice-jurt-2.0.3.jar;lib\openoffice-ridl-2.0.3.jar;lib\openoffice-sandbox-2.0.3.jar;lib\openoffice-unoil-2.0.3.jar;lib\opensaml-1.0.1.jar;lib\pdfbox-0.7.3.jar;lib\poi-2.5.1_patched.jar;lib\portlet-api-lib.jar;lib\quartz-1.6.0.jar;lib\resolver.jar;lib\rhino-js-1.6R4.jar;lib\saaj.jar;lib\saxpath.jar;lib\spring-2.0.2.jar;lib\springmodules-jbpm31.jar;lib\standard.jar;lib\tlc124.jar;lib\tm-extractors-0.4_patched.jar;lib\tomcat-coyote.jar;lib\tomcat-util.jar;lib\truezip.jar;lib\wsdl4j-1.5.1.jar;lib\wss4j.jar;lib\xercesImpl-2.8.0.jar;lib\xml-apis.jar;lib\xmlgraphics-commons-1.0.jar;lib\xmlsec-1.4.0.jar;lib\xpp3-1.1.3_8.jar;lib\xstream-1.1.3.jar;C:\xampp\tomcat\common\lib\mysql-connector-java-5.0.7-bin.jar;C:\xampp\tomcat\common\endorsed\serializer.jar;C:\xampp\tomcat\common\endorsed\xalan.jar;. org.alfresco.tools.Import -user admin -pwd admin -store workspace://SpacesStore -path \sys:system\sys:people person.xml 

person.xml
<?xml version="1.0" encoding="UTF-8"?>
<view:view xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0">
<cm:person view:childName="cm:person">
    <cm:userName>fredb</cm:userName>
    <cm:firstName>Fred</cm:firstName>
    <cm:lastName>Bloggs</cm:lastName>
    <cm:middleName></cm:middleName>
    <cm:email>fredb@alfresco.org</cm:email>
</cm:person>
<cm:person view:childName="cm:person">
    <cm:userName>sues</cm:userName>
    <cm:firstName>Sue</cm:firstName>
    <cm:lastName>Sanderson</cm:lastName>
    <cm:middleName></cm:middleName>
    <cm:email>sues@alfresco.org</cm:email>
</cm:person>
</view:view>
23 REPLIES 23

mikeh
Star Contributor
Star Contributor
The exception means Alfresco or some other application is already listening on the rmi port 50500. You need to find out what's using the port and stop it from running before using your import script.

Thanks,
Mike

panco
Champ in-the-making
Champ in-the-making
Thanks, Mike.

I solved the problem since the Tomcat itself occupied the port. I have to shutdown it before I run the import.

import -user admin -pwd admin -store workspace://SpacesStore -path /sys:system/sysSmiley Tongueeople people.xml

slothrop
Champ in-the-making
Champ in-the-making
I tried this following the instructions given in the first post:
The classpath includes:
1. all the jar files in the lib directory
2. tomcat\common\lib\mysql-connector-java-5.0.7-bin.jar;
3. tomcat\common\endorsed\serializer.jar;
tomcat\common\endorsed\xalan.jar;
4. current directory

I get the following:
10:53:43,921 WARN  [org.alfresco.repo.admin.ConfigurationChecker] The Alfresco 'dir.root' property is set to a relative path './alf_data'.  'dir.root' should be overridden to point to a specific folder.
10:53:43,921 INFO  [org.alfresco.repo.admin.ConfigurationChecker] The Alfresco root data directory ('dir.root') is: .\alf_data
10:53:44,000 ERROR [org.alfresco.repo.admin.ConfigurationChecker] CONTENT INTEGRITY ERROR: Indexes not found for 5 stores.
10:53:44,000 INFO  [org.alfresco.repo.admin.ConfigurationChecker] You may set 'index.recovery.mode=FULL' if you need to rebuild the indexes.
10:53:44,000 ERROR [org.alfresco.repo.admin.ConfigurationChecker] CONTENT INTEGRITY ERROR: System content not found in content store.
10:53:44,000 ERROR [org.alfresco.repo.admin.ConfigurationChecker] Ensure that the 'dir.root' property is pointing to the correct data location.

I just want to add users.  I would like to keep all other content and settings.

I am running this from the tomcat/webapps/alfresco/WEB-INF directory in Windows XP.  Is this the right directory?

Or how do I set index.recovery.mode=FULL?

slothrop
Champ in-the-making
Champ in-the-making
I set index.recovery.mode=FULL in custom-repository.properties, restarted the server, stopped it and got the same message when I tried to import the users.  I am running v. 2.1.

slothrop
Champ in-the-making
Champ in-the-making
Can anyone offer any advice on this?  It is a common error message and a fairly straightforward task I'm trying to accomplish.

mikeh
Star Contributor
Star Contributor
It's detailed in the error message:
The Alfresco 'dir.root' property is set to a relative path './alf_data'.
That means, if you're starting from an arbitrary subfolder, it's more than likely not going to find the correct folder.

Fix the location by creating a repository.properties file in the extensions folder (e.g. Tomcat/shared/classes/alfresco/extension) containing the absolute path to your alf_data folder
dir.root=c:/alf_disk/alf_data
Restart the server.

Thanks,
Mike

slothrop
Champ in-the-making
Champ in-the-making
Thanks for the reply, Mike.

My tomcat/shared/classes/alfresco/extension/custom-repository.properties file already contained an absolute path (dir.root=C:/Alfresco/alf_data) so I didn't think it was necessary to add a repository.properties to that directory.  When I did add a repository.properties containing that line to that directory it didn't seem to make a difference.  However, when I added that line to the tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties file the error message about the relative path to the alf_data file went away.  The error message about the lucene indeces also went away.

Unfortunately, there is a new error: "The following error has occured: Namespace prefix \sys is not mapped to a namespace URI".

And the users were not imported.

The \sys comes from the wiki where the import command, "import -user admin -pwd admin -store workspace://SpacesStore -path /sys:system/sysSmiley Tongueeople people.xml", is recommended.  Since my development server is running in Windows, the corresponding line in my import.bat file is: "org.alfresco.tools.Import -user admin -pwd admin -store workspace://SpacesStore -path \sys:system\sysSmiley Tongueeople people.xml".

The entire contents of the batch file are:
java -classpath classes;lib\acegi-security-0.8.2_patched.jar;lib\activation.jar;lib\addressing-1.0.jar;lib\alfresco-core.jar;lib\alfresco-deployment.jar;lib\alfresco-linkvalidation.jar;lib\alfresco-mbeans.jar;lib\alfresco-remote-api.jar;lib\alfresco-repository.jar;lib\alfresco-web-client.jar;lib\ant.jar;lib\antlr-2.7.5H3.jar;lib\aopalliance.jar;lib\avalon-framework-4.2.0.jar;lib\axis.jar;lib\bcel.jar;lib\bcprov-jdk15-129.jar;lib\bsf-2.4.0.jar;lib\bsh-1.3.0.jar;lib\catalina.jar;lib\cglib-nodep-2.2_beta1.jar;lib\chiba-1.3.0.jar;lib\commons-beanutils-1.7.0.jar;lib\commons-codec-1.3.jar;lib\commons-collections-3.1.jar;lib\commons-dbcp-1.2.1.jar;lib\commons-digester-1.6.jar;lib\commons-discovery-0.2.jar;lib\commons-el.jar;lib\commons-fileupload-1.1.1.jar;lib\commons-httpclient-3.0.jar;lib\commons-io-1.1.jar;lib\commons-jxpath-1.2.jar;lib\commons-lang-2.1.jar;lib\commons-logging-1.0.4.jar;lib\commons-modeler.jar;lib\commons-pool-1.3.jar;lib\commons-validator.jar;lib\cpool.jar;lib\cryptix-jce-provider.jar;lib\dom4j-1.6.1.jar;lib\ehcache-1.2.4.jar;lib\fontbox-0.1.0.jar;lib\fop-0.92beta.jar;lib\freemarker.jar;lib\guessencoding-1.0.jar;lib\hibernate-3.2.1.jar;lib\hrtlib.jar;lib\hsqldb.jar;lib\htmlparser-1.6.jar;lib\icu4j_3_6_1.jar;lib\jakarta-oro-2.0.8.jar;lib\jaxen-1.1-beta-8.jar;lib\jaxrpc.jar;lib\jbpm-identity-3.2.jar;lib\jbpm-jpdl-3.2-patched.jar;lib\jcr-1.0.jar;lib\jgroups-2.2.8.jar;lib\jibx-bind.jar;lib\jibx-run.jar;lib\jid3lib-0.5.jar;lib\JMagick.jar;lib\joda-time-1.2.1.jar;lib\jooconverter-2.1.0.jar;lib\json.jar;lib\jstl-1.1.0.jar;lib\jta.jar;lib\jug.jar;lib\jut.jar;lib\log4j-1.2.8.jar;lib\lucene-analyzers-2.1.0.jar;lib\lucene-core-2.1.0.jar;lib\lucene-snowball-2.1.0.jar;lib\mail.jar;lib\myfaces-api-1.1.5.jar;lib\myfaces-impl-1.1.5.jar;lib\naming-factory.jar;lib\naming-resources.jar;lib\odf_utils.jar;lib\odmg-3.0.jar;lib\openoffice-juh-2.0.3.jar;lib\openoffice-jurt-2.0.3.jar;lib\openoffice-ridl-2.0.3.jar;lib\openoffice-sandbox-2.0.3.jar;lib\openoffice-unoil-2.0.3.jar;lib\opensaml-1.0.1.jar;lib\pdfbox-0.7.3.jar;lib\poi-2.5.1_patched.jar;lib\portlet-api-lib.jar;lib\quartz-1.6.0.jar;lib\resolver.jar;lib\rhino-js-1.6R4.jar;lib\saaj.jar;lib\saxpath.jar;lib\spring-2.0.2.jar;lib\springmodules-jbpm31.jar;lib\standard.jar;lib\tlc124.jar;lib\tm-extractors-0.4_patched.jar;lib\tomcat-coyote.jar;lib\tomcat-util.jar;lib\truezip.jar;lib\wsdl4j-1.5.1.jar;lib\wss4j.jar;lib\xercesImpl-2.8.0.jar;lib\xml-apis.jar;lib\xmlgraphics-commons-1.0.jar;lib\xmlsec-1.4.0.jar;lib\xpp3-1.1.3_8.jar;lib\xstream-1.1.3.jar;..\..\..\common\lib\mysql-connector-java-5.0.3-bin.jar;..\..\..\common\endorsed\serializer.jar;..\..\..\common\endorsed\xalan.jar org.alfresco.tools.Import -user admin -pwd admin -store workspace://SpacesStore -path \sys:system\sys:people people.xml

The people.xml file is:

<?xml version="1.0" encoding="UTF-8"?>
<view:view xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0">
<cm:person view:childName="cm:person">
    <cm:userName>MVAlfresco</cm:userName>
    <cm:firstName>Mark</cm:firstName>
    <cm:lastName>vonAlfresco</cm:lastName>
    <cm:middleName></cm:middleName>
    <!– cm:homeFolder>/${spaces.company_home.childname}/${spaces.user_homes.childname}</cm:homeFolder>
    <cm:homeFolderProvider>bootstrapHomeFolderProvider</cm:homeFolderProvider –>
    <cm:email>ranglin@chem.wisc.edu</cm:email>
</cm:person>
<cm:person view:childName="cm:person">
    <cm:userName>PVAlfresco</cm:userName>
    <cm:firstName>Pat</cm:firstName>
    <cm:lastName>vonAlfresco</cm:lastName>
    <cm:middleName></cm:middleName>
    <!– cm:homeFolder>/${spaces.company_home.childname}/${spaces.user_homes.childname}</cm:homeFolder>
    <cm:homeFolderProvider>bootstrapHomeFolderProvider</cm:homeFolderProvider –>
    <cm:email>ranglin@chem.wisc.edu</cm:email>
</cm:person>
<cm:person view:childName="cm:person">
     <cm:userName>AVAlfresco</cm:userName>
     <cm:firstName>Alice</cm:firstName>
     <cm:lastName>vonAlfresco</cm:lastName>
     <cm:middleName></cm:middleName>
     <!– cm:homeFolder>/${spaces.company_home.childname}/${spaces.user_homes.childname}</cm:homeFolder>
     <cm:homeFolderProvider>bootstrapHomeFolderProvider</cm:homeFolderProvider –>
     <cm:email>ranglin@chem.wisc.edu</cm:email>
</cm:person>
<cm:person view:childName="cm:person">
     <cm:userName>LVAlfresco</cm:userName>
     <cm:firstName>Lee</cm:firstName>
     <cm:lastName>vonAlfresco</cm:lastName>
     <cm:middleName></cm:middleName>
     <!– cm:homeFolder>/${spaces.company_home.childname}/${spaces.user_homes.childname}</cm:homeFolder>
     <cm:homeFolderProvider>bootstrapHomeFolderProvider</cm:homeFolderProvider –>
     <cm:email>ranglin@chem.wisc.edu</cm:email>
</cm:person>
</view:view>

Thanks for your help.

mikeh
Star Contributor
Star Contributor
You don't need to replace forward slashes with backward ones for XPATHs.

It's only file paths that need that formatting on Windows.

Thanks,
Mike

slothrop
Champ in-the-making
Champ in-the-making
Thanks, Mike.

Changing the backslashes for forward slashes in the path allowed me to import users.  They are assigned the Company Home as their home space.  As admin I can't set their user home to be something else.  I get a message that says:
Cyclic parent-child relationship detected

I would like to give these users user homes in a Contributers subspace under the User Homes space.  I haven't tried this since I can't get them their own space in the User Homes space.  Is there a way to give users a home space other than Company Home?

These are just fictitious users that I am trying to import into my development server as a proof of concept.  However, I couldn't go live with this since, as yet, I haven't been able to give users their own space.

My person.xml file is as follows:


<?xml version="1.0" encoding="UTF-8"?>
<view:view xmlns:d="http://www.alfresco.org/model/dictionary/1.0" xmlns:cm="http://www.alfresco.org/model/content/1.0" xmlns:view="http://www.alfresco.org/view/repository/1.0">
<cm:person view:childName="cm:person">
    <cm:userName>MVAlfresco</cm:userName>
    <cm:firstName>Mark</cm:firstName>
    <cm:lastName>vonAlfresco</cm:lastName>
    <cm:middleName></cm:middleName>
    <cm:homeFolder>/${spaces.company_home.childname}/${spaces.user_homes.childname}</cm:homeFolder>
    <cm:defaultHomeFolderPath>/Company Home/User Homes/</cm:defaultHomeFolderPath>
    <cm:homeFolderProvider>personalHomeFolderProvider</cm:homeFolderProvider>
    <cm:email>ranglin@chem.wisc.edu</cm:email>
</cm:person>
<cm:person view:childName="cm:person">
    <cm:userName>PVAlfresco</cm:userName>
    <cm:firstName>Pat</cm:firstName>
    <cm:lastName>vonAlfresco</cm:lastName>
    <cm:middleName></cm:middleName>
    <cm:homeFolder>/${spaces.company_home.childname}/${spaces.user_homes.childname}</cm:homeFolder>
    <cm:defaultHomeFolderPath>/Company Home/User Homes/</cm:defaultHomeFolderPath>
    <cm:homeFolderProvider>personalHomeFolderProvider</cm:homeFolderProvider>
    <cm:email>ranglin@chem.wisc.edu</cm:email>
</cm:person>
<cm:person view:childName="cm:person">
     <cm:userName>AVAlfresco</cm:userName>
     <cm:firstName>Alice</cm:firstName>
     <cm:lastName>vonAlfresco</cm:lastName>
     <cm:middleName></cm:middleName>
     <cm:homeFolder>/${spaces.company_home.childname}/${spaces.user_homes.childname}</cm:homeFolder>
     <cm:defaultHomeFolderPath>/Company Home/User Homes/</cm:defaultHomeFolderPath>
     <cm:homeFolderProvider>personalHomeFolderProvider</cm:homeFolderProvider>
     <cm:email>ranglin@chem.wisc.edu</cm:email>
</cm:person>
<cm:person view:childName="cm:person">
     <cm:userName>LVAlfresco</cm:userName>
     <cm:firstName>Lee</cm:firstName>
     <cm:lastName>vonAlfresco</cm:lastName>
     <cm:middleName></cm:middleName>
     <cm:homeFolder>/${spaces.company_home.childname}/${spaces.user_homes.childname}</cm:homeFolder>
     <cm:defaultHomeFolderPath>/Company Home/User Homes/</cm:defaultHomeFolderPath>
     <cm:homeFolderProvider>personalHomeFolderProvider</cm:homeFolderProvider>
     <cm:email>ranglin@chem.wisc.edu</cm:email>
</cm:person>
</view:view>

I have tried with and without the cm:defaultHomeFolderPath element.  I have tried several HomeFolderProviders including personalHomeFolderProvider, bootstrapHomeFolderProvider and existingPathBasedHomeFolderProvider.  Is their a java class I need to customize to do this?