This document describes how to install openCRX on JBOSS
Although the old Install-Guide is referenced (out of laziness) there is not
much in common anymore. Maybe later I'll fill in the gaps an remove the reference
to the old guide.
Paths with ${} indicate the path where you installed the refered software.
used versions:
- opencrxSdk-2.5.2
- jboss 5.1.0.GA
- mysql5.0.51a
1. Download and install opencrxSdk
2. Download and install jboss and MySql? ( I had MySql? as a prerequisite and yes, I know it is not recommended).
3. use mysql as default-ds :
add a file jdbc-opencrx-CRX-mysql-ds.xml to the ${opencrxSDK}/opencrx-X.XX/src/ear/opencrx-core-CRX.ear/META-INF with the contents:
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<local-tx-datasource>
<jndi-name>jdbc_opencrx_CRX</jndi-name>
<connection-url>jdbc:mysql://localhost:3306/crx-crx</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>root</user-name>
<password>root</password>
<connection-property name="loginTimeout">100</connection-property>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<min-pool-size>5</min-pool-size>
<max-pool-size>100</max-pool-size>
<blocking-timeout-millis>5000</blocking-timeout-millis>
<idle-timeout-minutes>15</idle-timeout-minutes>
<new-connection-sql>SELECT 1 FROM prefs_Preference</new-connection-sql>
<check-valid-connection-sql>SELECT 1 FROM prefs_Preference</check-valid-connection-sql>
<!-- Typemapping for JBoss 4.0 -->
<metadata>
<type-mapping>mySQL</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
http://coldshen.com/blog/index.cfm/2009/3/8/Configuring-JBoss5-JMS-for-MySQL
(http://www.jboss.org/community/wiki/SetUpAMySQLDatasource )
don't forget to create schema
check http://www.opencrx.org/opencrx/2.5/MySQL-5/openCRX_Installation_MySQL-5.html for further configuration
4. use ant copyDB as described in https://sourceforge.net/apps/trac/opencrx/wiki/Sdk24.FromHSQLDBToOtherDB[[BR]]
5. adjust run.sh and run.conf according to http://www.opencrx.org/opencrx/2.3/JBoss-5/openCRX_Installation_JBoss-5.html
I think the settings described for the logger in that document have no effect anymore.
6. add the a file "jboss-web.xml" to all the WEB-INF-directories in ${opencrxSDK}/opencrx-X.XX/core/src/data/ with the following contents:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtds/jboss-web_3_2.dtd">
<jboss-web>
<resource-ref>
<res-ref-name>jdbc_opencrx_CRX</res-ref-name>
<jndi-name>java:/jdbc_opencrx_CRX</jndi-name>
</resource-ref>
</jboss-web>
7. In ${<opencrx}/core/src/data/orc.opencrx.vcard/WEB-INF/web-xml comment the two lines with:
<!-- <url-pattern>/accounts</url-pattern> -->
8. copy openjpa.jar, common-lang.jar, commons-collections.jar to ${jboss}/server/default/lib
and
remove the following from the ${opencrxSDK}/opencrx-X.XX/core/build.xml (or remove the jars from the ear after build).
<zipfileset dir="${openmdx.home}/java2/${build.target.platform}/extension/lib" prefix="APP-INF/lib">
<include name="openjpa.jar"/>
<include name="commons-collections.jar"/>
<include name="commons-lang.jar"/>
</zipfileset>
also copy the openmdx-base.jar to ${jboss}/server/default/lib
9. modify jdoconfig.xml :
In the file ${opencrxSDK}/opencrx-X.XX/core/src/data/ear/opencrx-core-CRX.ear/APP-INF/lib/opencrx-resources.jar/META-INF/jdoconfig.xml change
connection-factory-name="java:/com/java/env/jdbc_opencrx_CRX"
to
connection-factory-name="java:/jdbc_opencrx_CRX"
10. security/login:
in src/data/org.opencrx/WEB-INF/jboss-web.xml add
<security-domain>opencrx-core-CRX</security-domain>
<context-root>opencrx-core-CRX</context-root>
in src/data/org.opencrx.rest/WEB-INF add
<security-domain>opencrx-core-CRX</security-domain>
add a file openxrx-jboss-beans.xml to the ${opencrxSDK}/opencrx-X.XX/src/ear/opencrx-core-CRX.ear/META-INF with the contents:
<?xml version="1.0" encoding="UTF-8"?> <deployment xmlns="urn:jboss:bean-deployer:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer:2.0 bean-deployer_2_0.xsd"> <application-policy xmlns="urn:jboss:security-beans:1.0" xsi:schemaLocation="urn:jboss:security-beans:1.0 security-beans_1_0.xsd" name="opencrx-core-CRX"> <authentication> <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required"> <module-option name="unauthenticatedIdentity"> gast </module-option> <module-option name="dsJndiName">java:/jdbc_opencrx_CRX</module-option> <module-option name="principalsQuery"> SELECT c.passwd FROM OOMSE2_PRINCIPAL p, OOMSE2_CREDENTIAL c WHERE (p.object_id LIKE 'principal/CRX/Root/Default/%') AND (p.credential = c.object_id) AND (p.name = ?) </module-option> <module-option name="rolesQuery"> SELECT r.name, 'Roles' FROM OOMSE2_PRINCIPAL_ pg, OOMSE2_PRINCIPAL p, OOMSE2_PRINCIPAL_ pn, OOMSE2_ROLE r WHERE (p.object_id = pn.object_id) AND (pn.is_member_of = pg.object_id) AND (pg.granted_role = r.object_id) AND (p.object_id LIKE 'principal/CRX/Root/Default/%') AND (p.name = ?) </module-option> <module-option name="ignorePasswordCase">true</module-option> <module-option name="hashCharset">UTF-8</module-option> <module-option name="hashEncoding">base64</module-option> <module-option name="hashAlgorithm">MD5</module-option> </login-module> </authentication> </application-policy> </deployment>
11. build and deploy EAR: in the directory ${opencrxSDK}/opencrx-X.XX/core call 'ant deliverables' und 'ant assemble'.
12. Refer to old guide for where to copy the ear and how to start jboss.
Attachments
-
jboss-app.xml
(375 bytes) - added by mjohnen
3 years ago.
\opencrxSdk-2.5.1\opencrx-2.5.1\core\src\ear\opencrx-core-CRX.ear\META-INF\jboss-app.xml
- jdbc-opencrx-CRX-mysql-ds.xml (0.9 KB) - added by mjohnen 3 years ago.