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 v3.2 Community Release.
  • Download the Alfresco Community 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\deploy\jboss-web.deployer\server.xml and \jboss\server\all\deploy\jboss-web.deployer\server.xml and add URIEncoding="UTF-8" to the section:
   <Connector port="8080" address="${jboss.bind.address}" 
        maxThreads="250" maxHttpHeaderSize="8192"
For example:
   <Connector port="8080" URIEncoding="UTF-8" address="${jboss.bind.address}" 
        maxThreads="250" maxHttpHeaderSize="8192"
  • 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

Note that on JBoss5 and above, the value can be found in \jboss\server\default\deployers\ejb3.deployer\META-INF\jpa-deployers-jboss-beans.xml

<entry>
  <key>hibernate.bytecode.provider</key>
  <value>cglib</value>
</entry>
  • 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
  • To enable JMX monitoring and automatic discovery of Alfresco by the Hyperic plugin, ensure JAVA_OPTS contains the following arguments:
-Dcom.sun.management.jmxremote -Dalfresco.home=.
  • 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,javax.servlet.jsp,javax.servlet.jsp.jstl,javax.servlet.jsp.jstl.core,javax.servlet.jsp.jstl.fmt,javax.servlet.jsp.jstl.sql,javax.servlet.jsp.jstl.tlv,javax.xml,javax.xml.bind,javax.xml.bind.annotation,javax.xml.bind.annotation.adapters,javax.xml.bind.attachment,javax.xml.bind.helpers,javax.xml.bind.util,javax.xml.crypto,javax.xml.crypto.dom,javax.xml.crypto.dsig,javax.xml.crypto.dsig.dom,javax.xml.crypto.dsig.keyinfo,javax.xml.crypto.dsig.spec,javax.xml.datatype,javax.xml.messaging,javax.xml.namespace,javax.xml.parsers,javax.xml.rpc,javax.xml.rpc.encoding,javax.xml.rpc.handler,javax.xml.rpc.handler.soap,javax.xml.rpc.holders,javax.xml.rpc.server,javax.xml.rpc.soap,javax.xml.soap,javax.xml.stream,javax.xml.stream.events,javax.xml.stream.util,javax.xml.transform,javax.xml.transform.dom,javax.xml.transform.sax,javax.xml.transform.stream,javax.xml.validation,javax.xml.ws,javax.xml.ws.handler,javax.xml.ws.handler.soap,javax.xml.ws.http,javax.xml.ws.soap,javax.xml.ws.spi,javax.xml.ws.wsaddressing,javax.xml.xpath,org.apache.commons.logging,org.apache.commons.logging.impl,org.apache.xerces,org.apache.xerces.dom,org.apache.xerces.dom.events,org.apache.xerces.dom3,org.apache.xerces.dom3.as,org.apache.xerces.impl,org.apache.xerces.impl.dtd,org.apache.xerces.impl.dtd.models,org.apache.xerces.impl.dv,org.apache.xerces.impl.dv.dtd,org.apache.xerces.impl.dv.util,org.apache.xerces.impl.dv.xs,org.apache.xerces.impl.io,org.apache.xerces.impl.msg,org.apache.xerces.impl.validation,org.apache.xerces.impl.xpath,org.apache.xerces.impl.xpath.regex,org.apache.xerces.impl.xs,org.apache.xerces.impl.xs.identity,org.apache.xerces.impl.xs.models,org.apache.xerces.impl.xs.opti,org.apache.xerces.impl.xs.traversers,org.apache.xerces.impl.xs.util,org.apache.xerces.jaxp,org.apache.xerces.jaxp.datatype,org.apache.xerces.jaxp.validation,org.apache.xerces.parsers,org.apache.xerces.util,org.apache.xerces.xinclude,org.apache.xerces.xni,org.apache.xerces.xni.grammars,org.apache.xerces.xni.parser,org.apache.xerces.xpointer,org.apache.xerces.xs,org.apache.xerces.xs.datatypes,org.apache.xml,org.apache.xml.resolver,org.apache.xml.resolver.apps,org.apache.xml.resolver.etc,org.apache.xml.resolver.etc.catalog.dtd,org.apache.xml.resolver.etc.catalog.rng,org.apache.xml.resolver.etc.catalog.xsd,org.apache.xml.resolver.etc.xcatalog.dtd,org.apache.xml.resolver.helpers,org.apache.xml.resolver.readers,org.apache.xml.resolver.tools,org.apache.xml.security,org.apache.xml.security.algorithms,org.apache.xml.security.algorithms.implementations,org.apache.xml.security.c14n,org.apache.xml.security.c14n.helper,org.apache.xml.security.c14n.implementations,org.apache.xml.security.encryption,org.apache.xml.security.exceptions,org.apache.xml.security.keys,org.apache.xml.security.keys.content,org.apache.xml.security.keys.content.keyvalues,org.apache.xml.security.keys.content.x509,org.apache.xml.security.keys.keyresolver,org.apache.xml.security.keys.keyresolver.implementations,org.apache.xml.security.keys.storage,org.apache.xml.security.keys.storage.implementations,org.apache.xml.security.resource,org.apache.xml.security.resource.schema,org.apache.xml.security.signature,org.apache.xml.security.transforms,org.apache.xml.security.transforms.implementations,org.apache.xml.security.transforms.params,org.apache.xml.security.utils,org.apache.xml.security.utils.resolver,org.apache.xml.security.utils.resolver.implementations,org.apache.xml.serialize,org.apache.xmlcommons,org.xml,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,org.w3c,org.w3c.css,org.w3c.css.sac,org.w3c.css.sac.helpers,org.w3c.dom,org.w3c.dom.bootstrap,org.w3c.dom.css,org.w3c.dom.events,org.w3c.dom.html,org.w3c.dom.ls,org.w3c.dom.ranges,org.w3c.dom.smil,org.w3c.dom.stylesheets,org.w3c.dom.svg,org.w3c.dom.traversal,org.w3c.dom.views,org.w3c.dom.xpath</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