cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Cascading Constraints

thestorm
Champ in-the-making
Champ in-the-making
Hey people,

i found the Cascading Constraints from Jean Barmash (http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/)and need them for my current project. What i wanna do is to generate the List of values out of spaces that are in my customer folder. My problem is now to set the Lucene query for the constraint.


<constraint name=”my:customConstraint”
type=”org.alfresco.sample.constraints.LuceneSearchBasedListConstraint” >
<parameter name=”query”>
<value> TYPE:”{http://www.alfresco.org/model/content/1.0}folder” AND@\http://www.alfresco.org/model/content/1.0\}name:'Customer"
</value>
</parameter>
</constraint>

I get following error in the log file:


22:35:01,259 User:System ERROR [web.context.ContextLoader] Context initialization failed
net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A valid SecureContext was not provided in the RequestContext
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:477)
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:355)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy23.query(Unknown Source)
        at org.alfresco.sample.constraints.LuceneSearchBasedListConstraint.getSearchResult(LuceneSearchBasedListConstraint.java:69)
        at org.alfresco.sample.constraints.SearchBasedListConstraint.getAllowedValues(SearchBasedListConstraint.java:62)

I think it is related to my Lucene query not working. Can some1 please help me.
27 REPLIES 27

jbarmash
Champ in-the-making
Champ in-the-making
Does the query work in the Node Browser?  Make sure it returns what you need before putting it into the config - from the snippet you provided it looks like you need a space after AND. 

TYPE:”{http://www.alfresco.org/model/content/1.0}folder” AND@\http://www.alfresco.org/model/content/1.0\}name:'Customer"



Jean

thestorm
Champ in-the-making
Champ in-the-making
k fixed that.

     <constraint name="my:customConstraint"
       type="org.alfresco.sample.constraints.LuceneSearchBasedListConstraint" >
       <parameter name="query">
         <value> PATH:"/app:company_home/cm:ComTeam_x0020_AG/cm:Kunden/*" AND TYPE:"{http://www.alfresco.org/model/content/1.0}folder"
         </value>
       </parameter>
     </constraint>


then i get following error:


03:41:14,374 User:System ERROR [web.context.ContextLoader] Context initialization failed
net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A valid SecureContext was not provided in the RequestContext
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:477)
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:355)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy23.query(Unknown Source)
        at org.alfresco.sample.constraints.LuceneSearchBasedListConstraint.getSearchResult(LuceneSearchBasedListConstraint.java:69)
        at org.alfresco.sample.constraints.SearchBasedListConstraint.getAllowedValues(SearchBasedListConstraint.java:62)
        at org.alfresco.cmis.dictionary.CMISBasePropertyDefinition.<init>(CMISBasePropertyDefinition.java:108)
        at org.alfresco.cmis.dictionary.CMISAbstractTypeDefinition.createProperty(CMISAbstractTypeDefinition.java:126)
        at org.alfresco.cmis.dictionary.CMISAbstractTypeDefinition.createProperties(CMISAbstractTypeDefinition.java:104)
        at org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.init(CMISAbstractDictionaryService.java:394)
        at org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.afterDictionaryInit(CMISAbstractDictionaryService.java:465)
        at org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.onBootstrap(CMISAbstractDictionaryService.java:483)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:617)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:69)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

and in the localhost log file:

23.07.2009 05:01:54 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
23.07.2009 05:04:15 org.apache.catalina.core.StandardContext listenerStart
SCHWERWIEGEND: Exception sending context initialized event to listener instance of class org.alfresco.web.app.ContextLoaderListener
net.sf.acegisecurity.AuthenticationCredentialsNotFoundException: A valid SecureContext was not provided in the RequestContext
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:477)
        at net.sf.acegisecurity.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:355)
        at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:77)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:275)
        at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy23.query(Unknown Source)
        at org.alfresco.sample.constraints.LuceneSearchBasedListConstraint.getSearchResult(LuceneSearchBasedListConstraint.java:69)
        at org.alfresco.sample.constraints.SearchBasedListConstraint.getAllowedValues(SearchBasedListConstraint.java:62)
        at org.alfresco.cmis.dictionary.CMISBasePropertyDefinition.<init>(CMISBasePropertyDefinition.java:108)
        at org.alfresco.cmis.dictionary.CMISAbstractTypeDefinition.createProperty(CMISAbstractTypeDefinition.java:126)
        at org.alfresco.cmis.dictionary.CMISAbstractTypeDefinition.createProperties(CMISAbstractTypeDefinition.java:104)
        at org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.init(CMISAbstractDictionaryService.java:394)
        at org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.afterDictionaryInit(CMISAbstractDictionaryService.java:465)
        at org.alfresco.cmis.dictionary.CMISAbstractDictionaryService.onBootstrap(CMISAbstractDictionaryService.java:483)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:62)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:75)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:617)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:355)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:69)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:627)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

