The WebSynergy evaluation bundle by default includes the HSQL database. HSQL, MySQL, Microsoft SQL, and Oracle 10g are the databases supported by WebSynergy.
You can use the evaluation bundle which has the HSQL database embedded with it for quick evaluation. It is a good method to have it up and running fast for reviewing or developing, it has several drawbacks:
Only one user can access it at a time. This is because the data is stored on a file on disk and HSQL locks it when doing changes.
The data is stored inside the application server and might be lost on redeployment.
This configuration does not scale well and will have performance problems when multiple users are accessing the system.
Download WebSynergy (standalone). The standalone version which is not bundled with GlassFish, samples, and the HSQL database looks similar to websynergy-for-gfv2.zip. You can configure it to a database installed on your disk. MySQL, Microsoft SQL, and Oracle 10g are the databases supported by WebSynergy. We recommend that if your organization doesn't have a standard for local development databases, you should use MySQL for this, as it is small, free, and very fast.
WebSynergy is best suited to work on GlassFish v2, but it is also supported on other versions of GlassFish and also on other application servers.
Follow the below procedure to configure WebSynergy on Solaris with UTF-8 support. For the instructions to install MySQL on various other operating systems, see http://dev.mysql.com/doc/refman/6.0/en/installing.html.
Install MySQL by typing the following commands as superuser.
# groupadd mysql # useradd -g mysql mysql # cd /usr/local # gunzip install-dir/mysql-VERSION-OS.tar.gz | tar xvf - # ln -s install-dir/mysql-VERSION-OS mysql # cd mysql # chown -R mysql . # chgrp -R mysql . # scripts/mysql_install_db --user=mysql # chown -R root . # chown -R mysql data # bin/mysqld_safe --user=mysql & *
Log in to the MySQL installation by going to the MySQL installation directory and typing the following command:
mysql -u root
Create the UTF-8 database by typing the following commands:
mysql> create database lportal default character set utf8 mysql> use lportal; mysql> create user lportal; mysql> grant all privileges on *.* to 'lportal'@'localhost' identified by 'lportal' mysql> set password for 'lportal'@'localhost' = password('lportal');
Enable UTF-8 support for MySQL.
Installing and starting GlassFish is a prerequisite for installing WebSynergy.
Download the GlassFish v2 distribution.
Set the environment variable JAVA_HOME to point to the directory in which JDK 1.6 is installed.
Run the following command:
java -Xmx256m -jar <filename>.jar
Set ANT_HOME to point to the installation of ant 1.7 or above, which is at
<downloaded-dir>/glassfish/lib/ant directory.
Navigate to the GlassFish directory:
cd glassfish
Run the following command:
ant -f setup.xml
Start GlassFish.
cd bin
<downloaded-dir>/glassfish/bin>/asadmin start-domain
Download the standalone version of WebSynergy.
Extract the WebSynergy bundle.
unzip websynergy-for-gfv2.zip
Navigate to the Application folder.
cd websynergy/application
Run ant -f install.xml.
ant -f install.xml Buildfile: install.xml show-user-warning: [input] Ant must be 1.7 or greater. JAVA_HOME must be set to JDK 1.5 or greater. Glassfish must be running. [RETURN to continue or CONTROL-C to stop] set-glassfish-properties: [input] Enter Glassfish Directory [/opt/glassfish] /424/glassfish [input] Enter Glassfish Domain (include full path to domain) [/424/glassfish/domains/domain1] [input] Enter Glassfish Target [server] [input] Enter Glassfish Administrator Password [adminadmin] [input] Enter Glassfish Administration Port [4848] [input] Is Glassfish Clustered [Yes/No] [No] set-database-properties: [input] Use builtin HSQL or mySQL database [HSQL] mySQL set-hsql-properties: set-mssql-properties: set-mysql-properties: [input] Enter Database User Name [root] [input] Enter Database User Password [] password [input] Enter Database Host [localhost] [input] Enter Database Port [3306] [input] Enter Database Name [lportal]
You need to set the application server and database properties in the process of running install.xml. It is also required that Ant must be 1.7 or greater and JDK must be 1.5 or greater (JDK 1.6 is preferred). Also, GlassFish must be running.
You need to make changes to the portal-ext.properties file to enable UTF-8 support for MySQL. The WebSynergy evaluation bundle has a portal-ext.properties file in the GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes. When you are using a WebSynergy bundle which is not including samples, you have to create a portal-ext.properties file. This task describes the process to create a portal-ext.properties file, and making changes to it to enable UTF-8 support for MySQL.
Create a temporary folder. In this example, name the folder as test.
Equivalent step in the command prompt or in the terminal window of a UNIX like OS:
mkdir /tmp/test
Copy the portal-impl.jar file to the temp folder.
Equivalent step in the command prompt or in the terminal window of a UNIX like OS:
cp GlassFish install-dir/domains/domain1/application/j2ee-modules/websynergy/WEB-INF/lib/portal-impl.jar /tmp/test
Change directory to temp.
Equivalent step in the command prompt or in the terminal window of SOLARIS or any UNIX like OS:
cd /tmp/test
Extract the portal-impl.jar file.
Equivalent step in the command prompt or in the terminal window of a UNIX like OS:
jar -xvf portal-impl.jar
After unjar it will have portal.properties file in the same directory.
Open portal.properties and copy the "JDBC" property.
Create a text file (using any text editor) and name it as portal-ext.properties, and paste the "JDBC" property into it.
# # Hypersonic # jdbc.default.driverClassName=org.hsqldb.jdbcDriver jdbc.default.url=jdbc:hsqldb:lportal jdbc.default.username=sa jdbc.default.password= # # MySQL # #jdbc.default.driverClassName=com.mysql.jdbc.Driver #jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding= UTF-8&useFastDateParsing=false #jdbc.default.username= #jdbc.default.password=
Comment Hypersonic (HSQL) and uncomment MySQL.
Save the portal-ext.properties file.
Copy the portal-ext.properties file and paste it to GlassFish install-dir/domains/domain1/applications/j2ee-modules/websynergy/WEB-INF/classes.
Restart GlassFish server.