Flexive needs several libraries to be deployed to the application server's internal
lib
directories. Execute these steps once glassfish has been setup.
We provide an ant task for you which copies all libraries needed to deploy [fleXive] on Glassfish V2 to the specified directory.
Change to the
flexive-dist
directory of your [fleXive] distribution and run
ant glassfish.libs.
You will be prompted to specify your
${glassfish.home}/domains/domain1/lib/ext
directory.
The
ant
task will copy all required libraries to this directory.
Copy the
jbosscache-core.jar
from the
extlib
directory of your [fleXive] binary distribution to
${glassfish.home}/lib
To set up the databases, follow these instructions.
Setting up Glassfish
Go to the target installation directory
java -Xmx256m -jar <<path-to-downloaded-jar>>
extracts the installation JAR to
./glassfish
cd glassfish
On Unix: chmod -R +x lib/ant/bin
Execute the
setup.xml
buildfile
Unix: lib/ant/bin/ant -f setup.xml
Windows: lib\ant\bin\ant -f setup.xml
Starting Glassfish
bin/asadmin start-domain domain1 starts the Glassfish server
http://localhost:4848/ and login using default credentials admin/adminadmin.
Additional information
To stop the Glassfish instance execute ${glassfish.home}/bin/asadmin stop-domain domain1
Admin UI Port: 4848
HTTP Port: 8080
HTTPS Port: 8181
Three connection pools, two for the division (transactional and non-transactional) and one for the configuration database, have to be set up.
Copy and paste the following data-source definitions to a file (e.g.
flexive-ds.xml)
and update your database connection settings:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE resources PUBLIC "-//Sun Microsystems Inc.//DTD Application Server 9.0 Domain//EN" "sun-resources_1_3.dtd">
<resources>
<!--
Glassfish datasource configuration
To add these datasource, start Glassfish v2, and execute
${glassfish.home}/bin/asadmin add-resources /path/to/flexive-ds.xml
-->
<!-- Configure the global configuration datasource -->
<jdbc-connection-pool
name="flexiveConfiguration"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"
res-type="javax.sql.XADataSource">
<property name="user" value="root"/>
<property name="password" value="a"/>
<property name="url" value="jdbc:mysql://localhost:3306/flexiveConfiguration?useUnicode=true&characterEncoding=utf8&characterResultSets=utf8"/>
</jdbc-connection-pool>
<jdbc-resource pool-name="flexiveConfiguration" jndi-name="jdbc/flexiveConfiguration" enabled="true" object-type="user"/>
<!-- Configure the first flexive division -->
<jdbc-connection-pool
name="flexiveDivision1"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"
res-type="javax.sql.XADataSource">
<property name="user" value="root"/>
<property name="password" value="a"/>
<property name="url" value="jdbc:mysql://localhost:3306/flexive?useUnicode=true&characterEncoding=utf8&characterResultSets=utf8"/>
</jdbc-connection-pool>
<jdbc-resource pool-name="flexiveDivision1" jndi-name="jdbc/flexiveDivision1" enabled="true" object-type="user"/>
<!-- Configure the first flexive division non-XA datasource -->
<jdbc-connection-pool
name="flexiveDivision1NoTX"
datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"
res-type="javax.sql.DataSource">
<property name="user" value="root"/>
<property name="password" value="a"/>
<property name="url" value="jdbc:mysql://localhost:3306/flexive?useUnicode=true&characterEncoding=utf8&characterResultSets=utf8"/>
</jdbc-connection-pool>
<jdbc-resource pool-name="flexiveDivision1NoTX" jndi-name="jdbc/flexiveDivision1NoTX" enabled="true" object-type="user"/>
</resources>
While Glassfish is running, execute ${glassfish.home}/bin/asadmin add-resources /path/to/flexive-ds.xml to create the connection pools and JDBC resources. You have to pass the absolute path to your XML file, otherwise Glassfish looks in its own config directory.
Should you need to edit or reset your datasources, you can do so in the Glassfish administration console under →
Change to the
flexive-dist
directory of your [fleXive] distribution and run
ant ear. This will create the
flexive.ear
file inside the
flexive-dist
directory.
Using the autodeploy directory:
Copy the
flexive.ear
to
${glassfish.home}/domains/domain1/autodeploy
Using the Admin UI:
In the Admin Console, go to →
Click
Deploy...
and upload the
flexive.ear
file.
Click
OK
To access the backend point your browser to http://localhost:8080/flexive/adm/ Alternatively you can specify your server's IP address, which is supported by default, too. The default superuser's username and password for the Backend Administration are username: supervisor, password: supervisor.