(i get same error if i use <value> TYPE:"{http://www.alfresco.org/model/content/1.0}content" </value>)

customModel.xml


<?xml version="1.0" encoding="UTF-8"?>

<!– Custom Model –>

<model name="custom:customModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Custom Model</description>
   <author></author>
   <version>1.0</version>

   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
   </imports>

   <namespaces>
      <namespace uri="custom.model" prefix="custom"/>
   </namespaces>

<!– ComTeam AG –>

<!– Mandatory List –>
   <constraints>

     <constraint name="custon:Kundenliste"
       type="org.alfresco.sample.constraints.LuceneSearchBasedListConstraint" >
       <parameter name="query">
         <value> PATH:"/app:company_home/cm:ComTeam_x0020_AG/cm:Kunden/*" AND TYPE:"{http://www.alfresco.org/model/content/1.0}folder"
         </value>
       </parameter>
     </constraint>
</constraints>
<types>
—————
</types>
<aspects>
        <aspect name="custom:Kunde">
                <title>Kunde</title>
                <properties>
                 <property name="custom:Kunde">
                 <title>Kunde</title>
                 <type>d:text</type>
                 <mandatory>true</mandatory>
                <constraints>
                 <constraint ref="custom:Kundenliste" />
                </constraints>
                </property>
                <property name="custom:Mitarbeiter">
                 <title>Mitarbeiter</title>
                 <type>d:text</type>
                 <mandatory>true</mandatory>
                </property>
                </properties>
        </aspect>
</aspects>
</model>

custom-model-context.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

        <bean id="LuceneSearchBasedListConstraintInitializer"
                class="org.alfresco.sample.constraints.LuceneSearchBasedListConstraint">

                <property name="serviceRegistry">
                        <ref bean="ServiceRegistry"/>
                </property>
        </bean>


    <!– Registration of new models –>
    <bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/customModel.xml</value>
            </list>
        </property>
    </bean>

</beans>

cant see any mistake


/edit:

if i change type="org.alfresco.sample.constraints.LuceneSearchBasedListConstraint" to type="org.alfresco.sample.constraints.SearchBasedListConstraint"

I get the error that instance of org.alfresco.sample.constraints.SearchBasedListConstraint cant be created with condition custom:Kundenliste

but i have no clue where the mistake is -.-

jbarmash
Champ in-the-making
Champ in-the-making
Nothing jumps out at me here, sorry. 

Which version of Alfresco are you using?   Presence of CMIS references in the stack trace tells me it's 3.1 or 3.2.    The original code was written in 3.0.  I know they redid security in 3.2 significantly, so I wonder if this is interfering somehow and is the reason why you are seeing the exceptions related to security. 

I'd try to get back to the basics a bit - i.e. make sure you can have a constraint that does a null search that doesn't depend on your custom model.  This will at least tell you if the problem is that some of the infrastructure has changed around the call to SearchService, or whether it's something else. 

Also, maybe try to inline the constraint definition, as opposed to having it separate in constraints section.

Jean

thestorm
Champ in-the-making
Champ in-the-making
yes its v3.2

I can setup a 3.0 with same customModel and try if i get same error, maybe that helps.

For me that sounds like i cant perform the search query cause there is no authed user to do so.

jbarmash
Champ in-the-making
Champ in-the-making
I wouldn't be surprised if a lot of the infrastructure has changed.  One place to check is configuration - perhaps something new needs to be configured for the constraints that wasn't before.  I don't have a 3.2 installation handy, so I can't retry, sorry. 

For me that sounds like i cant perform the search query cause there is no authed user to do so.

Yeah, sounds like it, which is a bit strange, since you are likely running while being logged into the Explorer, thereby it should pick up your security context.

thestorm
Champ in-the-making
Champ in-the-making
this is a bootup error so it cant have my security context

/edit:

same config version 3.0 works

hope Alfresco is intrested in including this to V3.2 also, since its very usefull.

now I'm working on a dependent dropdown.

Its looking good already. But when my Alfresco loads the "Edit Properties" page i get:


