cancel
Showing results for 
Search instead for 
Did you mean: 

[Half Solved] HTTP WCM deployment receiver subsystem

bnordgren
Champ in-the-making
Champ in-the-making
I'm trying to override or configure a new type of the wcm_deployment_receiver subsystem category, which will publish a deployment receiver engine over HTTP from within the Alfresco repository. (e.g., not standalone).

The details of what I did are here: http://wiki.alfresco.com/wiki/HTTP_Instance_of_WCM_deployment_receiver

Note, however, that most of the contents on that page are my attempt to adapt the "standalone" configuration to the repository environment. Right now, it represents what I expect to work instead of what actually works. And so I now ask for help.  Smiley Very Happy

My first problem with the instructions on that page is that the http subsystem is not recognized and is not started, according to alfresco.log. So I copied the "…/wcm_deployment_receiver/http" directory to "…/wcm_deployment_receiver/default". I believe it is now reading my configuration files (because the first thing it did was complain of a namespace error, which I fixed.) However…

I point my browser to http://localhost:8080/alfresco/deployment and get Tomcat's 404 page. Same story at http://localhost:8080/deployment. My issue, I guess, is that I really don't have a good grasp of how to declare what URL the receiver should use, and hence what URL to type into the authoring server (when I get to that point).

So, two questions:
  1. Why did the original attempt to configure a separate http instance of an existing subsystem fail?

  2. How can I fix the publication of the service such that the URL I need to type into the authoring server is known?
Thanks,
Bryce
PS: On the way to this wiki page, I wrote a lot of individual reference pages on each of the components.  They are all listed on the WCM Deployment category page. Note that everything I wrote is intended to be a "good starting point", so feel free to fix whatever is wrong, or add more pages to more fully describe the DM/AVM deployment targets, etc.
5 REPLIES 5

bnordgren
Champ in-the-making
Champ in-the-making
Whoops, here is the final version of my "deployment-engine-context.xml" file after I edited it:

<?xml version='1.0' encoding='UTF-8'?>
<!–  Deployment engine configuration –>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
   
    <!–  command queue for deployment service –>
    <bean id="deploymentReceiverCommandQueue" class="org.alfresco.deployment.impl.server.DeploymentCommandQueueImpl" >
    </bean>
   
    <!–  Reader management –>
    <bean id="deploymentReaderManagement" class="org.alfresco.deployment.impl.server.ReaderManagementPool" >
    </bean>
   
    <!–  Housekeeper for the deployment queue  –>
    <bean id="commandQueueHousekeeper" class="org.alfresco.deployment.impl.server.DeploymentCommandQueueHousekeeper"
        init-method="init">
        <property name="commandQueue"><ref bean="deploymentReceiverCommandQueue" /></property>
    </bean>
   
    <!– Authentication. Pick one bean and comment the other out. –>
    <!–
    <bean id="targetAuthenticator"
        class="org.alfresco.deployment.impl.server.DeploymentReceiverAuthenticatorSimple">
        <property name="user"><value>${deployment.user}</value></property>
        <property name="password"><value>${deployment.password}</value></property>
    </bean>
    –>
    <bean id="targetAuthenticator"
        class="org.alfresco.repo.deploy.DeploymentReceiverAuthenticatorAuthenticationService"
        init-method="init">
        <property name="authenticationService">
            <ref bean="AuthenticationService"/>
        </property>
    </bean>
   
    <!– This is the deployment engine  –>
    <bean id="deploymentReceiverEngine"
        class="org.alfresco.deployment.impl.server.DeploymentReceiverEngineImpl"
        init-method="init">
       
        <!– These things are "effectively constant" –>
        <property name="commandQueue">
            <ref bean="deploymentReceiverCommandQueue"/>
        </property>       
        <property name="readerManagement">
            <ref bean="deploymentReaderManagement" />
        </property>
        <property name="housekeepers">
            <set>
                <ref bean="commandQueueHousekeeper"/>
            </set>
        </property>
       
        <!– This is configured via the property file –>
        <property name="pollDelay"><value>${deployment.pollDelay}</value></property>
       
        <!–  The authenticator is configured via the above XML –>
        <property name="authenticator">
            <ref bean="targetAuthenticator"/>
        </property>
       
        <!–
            Both "included" transformers are configured by default.
            Delete what you don't want. Rearrange if needed.
        –>
        <property name="transformers">
            <list>
                <bean class="org.alfresco.deployment.transformers.CompressionTransformer"/>
                <bean class="org.alfresco.deployment.transformers.SampleEncryptionTransformer">
                    <property name="cipherName">
                        <value>${deployment.ciphername}</value>
                    </property>
                    <property name="password">
                        <value>${deployment.cipherpass}</value>
                    </property>
                </bean>
            </list>
        </property>
    </bean>
   
    <!– Publish the service –>
    <bean id="deploymentReceiverTransportHTTP"
        class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter"
        p:service-ref="deploymentReceiverEngine">
        <property name="serviceInterface">
            <value>org.alfresco.deployment.DeploymentReceiverTransport</value>
        </property>     
    </bean>
    <bean id="urlMapping"
        class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <props>
                <prop key="/deployment">deploymentReceiverTransportHTTP</prop>
            </props>
        </property>
    </bean>
   
    <!–  Now import the deployment targets –>
    <import resource="classpath*:alfresco/deployment/*-target.xml" />
    <import resource="classpath*:alfresco/extension/deployment/*-target.xml" />
    <import resource="classpath*:alfresco/deployment/http/*-target.xml" />
    <import resource="classpath*:alfresco/extension/deployment/http/*-target.xml" />
   
