Installing Alfresco in JBoss

The Alfresco application is supported in various application servers; one of the supported platforms is JBoss. Installing Alfresco on JBoss requires some additional steps to installing on Tomcat.

Similar to what we did for installing Alfresco in Tomcat, install JDK, the JBoss application server, and the database based on the supported stack and follow the steps below to deploy Alfresco in JBoss. Make sure JBoss is not running. Here, are considering PostgreSQL database.

Refer to the JBoss installation and administration guide for more details on JBoss at: https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.2/index.html

  1. Download the alfresco-enterprise-ear-5.x.x.zip bundle from Alfresco support and extract the .zip bundle under some temporary location; let's call this directory ALFRESCO_TEMP_DEPLOYMENT for future reference. For example, in Windows, if you have extracted Alfresco 5.0.3 within the C directory, the full path will look something like this; C:\ ALFRESCO_TEMP_DEPLOYMENT. On extraction of the .zip file, you can see the directory structure as shown in the screenshot below:
    Installing Alfresco in JBoss
  2. All configurations of Alfresco will go under modules of JBoss. Create a main directory in <JBOSS_HOME>/modules/org/alfresco/configuration.
  3. Create a module.xml file in this main directory with the code snapshot below:
    <module xmlns="urn:jboss:module:1.0" name="org.alfresco.configuration">
    <resources>
        <resource-root path="."/>
    </resources>
    </module>
  4. Now copy all the files from ALFRESCO_TEMP_DEPLOYMENT/web-server/classpath, which is in the temporary folder where the .zip file was extracted, in the main directory created in step 2.
  5. Configure the alfresco-global.properties.sample file under <JBOSS_HOME>/modules/org/alfresco/configuration/main, as we did in a similar way while deploying Alfresco in Tomcat. Remove the .sample extension. Don't configure anything with the database at this point. You can refer to the alfresco-global.properties file provided with the chapter. Also make sure the dir.root command should point to the proper contentstore location. Copy the alf_data directory from ALFRESCO_TEMP_DEPLOYMENT to the location where the binary file will be stored.
  6. Extract the alfresco-enterprise-5.x.x.war file located in the ALFRESCO_TEMP_DEPLOYMENT directory created in step 1. You will have a set of .war files and a META-INF directory. Within META-INF, make sure the file jboss-deployment-structure.xml is set to the proper war configuration location, as shown here. Make sure the highlighted sections are configured properly, this is to link the configuration directory created in step 2 with the .war files.
    <jboss-deployment-structure>
    <sub-deployment name="alfresco.war">
    <dependencies>
    <module name="org.alfresco.configuration" />
    <module name="org.apache.xalan" />
    </dependencies>
    </sub-deployment>
    <sub-deployment name="share.war">
    <dependencies>
    <module name="org.alfresco.configuration" />
    </dependencies>
    </sub-deployment>
    </jboss-deployment-structure>
  7. Assuming we are using a PostgreSQL database, create a directory, org/postgresql/main, under the <JBOSS_HOME>/modules directory. Copy the database connector .jar in the jboss module <JBOSS HOME>/modules/org/postgresql/main directory. For a different database, refer to JBoss configuration on the JBoss website.
  8. Create a module.xml file under the main directory for setting the PostgreSQL .jar location, as shown in the code snapshot below. The PostgreSQL connector .jar name should match with the one deployed in step 7.
    <module xmlns="urn:jboss:module:1.0" name="org.postgresql">
      <resources>
        <resource-root path="postgresql-9.3-1102-jdbc41.jar"/>
      </resources>
      <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
      </dependencies>
    </module>
  9. Now you have to configure the Datasource subsystem to point to the correct database and database connector location. Configure the standalone.xml file located at <JBOSS Home>/standalone/configuration, as shown in the code snapshot below. The highlighted sections show the details to be configured. Make sure the connection URL and database credentials are configured properly. The maximum pool size should be configured based on the thread pool of the application server plus 75 more. If the thread pool size for the application server is 100, the database max connection pool size should be 175. Ensure your database is also configured accordingly. Refer to the standalone.xml file provided with the chapter.
    <datasource jndi-name="java:jboss/PostgresDS" pool-name="jbossdatasource" enabled="true">
      <connection-url>jdbc:postgresql://localhost:5432/postgresdb</connection-url>
        <driver>postgresql</driver>
        <pool>
          <min-pool-size>0</min-pool-size>
          <max-pool-size>20</max-pool-size>
        </pool>
        <security>
          <user-name>alfresco</user-name>
          <password>admin</password>
        </security>
        <validation>
          <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker"/>
          <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter"/>
        </validation>
      </datasource>
    <drivers>
      <driver name="postgresql" module="org.postgresql">
        <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
      </driver>
    </drivers>
  10. Set enable-welcome-root="false" in the standalone.xml file in <JBOSS Home>/standalone/configuration:
    <subsystem xmlns="urn:jboss:domain:web:1.5" default-virtual-server="default-host" native="false">
      <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
      <virtual-server name="default-host" enable-welcome-root="false">
        <alias name="localhost"/>
        <alias name="example.com"/>
      </virtual-server>
    </subsystem>
  11. Unzip the alfresco.war file located in the temporary directory ALFRESCO_TEMP_DEPLOYMENT created in step 6 on extraction of the .ear file. Modify the jboss-context.xml file in WEB-INF to have the proper datasource jndi-name reference created in step 9. Below is the highlighted code snapshot:
    <resource-ref>
    <res-ref-name>jdbc/dataSource</res-ref-name>
    <jndi-name>java:jboss/PostgresDS</jndi-name>
    </resource-ref>
    <resource-ref>
    <res-ref-name>jdbc/activitiIdGeneratorDataSource</res-ref-name>
    <jndi-name>java:jboss/PostgresDS</jndi-name>
    </resource-ref>
  12. There are few issues with Java 8 and the Eclipse compiler for Java. To resolve this issue, you have to install a few additional libraries. Follow the steps below:
    • Download the ECJ4.4 .jar file
    • Update the ecj jar location with the new .jar file name in <JBOSS Home>/modules/system/layers/base/org/jboss/as/web/main/module.xml
  13. The vaadin jar file also need to be updated, so copy the vaadin-application-server-class-loader-workaround-1.0.1.jar from the ALFRESCO_TEMP_DEPLOYMENT/web-server/lib directory to the extracted alfresco.war file WEB-INF/lib created in step 11.
  14. Make sure that proper memory is allocated to JBoss by configuring the standalone.conf file located at <JBOSS Home>/bin.
  15. Configure the standalone.xml file located at <JBOSS Home>/standalone/configuration to set the proper URI encoding. Below is the code snapshot; add this after the extension tag. Refer to the standalone.xml file provided with this chapter.
    <system-properties>
      <property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
      <property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
    </system-properties>
  16. Disable the webservices module in JBoss by commenting out the listed extension below and subsystem tags in the standalone.xml file located at <JBOSS_HOME>/standalone/configuration.
      <extension module="org.jboss.as.webservices"/>
    
      <subsystem xmlns="urn:jboss:domain:webservices:1.2">
        ..
      </subsystem>
  17. Enable Alfresco application logging by configuring standalone.xml. A sample log snippet is to be added within <subsystem xmlns="urn:jboss:domain:logging:1.3"> in the standalone.xml file. Refer to the standalone.xml file provided with this chapter.
    <logger category="org.alfresco.repo.admin">
      <level name="INFO"/>
    </logger>
  18. Again, compress the extracted alfresco.war and alfresco-enterprise-5.x.x.ear files to include the changes. Start the JBoss server.
  19. Open the JBoss Management console, add the Alfresco .ear file created in step 17 in Runtime / Manage Deployments. Click the Enable button and Alfresco will be deployed.
    Installing Alfresco in JBoss
  20. Monitor the logs file for any startup issues.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset