How to deploy Alfresco 2.0X HEAD to JBossPortal2.4.1 or JBossPortal2.6
Firstly it should be noted that for 2.0 we did not provide JBoss bundles with portal and Alfresco - as it seems to confuse people rather than help, also we needed to fix a few things in 2.0 final before it would work correctly in portal.
Set an environment variable called JBOSS_HOME to point to the root of your JBossPortal2.4.1 installation.
Build the Alfresco source using the 'build-jboss' ANT build target from inside the root\common directory. This creates a WAR which is basically the same as the usual TomCat WAR with the JSR-168 portal deployment files included in WEB-INF. Once complete the build target will have deployed the WAR to your JBossPortal installation and copied over the MySQL driver also.
This step is needed for JBossAS4.0.5+JBossPortal2.4.1 or JBossPortal2.6 or if you have a later revision of HEAD code than 574: Open the jboss/server/default/deploy/alfresco.war file in an archival tool and remove (and extract for later) the two jsf*.jar files from the WEB-INF/lib folder inside the WAR. Then update the jsf jar files in jboss/server/default/deploy/jbossweb-tomcat55.sar/jsf-libs with the ones extracted from the alfresco WAR.
Edit the file jboss/bin/run.bat (or run.sh) and add the following flags to the JAVA_OPTS line: