JBoss 7 and JBoss EAP 6
Status
These steps have been tested with JBoss AS 7.1.1.Final "Brontes".
Deploy Orbeon Forms
To install Orbeon Forms:
- For Orbeon Forms PE
- Unzip 
orbeon.warplace yourlicense.xmlfile underWEB-INF/resources/config/license.xml - Re-zip 
orbeon.war 
 - Unzip 
 - Start a standalone server with 
bin/standalone.sh - Drop 
orbeon.warinto the JBossstandalone/deploymentsfolder 
Setup a JDBC datasource
To setup a datasource, if you'd like Orbeon Forms to connect to your relational database, here for MySQL:
- Setup Orbeon Forms to use a JBoss datasource (configured in the following steps):``
- Unzip 
orbeon.war, - Edit 
WEB-INF/w``eb.xmlto uncomment the<resource-ref>. - Edit 
WEB-INF/jboss-web.xmlto uncomment the<resource-ref>. Change the<jndi-name>tojava:/comp/env/jdbc/mysql. 
 - Unzip 
 In JBoss, install the JDBC driver as a module:
- In 
modules/com, create a directorymysql/main. - Download the MySQL JDBC driver, say 
mysql-connector-java-5.1.22-bin.jar, and place it in themaindirectory. In the
maindirectory, create a file namedmodule.xmlwith the following content. Update the value of thepathattribute to match the name of the file you download in the previous step.<module xmlns="urn:jboss:module:1.0" name="com.mysql"> <resources> <resource-root path="mysql-connector-java-5.1.22-bin.jar"/> </resources> <dependencies> <module name="javax.api"/> </dependencies> </module>
- In 
 In JBoss, define the datasource:
Editing
standalone/configuration/standalone.xml, and replace the<datasources>with the following.<datasources> <datasource jndi-name="java:/comp/env/jdbc/mysql" pool-name="mysql" enabled="true"> <connection-url>jdbc:mysql://localhost:3306/orbeon?useUnicode=true&characterEncoding=UTF8</connection-url> <driver>com.mysql</driver> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <pool> <min-pool-size>10</min-pool-size> <max-pool-size>100</max-pool-size> <prefill>true</prefill> </pool> <security> <user-name>orbeon</user-name> <password>orbeon</password> </security> <statement> <prepared-statement-cache-size>32</prepared-statement-cache-size> <share-prepared-statements>true</share-prepared-statements> </statement> </datasource> <drivers> <driver name="com.mysql" module="com.mysql"> <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class> </driver> </drivers> </datasources>- In 
<connection-url>, change the host and database name, and under<security>the user name and password as appropriate. 
(Optional) Check that the module and datasource are configured properly:
Starting JBoss (bin/standalone.sh) and verifying you see the following two lines in the console:
[org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1) [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:/comp/env/jdbc/mysql]Check the datasource properly shows in the JBoss Management console:
- If you haven't done so already, create a user in the 
ManagementRealmby runningbin/add-user.sh, and creating a new user, sayadmin/password. - Go to 
http://127.0.0.1:9990/console/. Choose Profile on to top right of the page. Click on Connector / Datasources in the left sidebar. Check that you have an enabled datasource with JNDI namejava:/comp/env/jdbc/mysql. In the Connection tab, click on Test Connection, and a dialog the message "Successfully created JDBC connection" should show. 
- If you haven't done so already, create a user in the 
 - (Requires Orbeon Forms PE) Check you can create a database service in Form Builder :
- Create a new form in Form Builder, give it any app/form name.
 - In the sidebar, add a Database service. Assuming you have an 
employeetable in your database, name the serviceemployees, usedbfor the datasource, andselect emp_no, first_name from employees limit 10for the SQL query. (If you need sample data to populate your database, you can use data from these demo scripts.) - Add a Dropdown Menu control to the form (not Dynamic Data Dropdown), click on the gear icon, and name it 
employees. - In the sidebar, add an Action, name it 
populate-employees, have it react to from load, calling theemployeesservice, under Set Response Selection Control Items (which is at the bottom of the dialog) click the plus icon, select theemployeescontrol, for Items use/response/row, for Label usefirst-nameand for Value useemp-no. - Click the Test button, and check that the list name shows in the dropdown.
 
 
Using the Oracle persistence layer
- Follow the steps in the previous section, using the Oracle driver instead of the MySQL driver.
 Add to the
