Step 1: Obtain the Driver
Since the Oracle JDBC driver is not available in the central Maven repository it must be placed into the local repository on each machine you wish to build uPortal on. An alternative to installing the JAR on each machine you can setup a maven repository for use by multiple machines.
The first step is determine if you have the Oracle client and Oracle JDBC drivers installed on your local machine. If Oracle is installed on your local machine it will be located at $ORACLE_HOME. Try to locate the driver using the following command:
If you cannot locate it download the correct Oracle JDBC driver for your database. Once you have the jar it needs to be installed into your local maven repository using the following command:
The -DgroupId, -DartifactId and -Dversion specified in this command are up to you but they should match the JAR vendor, name and version to avoid confusion down the road.
The -Dfile is the Oracel JDBC driver. You should include the working directory path in the event the driver is not in the directory you are running maven from.
- Opening your main uPortal source pom.xml (uPortal-4.0.x/pom.xml) there is a section about 92 lines down that reads:
2. We will add the Oracle driver here using the group, artifact and version information from the mvn install:install-file command above.
See Issues section about possible issues using this driver.
Step 2: Configure the Database Filter
1. In the filters folder, locate the default local.properties file under uPortal-4.x.x/filters/local.properties and configure the Database Connection Settings
Step 3: Test The Configuration
dbtest ant target will tell you if you have configured the database connection properly.
If it works correct you should see something like:
Step 5: Build and Deploy
Following a successful test, you can execute the command below to build the database tables and copy files to your servlet container.
Step 6: Restart Tomcat
Loading the database requires a couple of steps
- Create the database: Refer to the Oracle database documentation for instructions regarding how to create an Oracle database instances. The database name (or in this case, the Oracle SID), port number, and driver information must reflect what was defined in the local.properties file located in the filters/ directory.
- Create the tables and populate the database: From the uPortal build directory, run "ant db" to execute the ant target which loads the database. The ant target uses the Dbloader tool.
Issues and Known Bugs
Some people have encountered problems with the Oracle JDBC driver with certain web application environments if the classes zip file is used as-is with the .zip file extension. Simply renaming the file to a .jar file seems to fix the problem. Alternatively, unzipping the classes file into a directory structure, then using the jar command to repackage the classes into a jar file works as well.