Category Archives: alfresco

Open CMIS – Querying string property results in weird behavior

I'm executing the following SQL query:

SELECT doc.cmis:description, doc.cmis:name
FROM cmis:document doc
WHERE IN_FOLDER(doc,'folderID')

This result in something like below:
doc.cmis:description = "this is description"
doc.cmis:name = "fileName"

Now, if I add following statements, it returns zero result:

and doc.cmis:description = 'this is description'

However, if I modify and-statement with following, it works:

and doc.cmis:description like '%'

If I add one character (but not two interestingly...) as below, it also works:

and doc.cmis:description like '%t%'

It's very interesting to note that and-statement work very well with doc.cmis:name (as well as other properties).

Does anyone have clue as to why this strange / mysterious behavior is occurring?

getting CmisInvalidArgumentException: Extensions tree too wide! while using apache chemistry opencmis

I am a newbie to Apache Chemistry openCMIS.

I am trying to pull a PDF document from the Alfresco repository using its Id. The id is something similar to workspace://SpacesStore/b91dc42c-1644-4246-b3x9-bxx6f0be4wf3

CmisObject object = getSession().getObject(Id);

I am getting the below exception while execute the above line.

org.apache.chemistry.opencmis.commons.exceptions.CmisConnectionException: Parsing exception!

The Exception object does not contain the stackTrace and it contains the cause as below.

org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException: Extensions tree too wide!

But, I dont understand what I am missing. I have another drupal application, that pulls the same PDF without any issue. But this issue happens when I do it thru my java program.

Can anyone please help me out find what I am doing wrong?

UPDATE (ATTACHING THE CODE)

SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, "test");
parameter.put(SessionParameter.PASSWORD, "test");
parameter.put(SessionParameter.ATOMPUB_URL, "http://myurl.com/alfresco/service/cmis");

parameter.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, "us");
parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, "en");
parameter.put(SessionParameter.LOCALE_VARIANT, "");

// Cache config
parameter.put(SessionParameter.CACHE_SIZE_REPOSITORIES, 0);
parameter.put(SessionParameter.CACHE_SIZE_TYPES, 100);
parameter.put(SessionParameter.CACHE_SIZE_OBJECTS, 1000);

//timeout config
parameter.put(SessionParameter.CONNECT_TIMEOUT, 20000);
parameter.put(SessionParameter.READ_TIMEOUT, 60000);
try
{
    Repository soleRepository = (Repository)sessionFactory.getRepositories(parameter).get(0);
    session = soleRepository.createSession();
}
catch(CmisConnectionException e)
{
}
catch(CmisRuntimeException e)
{
}
catch(Exception e)
{
}
session.setDefaultContext(operationContext);

String Id = "workspace://SpacesStore/b91dc42c-1644-4246-b3x9-bxx6f0be4wf3";

CmisObject object = session.getObject(Id);

java.lang.IllegalStateException: Connection factory has been shutdown – Alfresco ERROR solr

When i'm trying to restart Alfresco, it restarts but I saw in the logs of catalina.out this error:

    2015-11-03 21:08:00,063  ERROR [solr.tracker.AbstractTracker] [SolrTrackerScheduler_Worker-2] Tracking failed
     java.lang.IllegalStateException: Connection factory has been shutdown.
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.doGetConnection(MultiThreadedHttpConnectionManager.java:463)
        at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager.getConnectionWithTimeout(MultiThreadedHttpConnectionManager.java:416)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:153)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
        at org.alfresco.httpclient.AbstractHttpClient.executeMethod(AbstractHttpClient.java:135)
        at org.alfresco.httpclient.AbstractHttpClient.sendRemoteRequest(AbstractHttpClient.java:111)
        at org.alfresco.httpclient.HttpClientFactory$HttpsClient.sendRequest(HttpClientFactory.java:385)
        at org.alfresco.solr.client.SOLRAPIClient.getAclChangeSets(SOLRAPIClient.java:155)
        at org.alfresco.solr.tracker.AclTracker.checkRepoAndIndexConsistency(AclTracker.java:347)
        at org.alfresco.solr.tracker.AclTracker.trackRepository(AclTracker.java:313)
        at org.alfresco.solr.tracker.AclTracker.doTrack(AclTracker.java:104)
        at org.alfresco.solr.tracker.AbstractTracker.track(AbstractTracker.java:153)
        at org.alfresco.solr.tracker.TrackerJob.execute(TrackerJob.java:47)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
...

More detailed on:

http://pastebin.com/AAqxVxrx

How can I solve this? What is the error?

java.lang.NoClassDefFoundError: org/springframework/web/context/ContextCleanupListener ERROR

I'm running updating extension on Alfresco and I got this error (despite the extension install anyway and i don't have problems) but I want to solve this problem:

SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
    java.lang.NoClassDefFoundError: org/springframework/web/context/ContextCleanupListener
        at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:145)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5063)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5719)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1028)
        at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1498)
        at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1425)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1646)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:328)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1546)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1556)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1524)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextCleanupListener
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
        ... 16 more

In the maven, I try to put:

 <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>4.2.2.RELEASE</version>
    </dependency>

But this not solves the problem. Any idea?

java.lang.NoClassDefFoundError: org/springframework/web/context/ContextCleanupListener ERROR

I'm running updating extension on Alfresco and I got this error (despite the extension install anyway and i don't have problems) but I want to solve this problem:

SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
    java.lang.NoClassDefFoundError: org/springframework/web/context/ContextCleanupListener
        at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:145)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5063)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5719)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1028)
        at org.apache.catalina.startup.HostConfig.undeploy(HostConfig.java:1498)
        at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1425)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1646)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:328)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1546)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1556)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1524)
        at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextCleanupListener
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
        ... 16 more

In the maven, I try to put:

 <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>4.2.2.RELEASE</version>
    </dependency>

But this not solves the problem. Any idea?

Can Keycloak provide SSO via Apache web service?

I'm trying to use Keycloak as an external authentication service for Alfresco (see: Can Keycloak be used as external (SSO) authentication service for Alfresco and Share?).

I've gotten no responses to my original post, so I'm looking for other ways to skin this cat. Perhaps I could install an Apache web server in front of Alfresco (Tomcat) and use that for remote authentication/SSO. Does anyone know if that is possible? Does anyone have any other ideas? We'd like to use Alfresco in conjunction with our (Java EE) application.

Thanks

Can Keycloak provide SSO via Apache web service?

I'm trying to use Keycloak as an external authentication service for Alfresco (see: Can Keycloak be used as external (SSO) authentication service for Alfresco and Share?).

I've gotten no responses to my original post, so I'm looking for other ways to skin this cat. Perhaps I could install an Apache web server in front of Alfresco (Tomcat) and use that for remote authentication/SSO. Does anyone know if that is possible? Does anyone have any other ideas? We'd like to use Alfresco in conjunction with our (Java EE) application.

Thanks

Getting error when Alfresco community edition 5.0.d is deploying on Geronimo 3.0

When I am deploying Alfresco community edition 5.0.d had following error

Error when deploying on geronimo

The application was not deployed.
web.xml for web app alfresco includes security elements but Geronimo deployment plan is not provided or does not contain element necessary to configure security accordingly.

at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.basicInitContext(AbstractWebModuleBuilder.java:453) 
at org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder.initContext(AbstractWebModuleBuilder.java:436)
at org.apache.geronimo.j2ee.deployment.SwitchingModuleBuilder.initContext(SwitchingModuleBuilder.java:168)
at org.apache.geronimo.j2ee.deployment.EARConfigBuilder.buildConfiguration(EARConfigBuilder.java:686) 
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:256) 
at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:140) 
at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:131) 
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:883) 
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:245) 
at org.apache.geronimo.deployment.plugin.local.AbstractDeployCommand.doDeploy(AbstractDeployCommand.java:116) 
at org.apache.geronimo.deployment.plugin.local.DistributeCommand.run(DistributeCommand.java:61) at java.lang.Thread.run(Thread.java:745)

Server Info

Server:

  1. Version 3.0.0
  2. Build 2012.07.03-20:43:28.321+0800
  3. Start Time Wed Jun 03 21:49:00 IST 2015
  4. Up Time 13 hours 50 minutes 30 seconds

Operating System:

  1. Architecture i386
  2. Name Linux
  3. Version 2.6.32-504.16.2.el6.x86_64
  4. Patch Level unknown
  5. Locale en_US

JVM:

  1. Java Version 1.7.0_79
  2. Java Vendor Oracle Corporation
  3. Node chaminda.alfresco.akaza/127.0.0.1
  4. Current Memory Used 174.76 MB
  5. Most Memory Used 239.99 MB
  6. Total Memory Allocated 253.5 MB
  7. Available Processors 4

