Deploying Alfresco on JBoss

From AlfrescoWiki

(Redirected from Install On Jboss 4.2.0)
Jump to: navigation, search

This guide assumes you are knowledgeable enough with JBoss and MySQL to install them both and create a empty database schema.

  • Download JBoss 4.2.2.GA or JBoss 5.0.1.GA
    • Note: Compatibility with JBoss 5.0.1.GA is currently experimental and only available in the Alfresco Labs nightly builds
  • Download the Alfresco Labs or Enterprise war bundle
  • Extract your JBoss package.
  • Create a new empty database schema instance called 'alfresco' in MySQL - use the example files in the Alfresco bundle in /extra/databases/mysql to perform this with the correct user permissions.
  • Download the MySQL JDBC driver file from MySQL
  • Extract the MySQL JDBC driver .jar file and copy to \jboss\server\default\lib
  • Extract alfresco.war from the alfresco bundle and copy to \jboss\server\default\deploy
  • [Alfresco v3.2 / Nightly builds only] Create a datasource that defines the connection details for your MySQL database by copying \jboss\docs\examples\jca\mysql-ds.xml to \jboss\server\default\deploy and editing with the parameters appropriate for your database. The jndi-name must be changed to alfresco-datasource to match up with alfresco.war. For example:
 <local-tx-datasource>
   <jndi-name>alfresco-datasource</jndi-name>
   <connection-url>jdbc:mysql://localhost:3306/alfresco</connection-url>
   <driver-class>org.gjt.mm.mysql.Driver</driver-class>
   <user-name>alfresco</user-name>
   <password>alfresco</password>
   <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
   <metadata>
      <type-mapping>mySQL</type-mapping>
   </metadata>
 </local-tx-datasource>

  • Edit \jboss\server\default\conf\jboss-log4j.xml to reduce the huge debug log output thus:
  <root>
     <priority value="INFO" />
     <appender-ref ref="CONSOLE"/>
     <appender-ref ref="FILE"/>
  </root>
  • Note that if you are using Alfresco 2.1 the above step is required if you want to start the server on a X11 console without a graphical display (otherwise the Swing JavaScript debugger window will attempt to open on the server machine which will cause an error)
  • [Optional] - Even with the above configuration there will still be a lot of output sent to the console, if you wish you can reduce it further by adding the following to \jboss\server\default\conf\jboss-log4j.xml:
  <category name="org.jboss.logging.Log4jService$URLWatchTimerTask">
     <priority value="INFO"/>
  </category>
  <category name="org.jboss.system.server.Server">
     <priority value="INFO"/>
  </category>
  <category name="org.jboss">
     <priority value="WARN"/>
  </category>
  <category name="net">
     <priority value="WARN"/>
  </category>
  <category name="org.alfresco">
     <priority value="WARN"/>
  </category>
  <category name="org.alfresco.repo.policy">
     <priority value="WARN"/>
  </category>
  <category name="org.springframework">
     <priority value="WARN"/>
  </category>
  <category name="org.hibernate">
     <priority value="WARN"/>
  </category>
  <category name="org.hibernate.cache.ReadWriteCache">
     <priority value="ERROR"/>
  </category>
  <category name="org.hibernate.cache.EhCacheProvider">
     <priority value="ERROR"/>
  </category>
  <category name="org.hibernate.engine.StatefulPersistenceContext.ProxyWarnLog">
     <priority value="ERROR"/>
  </category>
  <category name="org.apache.myfaces">
     <priority value="ERROR"/>
  </category>
  <category name="org.jbpm.jpdl.xml.JpdlXmlReader">
     <priority value="ERROR"/>
  </category>  
  • Edit \jboss\server\default\deploy\ejb3.deployer\META-INF\persistence.properties

and change the line:

hibernate.bytecode.provider=javassist

to:

hibernate.bytecode.provider=cglib
  • Ensure that \jboss\bin\run.sh[.bat] specifies appropriate JVM memory settings in JAVA_OPTS. For example, the following are minimums
-Xms128m -Xmx512m -XX:MaxPermSize=128m
  • In JBoss 5.0.1 and above, edit the filteredPackages property of the WarClassLoaderDeployer bean in \jboss\server\default\deployers\jbossweb.deployer\META-INF\war-deployers-jboss-beans.xml as follows, to avoid collisions between JVM bootstrap classes and those embedded in the war
  <bean name="WarClassLoaderDeployer" class="org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer">
     <property name="relativeOrder">-1</property>
     <property name="filteredPackages">javax.servlet,org.apache.commons.logging,javax.xml,org.xml,org.w3c,org.apache.xmlcommons,org.apache.xerces,org.apache.xml</property>      
  </bean>
  • Execute \jboss\bin\run.sh[.bat]. Note that by default Jboss 4.2 and above will only listen on the localhost network adapter, rather than the adapter with a real IP address connected to the outside world. To override this, start Jboss with the -b addr option, specifying the IP address of the network adapter you want to listen on or 0.0.0.0 to listen on all adapters. E.g.
run.sh -b 0.0.0.0
  • Note that the following warning message will appear in the log but can be ignored, since Alfresco disables the faces RI with a special parameter in web.xml:
[STDOUT] 16:59:43,814 ERROR [shared_impl.config.MyfacesConfig] Both MyFaces and the RI are on your classpath. Please make sure to use only one of the two JSF-implementations.

Back to Server Installation