cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco WCM - File Server Deployment Failing - XML Parsing

bshort
Champ in-the-making
Champ in-the-making
We're running Alfresco 2.1 Enterprise version with the WCM installed on RedHat Linux Enterprise Edition 5.1 running against an Oracle 10g database.

I'd like to get Deployment working using the File System Receiver, but I'm having some issues.

Here is my deployment.properties file:

dep.datadir=depdata
dep.logdir=deplog
dep.metadatadir=depmetadata
dep.rmi.port=44100

Here is my application-context.xml file:

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

<beans>
    <bean id="properties" class="org.springframework.beans.factory.config.Prope\
rtyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
           <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:deployment.properties</value>
            </list>
        </property>
    </bean>
 
   
    <bean id="configuration" class="org.alfresco.deployment.config.Configuration"
          init-method="init">
        <property name="dataDirectory">
            <value>${dep.datadir}</value>
        </property>
        <property name="logDirectory">
            <value>${dep.logdir}</value>
        </property>
        <property name="metaDataDirectory">
            <value>${dep.metadatadir}</value>
        </property>
        <!– Target Configuration. Modify for your site. –>
        <property name="targetData">
            <map>
                <entry key="default">
                    <map>
                        <entry key="root"><value>/opt/www</value></entry>
                        <entry key="user"><value>admin</value></entry>
                        <entry key="password"><value>admin</value></entry>
                        <entry key="runnable"><value>org.alfresco.deployment.SampleRunnable</value></entry>
                        <!–
                        <entry key="program"><value>/path/to/program</value></entry>
                         –>
                    </map>
                </entry>
               <entry key="sampleTarget">
                   <map>
                     <entry key="root"><value>/opt/www2</value></entry>
                     <entry key="user"><value>admin</value></entry>
                     <entry key="password"><value>admin</value></entry>
                     <entry key="runnable"><value>org.alfresco.deployment.SampleRunnable</value></entry>
                     <!–
                     <entry key="program"><value>/path/to/program</value></entry>
                      –>
                   </map>
               </entry>
            </map>
        </property>
    </bean>
   
    <bean id="deploymentReceiverService" class="org.alfresco.deployment.impl.server.DeploymentReceiverServiceImpl"
          init-method="init">
        <property name="configuration">
            <ref bean="configuration"/>
        </property>
    </bean>
   
    <bean id="deploymentReceiverTransport" class="org.alfresco.deployment.impl.server.DeploymentReceiverTransportImpl">
        <property name="deploymentReceiverService">
            <ref bean="deploymentReceiverService"/>
        </property>
    </bean>
   
        <bean id="deploymentReceiverTransportRMI" class="org.springframework.remoting.rmi.RmiServiceExporter">
                <property name="service">
                        <ref bean="deploymentReceiverTransport"/>
                </property>
                <property name="serviceInterface">
                        <value>org.alfresco.deployment.DeploymentReceiverTransport</value>
                </property>
                <property name="serviceName">
                        <value>deployment</value>
                </property>
                <property name="registryPort">
                        <value>${dep.rmi.port}</value>
                </property>
        </bean>
</beans>


The IPTables on the box is set up to allow 44100

The deployment directory looks like this:
/opt/deployment
                         /depdata
                         /deptemp
                         /deplogs

I'm trying to deploy to /opt/www and it's current permission bits are:
drwxrwxrwx  2 root       root       4096 Mar 14 14:28 www



Here's the error I'm getting:

19-Mar-08 11:31:21 AM org.springframework.core.CollectionFactory <clinit>
INFO: JDK 1.4+ collections available
19-Mar-08 11:31:21 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [/opt/deployment/application-context.xml]
Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unexpected failure during bean definition parsing
Offending resource: file [/opt/deployment/application-context.xml]
Bean 'properties'; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: <property> element for property 'ignoreUnr\
esolvablePlaceholders' is only allowed to contain either 'ref' attribute OR 'value' attribute OR sub-element
Offending resource: file [/opt/deployment/application-context.xml]
Bean 'properties'
        -> Property 'ignoreUnresolvablePlaceholders'
Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: <property> element for property 'ignoreUnresolvablePlaceholders' is on\
ly allowed to contain either 'ref' attribute OR 'value' attribute OR sub-element
Offending resource: file [/opt/deployment/application-context.xml]
Bean 'properties'
        -> Property 'ignoreUnresolvablePlaceholders'

