02-02-2009 08:25 AM
06-17-2009 03:30 AM
I have the same error trying to access Alfresco suddenly - but on that particular Alfresco installation I did not do anything programmatically, it is quite a default installation.java.lang.IllegalStateException: The org.alfresco.cache.globalConfigCache Cache is not alive.
Why? Any idea about the problem and the solution?
06-17-2009 01:06 PM
12-19-2012 05:16 AM
import org.alfresco.webservice.content.Content;
import org.alfresco.webservice.content.ContentServiceSoapBindingStub;
import org.alfresco.webservice.repository.UpdateResult;
import org.alfresco.webservice.types.CML;
import org.alfresco.webservice.types.CMLAddAspect;
import org.alfresco.webservice.types.CMLCreate;
import org.alfresco.webservice.types.ContentFormat;
import org.alfresco.webservice.types.NamedValue;
import org.alfresco.webservice.types.ParentReference;
import org.alfresco.webservice.types.Predicate;
import org.alfresco.webservice.types.Reference;
import org.alfresco.webservice.types.Store;
import org.alfresco.webservice.util.AuthenticationUtils;
import org.alfresco.webservice.util.Constants;
import org.alfresco.webservice.util.Utils;
import org.alfresco.webservice.util.WebServiceFactory;
public class Spaceunder {
static Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
static String spaceName = "example";
static String path = "/app:company_home/cm:testspace";
private static final int BUFFER_SIZE = 1024;
public static void main(String[] args) {
try {
WebServiceFactory.setEndpointAddress("http://localhost:8888/alfresco/api");
AuthenticationUtils.startSession("admin", "admin");
try{
createSpace();
}catch (Throwable e) {
e.printStackTrace();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
AuthenticationUtils.endSession();
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
private static void createSpace(){
try {
Reference contentReference = new Reference(STORE, null, path+ "/cm:" + spaceName.replace(" ", "_x0020_"));
WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[] { contentReference },STORE, null));
} catch (Exception e) {
try {
// create a folder with instance Id If it is already created it
// will throw Exception
ParentReference parentReference = new ParentReference(STORE, null, path, Constants.ASSOC_CONTAINS,Constants.createQNameString(Constants.NAMESPACE_CONTENT_MODEL,spaceName));
NamedValue[] properties = new NamedValue[] { Utils.createNamedValue(Constants.PROP_NAME, spaceName) };
CMLCreate create = new CMLCreate("1", parentReference,null, null, null, Constants.TYPE_FOLDER, properties);
CML cml = new CML();
cml.setCreate(new CMLCreate[] { create });
WebServiceFactory.getRepositoryService().update(cml);
} catch (Exception e1) {
e1.printStackTrace();
}
}
}
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.