cancel
Showing results for 
Search instead for 
Did you mean: 

Singleton attribute invalid when trying to bootstrap folder

kartech11
Confirmed Champ
Confirmed Champ

I am currently looking to bootstrap my sites and folders to alfresco 5.2.3 enterprise server. I want to create a folder under Company Home/Data Dictionary

I have included the below bean to my bootstrap-context.xml. But I get the error that attribute singleton is not allowed to appear in element bean. 

Error trace

Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:alfresco/module/alfresco-bootstrap-platform-jar/context/bootstrap-context.xml]
Offending resource: URL [jar:file:/C:/dev/workspaces/intellij-workspaces/alfresco-bootstrap/target/tomcat/webapps/alfresco-bootstrap-platform/WEB-INF/lib/alfresco-bootstrap-platform-jar-1.0-SNAPSHOT.jar!/alfresco/module/alfresco-bootstrap-platform-jar/module-context.xml]; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 19 in XML document from class path resource [alfresco/module/alfresco-bootstrap-platform-jar/context/bootstrap-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 19; columnNumber: 85; cvc-complex-type.3.2.2: Attribute 'singleton' is not `
at 
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 19 in XML document from class path resource [alfresco/module/alfresco-bootstrap-platform-jar/context/bootstrap-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 19; columnNumber: 85; cvc-complex-type.3.2.2: Attribute 'singleton' is not allowed to appear in element 'bean'.
at 

bootstrap-context.xml as below

<bean id="customSpacesBootstrap" parent="spacesStoreImporter" singleton="true" >
    <property name="useExistingStore">
        <value>${alfresco-bootstrap-platform-jar.bootstrap.data}</value>
    </property>
    <property name="bootstrapViews">
        <list>
            <props>
                <prop key="path">/${spaces.company_home.childname}/${spaces.dictionary.childname}</prop>
                <prop key="location">alfresco/module/alfresco-bootstrap-platform-jar/bootstrap/config_email_templates.xml</prop>
            </props>
        </list>
    </property>
</bean>

My config_email_templates.xml file has the below content

<view:view xmlns:view='http://www.alfresco.org/view/repository/1.0'
           xmlns:cm='http://www.alfresco.org/model/content/1.0' xmlns:app='http://www.alfresco.org/model/application/1.0'>

    <cm:folder view:childName='cm:My First Folder'>
        <app:uifacets />
        <cm:name>My First Folder</cm:name>
        <app:icon>space-icon-default</app:icon>
        <cm:title>My First Folder</cm:title>
        <cm:description></cm:description>
    </cm:folder>
</view:view>
1 ACCEPTED ANSWER

kartech11
Confirmed Champ
Confirmed Champ

As pointed out the documentation seems a bit outdated and one does not need to use the 'singleton' attribute, by default the beans are singletons in spring. Alfresco as such does not need this property to be defined. 

View answer in original post

4 REPLIES 4

krutik_jayswal
Elite Collaborator
Elite Collaborator

Why you would like to have it as singleton?

I think in spring by default its singleton, so I can actually remove it. But I was not sure if alfresco had any expectation to have this attribute passed in .

I removed the singleton attribute and alfresco started without any issues? I am trying this out for the first time, so what is actually "spaces.company_home.childname" and I dont see my folder created as of yet. Where should I look for my newly created folder under repository browser?


					
				
			
			
				
			
			
			
			
			
			
			
		

kartech11
Confirmed Champ
Confirmed Champ

As pointed out the documentation seems a bit outdated and one does not need to use the 'singleton' attribute, by default the beans are singletons in spring. Alfresco as such does not need this property to be defined.