javax.faces.FacesException: org.alfresco.repo.search.SearcherException: Failed to parse query: PATH:"/app:company_home/cm:ComTeam_x20020_AG/cm:${custom:AKunde}/cm:_x0030_2_x0020_Auftragsordner/*" AND TYPE:"{http://www.alfresco.org/model/content/1.0}folder"
caused by:
org.apache.jasper.JasperException: org.alfresco.repo.search.SearcherException: Failed to parse query: PATH:"/app:company_home/cm:ComTeam_x20020_AG/cm:${custom:AKunde}/cm:_x0030_2_x0020_Auftragsordner/*" AND TYPE:"{http://www.alfresco.org/model/content/1.0}folder"
caused by:
org.alfresco.repo.search.SearcherException: Failed to parse query: PATH:"/app:company_home/cm:ComTeam_x20020_AG/cm:${custom:AKunde}/cm:_x0030_2_x0020_Auftragsordner/*" AND TYPE:"{http://www.alfresco.org/model/content/1.0}folder"
caused by:
org.alfresco.repo.search.impl.lucene.ParseException: Failed to parse XPath…
Unexpected '$'

it says Unexpected $

my constraint is:


     <constraint name="custom:Auftragsliste" type="org.alfresco.sample.constraints.LuceneSearchBasedListConstraint" >
        <parameter name="query">
        <value> PATH:"/app:company_home/cm:ComTeam_x20020_AG/cm:${custom:AKunde}/cm:_x0030_2_x0020_Auftragsordner/*" AND TYPE:"{http://www.alfresco.org/model/content/1.0}folder" </value>
        </parameter>
     </constraint>

some hints?

for me the problem seems to be that lucene gets parsed my placeholder query instead of replaxing ${custom:AKunde} with the value of the property.

thestorm
Champ in-the-making
Champ in-the-making
still actual topic pls help

jbarmash
Champ in-the-making
Champ in-the-making
Sorry for delay - finally had a chance to look at it.  

It looks like you are using the wrong constraint (LuceneSearchBasedListConstraint).  Try SearchBasedDependencyListConstraint - that's the one that handles substitutions.

thestorm
Champ in-the-making
Champ in-the-making
i tryed that (also ur example says sth different).

Thats the error then:


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'extension.dictionaryBootstrap' defined in file [/opt/Alfresco/tomcat/shared/classes/alfresco/extension/custom-model-context.xml]: Invocation of init$
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/extension/customModel.xml
        at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:147)
        at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:108)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1240)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1205)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to compile model custom:customModel
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:112)
        at org.alfresco.repo.dictionary.M2Model.compile(M2Model.java:134)
        at org.alfresco.repo.dictionary.DictionaryDAOImpl.putModel(DictionaryDAOImpl.java:217)
        at org.alfresco.repo.dictionary.DictionaryBootstrap.initDictionary(DictionaryBootstrap.java:143)
        … 42 more
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to construct an instance of type 'org.alfresco.sample.constraints.SearchBasedDependencyListConstraint' for constraint 'custom:Auftragsliste'
        at org.alfresco.repo.dictionary.M2ConstraintDefinition.resolveInternal(M2ConstraintDefinition.java:192)
        at org.alfresco.repo.dictionary.M2ConstraintDefinition.resolveDependencies(M2ConstraintDefinition.java:125)
        at org.alfresco.repo.dictionary.CompiledModel.<init>(CompiledModel.java:107)
        … 45 more

if its a LuceneSearchBasedListConstraint i can compile it?!

my constraint is that:


          <constraint name="custom:Auftragsliste"
       type="org.alfresco.sample.constraints.SearchBasedDependencyListConstraint" >

        <parameter name="query">
        <value> PATH:"/app:company_home/cm:ComTeam_x20020_AG/cm:${custom:AKunde}/cm:_x0030_2_x0020_Auftragsordner/*" AND TYPE:"{http://www.alfresco.org/model/content/1.0}folder" </value>
        </parameter>
     </constraint>

and i set the property like that:


                 <property name="custom:AAuftrag">
                 <title>Auftrag:</title>
                 <type>d:text</type>
                 <mandatory>true</mandatory>
                 <index enabled="true">
                  <atomic>true</atomic>
                  <stored>false</stored>
                  <tokenised>false</tokenised>
                 </index>
                <constraints>
                 <constraint ref="custom:Auftragsliste" />
                </constraints>
                </property>

web-client-config-custom:


   <config evaluator="aspect-name" condition="custom:Kunde">
        <property-sheet>
            <show-property name="custom:AKunde" component-generator="CustomListComponentGeneratorWithRefresh"/>
            <show-property name="custom:AMitarbeiter"/>
            <show-property name="custom:AProduktformat"/>
            <show-property name="custom:AAuftrag" component-generator="CustomDependentListComponentGenerator"/>
        </property-sheet>
   </config>


Failed to construct an instance of type 'org.alfresco.sample.constraints.SearchBasedDependencyListConstraint'

why is he failing to create the instance? do i need to provide any default value maybe for the dynamic list of custom:AKunde (generated out of a Space) but normally that should be handled by custom component generator….

have no clue what to try