orbeon.war, in theWEB-INFdirectory, a file namedjboss-deployment-structure.xmlwith the content that follows. This assumes, that in the previous step, you named the modulecom.oracle.<jboss-deployment-structure> <deployment> <dependencies> <module name="com.oracle"/> <module name="org.jboss.ironjacamar.jdbcadapters"/> </dependencies> </deployment> </jboss-deployment-structure>Orbeon Forms doesn't come by default with this file, so deployment on JBoss doesn't fail for those who are not using the Oracle persistence layer, and thus haven't create a
com.oraclemodule.- Create the Orbeon tables in Oracle.
 Setup Orbeon Forms to use the Oracle persistence layer. At the minimun, you'll need to add the following two properties to your
properties-local.xml:<property as="xs:string" name="oxf.fr.persistence.provider.*.*.*" value="oracle"/> <property as="xs:string" name="oxf.fr.persistence.oracle.datasource" value="db"/>
With JBoss 6
Assuming that
JBOSS_HOMErepresents the location of your JBoss installation: create a newJBOSS_HOME/server/default/deploy/orbeon.wardirectory.Unzip the
orbeon.warfile in theorbeon.wardirectory you just created.Depending on the version of JBoss you are using:
Create a file
orbeon.war/WEB-INF/jboss-scanning.xmlwith the following content. This is get around a bug happening in the JBoss scanner when it goes through Scala classes. With Orbeon Forms 3.9:<scanning xmlns="urn:jboss:scanning:1.0"> <path name="WEB-INF/lib/scala-library-2.9.2.jar"> <exclude name="scala" recurse="true"/> </path> </scanning>Make sure you replace
scala-library-*.jarwith the actual version number inWEB-INF/lib. NOTE: Orbeon Forms 4.0 already includes this setting.Edit
orbeon.war/WEB-INF/jboss-web.xmland comment the 4 lines that start with<resource-ref>and end with</resource-ref>. Thisresource-refis only useful if you want to setup Orbeon Forms to store data in a relational database. If this is the first time you are installing Orbeon Forms on JBoss, even if you ultimately want Orbeon Forms to store data in a relation database, we recommend you first get it up and running without this configuration. Once everything works, you can come back, uncomment this, and follow the steps in point #7 below to get Orbeon Forms to access your relational database.
- Start JBoss by running 
JBOSS_HOME/bin/run.bat(orrun.shon UNIX). - Run and modify the example applications.
- Go to 
http://localhost:8080/orbeon/ - You can modify the example applications resources as the application sever is running and see the results of your modifications on the fly. The resources are stored under 
JBOSS_HOME/server/default/deploy/orbeon.war/WEB-INF/resources. 
 - Go to 
 Optionally, to run the authentication sample:
- Open 
JBOSS_HOME/server/default/deploy/orbeon.war/WEB-INF/web.xmland uncomment thesecurity-constraint,login-configandsecurity-roledeclarations at the end of the file. - Open 
JBOSS_HOME/server/default/deploy/orbeon.war/WEB-INF/jboss-web.xmland uncomment the security-domain element near the end of bottom of the file. Open
JBOSS_HOME/server/default/conf/login-config.xmland add the following aplication policy to the list of policies:<application-policy name="orbeon-demo"> <authentication> <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required"> <module-option name="usersProperties">jboss-orbeon-example-users.properties</module-option> <module-option name="rolesProperties">jboss-orbeon-example-roles.properties</module-option> </login-module> </authentication> </application-policy>
- Open 
 - Optionally, you might want to setup a JDBC data source if your application is using the SQL Processor. What follows assumes you are configuring the SQL Processor with 
<sql:datasource>my-datasource</sql:datasource>.- Look at the files 
JBOSS_HOME/docs/examples/jca/*-ds.xml. You should find one that correspond to the database you are using. Copy it toJBOSS_HOME/server/default/deploy. - Edit the file you copied and change the parameters to match your database configuration. Also assign a JNDI name to this data source with: 
<jndi-name>my-database</jndi-name>(instead ofmy-databaseyou might want to use a name which is descriptive of your database). - Edit 
WEB-INF/web.xmland uncomment the<resource-ref>. Also change there the content of<res-ref-name>to match the name you are using in the SQL Processor prefixed withjdbc/: <res-ref-name>jdbc/my-datasource</res-ref-name>. - Edit 
WEB-INF/jboss-web.xml. In that file you should have<res-ref-name>jdbc/my-datasource</res-ref-name>(the same name you use to configure the SQL Processor and that you have in theweb.xml) and<jndi-name>java:/my-database</jndi-name>(the same name you declared in the...-ds.xmlfile). - Copy the JAR files with the JDBC driver for your database in 
JBOSS_HOME/server/default/lib. 
 - Look at the files