System Property values for the Server JVM

  1. java.awt.graphicsenv sun.awt.X11GraphicsEnvironment
  2. java.awt.printerjob sun.print.PSPrinterJob
  3. java.class.path
    /opt/geronimo-tomcat7-javaee6-3.0.0/lib/commons-cli.jar /opt/geronimo-tomcat7-javaee6-3.0.0/lib/geronimo-cli.jar /opt/geronimo-tomcat7-javaee6-3.0.0/lib/geronimo-hook.jar /opt/geronimo-tomcat7-javaee6-3.0.0/lib/geronimo-main.jar /opt/geronimo-tomcat7-javaee6-3.0.0/lib/geronimo-rmi-loader.jar /opt/geronimo-tomcat7-javaee6-3.0.0/lib/karaf-jaas-boot.jar /opt/geronimo-tomcat7-javaee6-3.0.0/lib/agent/transformer.jar
  4. java.class.version 51.0
  5. java.endorsed.dirs
    /opt/geronimo-tomcat7-javaee6-3.0.0/lib/endorsed /opt/jdk1.7.0_79/jre/lib/endorsed
  6. java.ext.dirs /opt/jdk1.7.0_79/jre/lib/ext /usr/java/packages/lib/ext
  7. java.home /opt/jdk1.7.0_79/jre
  8. java.io.tmpdir /opt/geronimo-tomcat7-javaee6-3.0.0/var/temp
  9. java.library.path /usr/java/packages/lib/i386 /lib /usr/lib
  10. java.runtime.name Java(TM) SE Runtime Environment
  11. java.runtime.version 1.7.0_79-b15
  12. java.specification.name Java Platform API Specification
  13. java.specification.vendor Oracle Corporation
  14. java.specification.version 1.7
  15. java.util.prefs.PreferencesFactory
  16. java.vendor- Oracle Corporation
  17. java.version- 1.7.0_79

Apache Ant Build.xml file is missing

I am trying to install and configure Apache Ant 1.9.4 on my VM. I used the Binary distributions setup for Apache Ant 1.9.4 and extracted it to "Documents" folder. Then I add

**ANT_HOME = "C:\Users\xxxx\Documents\Apache-Ant\apache-ant-1.9.4", 
JAVA_HOME = "C:\Program Files\Java\jdk1.8.0_40", 
and Path = "C:\Users\xxxx\Documents\Apache-Ant\apache-ant-1.9.4\bin"**

I am trying to follow the steps below, but I am stuck at Step 4:

  1. Checkout the source from the appropriate SVN repository, as mentioned earlier.

  2. Install and Configure Apache Tomcat.

  3. Set the TOMCAT_HOME environment variable to the root of your Apache Tomcat install directory.

  4. Navigate to the root of the source directory. Then run the default Ant target:

    ant build.xml

  5. It will take few minutes to build everything. When it is done, run the distribute task like this:

    ant –f continuous.xml distribute

  6. Again, it may take several minutes for this to run. When it is done, you should see several archives in the build | dist directory. For example, running this Ant task for Alfresco 3.0 Labs produces several archives. The subset relevant to the book includes:

    a. alfresco-labs-sdk-*.tar.gz

    b. alfresco-labs-sdk-*.zip

    c. alfresco-labs-tomcat-*.tar.gz

    d. alfresco-labs-tomcat-*.zip

    e. alfresco-labs-war-*.tar.gz

    f. alfresco-labs-war-*.zip

    g. alfresco-labs-wcm-*.tar.gz

    h. alfresco-labs-wcm-*.zip

  7. We should extract the SDK archive somewhere handy. The next step will be to import the SDK to eclipse.

The directory of my Apache Ant doesn't have Build.xml. But I need to run 'ant build.xml', so I can continue to follow the remaining steps .

I can go to the root directory of ant but when I run "ant build.xml", then I receive build errors because build.xml is not located into the directory.

Any help/suggestions will be a great help for me. So, it can help me proceeding with remaining steps.

Moving ssl handling from Tomcat to Apache?

In the organisation I work for we are unable to use Tomcat for SSL, since they have a policy of fronting all authentication by managed Apache instances. In this scenario, mod_ssl is used, in conjunction with mod_jk, with the 'REMOTE_USER' being set to 'SSL_CLIENT_S_DN_CN', per http://httpd.apache.org/docs/trunk/mod/mod_ssl.html.

The web application I am dealing (Alfresco) with was designed with the expectation of SSL on the Tomcat container, with a role mapping happening in Tomcat, but I am not sure how to make it work using mod_ssl instead.

From the web.xml, the settings that I am dealing with are:

   <security-constraint>
      <web-resource-collection>
         <web-resource-name>SOLR</web-resource-name>
         <url-pattern>/wcs/api/solr/*</url-pattern>
      </web-resource-collection>

      <auth-constraint>
         <role-name>repoclient</role-name>
      </auth-constraint>

      <user-data-constraint>
         <transport-guarantee>CONFIDENTIAL</transport-guarantee>
      </user-data-constraint>
   </security-constraint>

   <login-config>
      <auth-method>CLIENT-CERT</auth-method>
      <realm-name>Repository</realm-name>
   </login-config>

   <security-role>
     <role-name>repoclient</role-name>
   </security-role>

Any advice would be appreciated. I have looked around to see if there are any tips on how to deal with this, but I haven't had much luck.