This doesn't make any sense to me at all. I've also tried setting the value attribute on a singleton property tag like this:
<property name="ignoreUnresolvablePlaceholders" value="true" />

But that resulted in the same error.

How should this property tag be written to avoid this error?

Thanks,
-Brian Short
9 REPLIES 9

pmonks
Star Contributor
Star Contributor
It looks like the problem might be on the two previous lines:
<bean id="properties" class="org.springframework.beans.factory.config.Prope\
rtyPlaceholderConfigurer">
(this needs to be a single line without the '\' character).  In fact the DOCTYPE declaration has the same problem too:
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.or\
g/dtd/spring-beans.dtd'>
If that's just an artifact of posting to the forum, let me know and I'll take a closer look at it.

Cheers,
Peter

bshort
Champ in-the-making
Champ in-the-making
This is just an artifact of posting in the forum. The linebreaks obviously aren't there in the actual files.

I was able to get around some of this by referring to a newer version of java:

Here's the new error:

Mar 21, 2008 3:29:21 PM org.springframework.core.CollectionFactory <clinit>
INFO: JDK 1.4+ collections available
Mar 21, 2008 3:29:21 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [/opt/deployment/application-context.xml]
Mar 21, 2008 3:29:21 PM org.springframework.context.support.AbstractRefreshableApplicationContext refreshBeanFactory
INFO: Bean factory for application context [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=3203712]: org.springframework.beans.factory.support.Defau\
ltListableBeanFactory defining beans [properties,configuration,deploymentReceiverService,deploymentReceiverTransport,deploymentReceiverTransportRMI]; root of BeanFactory hierarch\
y
Mar 21, 2008 3:29:21 PM org.springframework.context.support.AbstractApplicationContext refresh
INFO: 5 beans defined in application context [org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=3203712]
Mar 21, 2008 3:29:21 PM org.springframework.core.io.support.PropertiesLoaderSupport loadProperties
INFO: Loading properties file from class path resource [deployment.properties]
Mar 21, 2008 3:29:21 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [properties,configuration,deploymentReceiverService,deployment\
ReceiverTransport,deploymentReceiverTransportRMI]; root of BeanFactory hierarchy}
Exception in thread "main" org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path\
resource [deployment.properties] cannot be opened because it does not exist
Caused by: java.io.FileNotFoundException: class path resource [deployment.properties] cannot be opened because it does not exist
        at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:135)
        at org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:179)
        at org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:158)
        at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:69)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:414)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
        at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:89)
        at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:74)
        at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:65)
        at org.alfresco.deployment.Main.main(Main.java:47)

pmonks
Star Contributor
Star Contributor
This latest exception indicates that Spring is unable to find the "deployment.properties" file in the classpath.  Are you starting the FileSystem Receiver using the "deploy_start.sh" command, or manually?

Either way, it's critical that the directory the FSR is installed into is in the classpath.  The best way to do this (which is used by the "deploy_start.sh" script as of 2.2 - not sure about earlier versions) is to use the following JVM startup parameter:

-Djava.ext.dirs=[directory in which FSR is installed]
Cheers,
Peter

bshort
Champ in-the-making
Champ in-the-making
Peter that seemed to work!

Thank you for your help,
-Brian

jameskinley
Champ in-the-making
Champ in-the-making
Hi,

I am getting the same error with FSR v2.2?
I have checked the deploy_start.sh script and the classpath parameter is being set "-Djava.ext.dirs=."

Any ideas?

Thanks, James.

mrogers
Star Contributor
Star Contributor
Are you running deploy_start.sh in the correct directory or pulling it off a PATH?

jameskinley
Champ in-the-making
Champ in-the-making
I'm running deploy_start.sh from within the "/opt/Alfresco/Deployment" directory (the default install location).

pmonks
Star Contributor
Star Contributor
Is there a deployment.properties file in /opt/Alfresco/Deployment?

Cheers,
Peter

pawanawaits
Champ in-the-making
Champ in-the-making
Can anybody post the sample deploy_start.sh

I want to configure it correctly. showing the same error logs. But unable to configure deployment.properties

Thanks!