The JBossAS7 OpenShift Express cartridge runs in a constrained environment that restricts what ports can be used as well as how much memory, and  the number of processes the user can run. The current limitations set the Java memory at 128Mb of max heap, and 83Mb of permgen, so your applications need to fit within that constraint. Also, the express user running the application is limited to about 100 processes, which translates to a max of 80 or so java threads, so excessive thread creation can eat up available processes and begin to cause java.lang.OutOfMemoryErrors with a failure to create native thread cause.

The configuration of the JBossAS7 server used by the OpenShift Express JBoss cartridge is a simple modification of the jboss-as-web-7.0.0.Final release which my be obtained fromhttp://www.jboss.org/as7.html

 

The contents of the server are then overwritten by the attached standalone.xml, standalone.conf and mysql.tar archive for the mysql jdbc driver module. The exact steps would be:

  1. wget http://download.jboss.org/jbossas/7.0/jboss-as-7.0.0.Final/jboss-as-web-7.0.0.Final.zip
  2. unzip  jboss-as-web-7.0.0.Final.zip
  3. Download this documents attachments
  4. unzip standalone.xml.zip to get standalone.xml
  5. cp standalone.xml  jboss-as-web-7.0.0.Final/standalone/configuration
  6. unzip standalone.conf.zip to get standalone.conf
  7. cp standalone.conf  jboss-as-web-7.0.0.Final/bin
  8. tar -xvf mysql.tar -C jboss-as-web-7.0.0.Final

 

At this point starting the server using the  jboss-as-web-7.0.0.Final/bin/standalone.sh command has the server configured the same as that run by the Express JBossAS7 cartridge. In terms of services or subsystems that are available in the jboss-as-web-7.0.0.Final that have been removed from the server as used by Express, they are:

  • JMS
  • Managment interfaces/console
  • Webservices
  • OSGi
  • JMX connector
  • Remote EJB access

 

 

For reference, the exact difference between the express standalone.xml and the jboss-as-web-7.0.0.Final version is:

 

 

[650](ironmaiden:tmp) > diff express-standalone.xml jboss-as-web-7.0.0.Final/standalone/configuration/standalone.xml 
35a36,37
>         <extension module="org.jboss.as.osgi"/>
>         <extension module="org.jboss.as.remoting"/>
43a46,59
>     <management>
>          <security-realms>
>               <security-realm name="PropertiesMgmtSecurityRealm">
>                    <authentication>
>                         <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir" />
>                    </authentication>
>               </security-realm>
>          </security-realms>
>         <management-interfaces>
>            <native-interface interface="management" port="9999" />
>            <http-interface interface="management" port="9990"/>
>         </management-interfaces>
>     </management>
> 
83c99
<                     <connection-url>jdbc:h2:${jboss.server.data.dir}/test;DB_CLOSE_DELAY=-1</connection-url>
---
>                     <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
139a156,158
>         <subsystem xmlns="urn:jboss:domain:jmx:1.0">
>             <jmx-connector registry-binding="jmx-connector-registry" server-binding="jmx-connector-server" />
>         </subsystem>
143a163,225
>         <subsystem xmlns="urn:jboss:domain:osgi:1.0" activation="lazy">
>             <configuration pid="org.apache.felix.webconsole.internal.servlet.OsgiManager">
>                 <property name="manager.root">jboss-osgi</property>
>             </configuration>
>             <properties>
>                 <!--
>                     A comma seperated list of module identifiers. Each system module
>                     is added as a dependency to the OSGi framework module. The packages
>                     from these system modules can be made visible as framework system packages.
>                     http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Constants.html#FRAMEWORK_SYSTEMPACKAGES_EXTRA
>                 -->
>                 <property name="org.jboss.osgi.system.modules">
>                 org.apache.commons.logging,
>                 org.apache.log4j,
>                 org.jboss.as.osgi,
>                 org.slf4j,
>                 </property>
>                 <!--
>                     Framework environment property identifying extra packages which the system bundle
>                     must export from the current execution environment
>                 -->
>                 <property name="org.osgi.framework.system.packages.extra">
>                 org.apache.commons.logging;version=1.1.1,
>                 org.apache.log4j;version=1.2,
>                 org.jboss.as.osgi.service;version=7.0,
>                 org.jboss.osgi.deployment.interceptor;version=1.0,
>                 org.jboss.osgi.spi.capability;version=1.0,
>                 org.jboss.osgi.spi.util;version=1.0,
>                 org.jboss.osgi.testing;version=1.0,
>                 org.jboss.osgi.vfs;version=1.0,
>                 org.slf4j;version=1.5.10,
>                 </property>
>                 <!-- Specifies the beginning start level of the framework -->
>                 <property name="org.osgi.framework.startlevel.beginning">1</property>
>             </properties>
>             <modules>
>                 <!-- modules registered with the OSGi layer on startup -->
>                 <module identifier="javaee.api"/>
>                 <module identifier="org.jboss.logging"/>
>                 <!-- bundles installed on startup -->
>                 <module identifier="org.apache.aries.util"/>
>                 <module identifier="org.jboss.osgi.webconsole"/>
>                 <module identifier="org.osgi.compendium"/>
>                 <!-- bundles started in startlevel 1 -->
>                 <module identifier="org.apache.felix.log" startlevel="1"/>
>                 <module identifier="org.jboss.osgi.logging" startlevel="1"/>
>                 <module identifier="org.apache.felix.configadmin" startlevel="1"/>
>                 <module identifier="org.jboss.as.osgi.configadmin" startlevel="1"/>
>                 <!-- bundles started in startlevel 2 -->
>                 <module identifier="org.apache.aries.jmx" startlevel="2"/>
>                 <module identifier="org.apache.felix.eventadmin" startlevel="2"/>
>                 <module identifier="org.apache.felix.metatype" startlevel="2"/>
>                 <module identifier="org.apache.felix.scr" startlevel="2"/>
>                 <module identifier="org.apache.felix.webconsole" startlevel="2"/>
>                 <module identifier="org.jboss.osgi.jmx" startlevel="2"/>
>                 <module identifier="org.jboss.osgi.http" startlevel="2"/>
>                 <!-- bundles started in startlevel 3 -->
>                 <module identifier="org.jboss.osgi.blueprint" startlevel="3"/>
>                 <module identifier="org.jboss.osgi.webapp" startlevel="3"/>
>                 <module identifier="org.jboss.osgi.xerces" startlevel="3"/>
>             </modules>
>         </subsystem>
>         <subsystem xmlns="urn:jboss:domain:remoting:1.0"/>
167c249
<             <virtual-server name="default-host" enable-welcome-root="false">
---
>             <virtual-server name="default-host" enable-welcome-root="true">
168a251
>                <alias name="example.com" />
176c259
<             <loopback-address value="127.0.250.1"/>
---
>             <inet-address value="127.0.0.1"/>
179c262
<             <loopback-address value="127.0.250.1"/>
---
>            <inet-address value="127.0.0.1"/>