</beans>

bnordgren
Champ in-the-making
Champ in-the-making
Discovered a bug in my configuration documented here. In essense, there is an additional parameter called "daemonThread" which needs to be set when the receiver engine is running within Alfresco. I added that documentation to the DeploymentReceiverEngine wiki page.

Still no luck configuring an HTTP transport within alfresco.

Oddly, deployment via  RMI still works after I comment out the RMI service exporter ("deploymentReceiverTransportRMI") and replace it with the HTTP service exporter. Presumably because commenting it out in my "overrides" file just means that I failed to override it. I suspect this means that it is impossible to turn off the RMI interface without going into the WEB-INF folder.

bnordgren
Champ in-the-making
Champ in-the-making
FYI, something else I discovered when I enabled encryption and compression:

You need to have the transformers in the same order on the authoring server and the deployment receiver. I had them reversed intentionally, figuring that if one end encrypts, then compresses, the other end must decompress then decrypt. Alfresco appears to reverse one of the two ends for you.

Still no joy getting HTTP transport to work, but now I have encrypted and compressed RMI using Alfresco authentication. I am half thinking of putting in a firewall change request to open the RMI port.

bnordgren
Champ in-the-making
Champ in-the-making
Finally succeeded in disabling RMI. I gave the HTTP transport bean's id the same name as the RMI one. It looks really stupid to have an HTTP service exporter bean with RMI in the id, but this is what must be done.

Currently, this configuration snippet fails to produce any visible results (but perhaps I just don't know what to look for). Note that the deploymentReceiverEngine bean works fine when accessed via RMI.


    <!– Publish the service –>
    <bean id="deploymentReceiverTransportRMI"
        class="org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter">
        <property name="service">
            <ref bean="deploymentReceiverEngine"/>
        </property>
        <property name="serviceInterface">
            <value>org.alfresco.deployment.DeploymentReceiverTransport</value>
        </property>
    </bean>
    <bean id="urlMapping"
        class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <props>
                <prop key="/deployment">deploymentReceiverTransportRMI</prop>
            </props>
        </property>
    </bean>

bnordgren
Champ in-the-making
Champ in-the-making
Current status (and this is where I drop it):

  1. Problem number 1 (configuration of a new http instance) is still unanswered. As a workaround, I've overridden some values from the default instance.

  2. Problem number 2 (publishing the config on the same tomcat server) is fixed. It requires some … inelegant modifications to Alfresco's main web.xml.
The details of my final status are on the wiki. I believe that the modifications to web.xml and the creation of deployment-servlet.xml could be assimilated into the maintained Alfresco config for future releases. This allows users the option of configuring targets for exposure via HTTP.

Two Jira issues result from this.

Suggestions for improved config: http://issues.alfresco.com/jira/browse/ALF-2336

Request for clarification on the subsystem documentation: http://issues.alfresco.com/jira/browse/ALF-2335