Deploying WAR JBoss

From AlfrescoWiki

(Redirected from Alfresco on JBoss)
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. Note, this guide also works for Jboss 4.0.3 if you additionally follow the myfaces jar replacement steps at the end of the guide.


  • Download JBoss 4.0.5.GA or JBoss 4.2.1.GA and alfresco-community-war-1.4.0 or alfresco-community-war-2.0.0 or alfresco-community-war-2.1.0 from sourceforge.
  • 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
  • If using JBoss4.0.X, open alfresco.war in an archival tool (such as 7-Zip, WinZIP or WinRAR) and remove the file /WEB-INF/lib/log4j-1.2.8.jar.
  • Also remove /WEB-INF/lib/jta.jar if you plan on using JTA.
  • Edit \jboss\server\default\conf\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\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>  
  • If you are using JBoss4.2.X please follow these additional steps Install_On_Jboss_4.2.0
  • Edit the JBoss bin/run.bat or run.sh file and add to the JAVA_OPTS line: -XX:MaxPermSize=128m -server
  • Execute run.bat or run.sh from \jboss\bin
  • After server start browse to URL http://localhost:8080/alfresco
  • Login as admin/admin


If you get any myfaces issues you can do the following to resolve them:

Replace myfaces jar files in: \jboss\server\default\deploy\jbossweb-tomcat55.sar\jsf-libs With ones from the Alfresco war.


Update: Another way is to adapt web.xml by adding following lines (See http://wiki.jboss.org/wiki/Wiki.jsp?page=JBoss5AndMyFaces for more information):

  <context-param>
     <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
     <param-value>true</param-value>
  </context-param> 

Note that after changing web.xml the exceptions were gone, but a warning message appeared in the log instead:

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.


Note: You may need to adjust the JVM memory settings if you deploy Alfresco with the "default" JBoss configuration (ie. loading alot of extra stuff). In my case, the WAR would start to deploy and the CPU would peg indefinitely until I set the following in JBOSS_HOME/bin/run.sh: JAVA_OPTS="-Xms512m -Xmx1G -XX:MaxPermSize=128m"


Back to Server Installation