uPortal 4.0 Manual

Skip to end of metadata
Go to start of metadata

Step 1: Obtain the MS JDBC driver

Since the MS SQL Server JDBC driver is not available in the central Maven repository, it must be placed into the local repository of each machine on which you wish to build uPortal.

Option: Local Maven caching repository

Icon
As an alternative to this, you could set up a maven repository for use by multiple machines.
  • Download MS JDBC driver directly from Microsift, here: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774
  • Follow the installation instructions, noting where the driver JAR file is located
  • Note the location of the driver JAR file and the version
  • Install the driver into the local Maven repository

    Install MS SQL Server driver
  • Again, note the groupId, artifactId and version. These will be used in Step 2.

Step 2: Add the Dependency

  • From the uPortal source directory, open the uPortal-4.x.x/pom.xml file and add the sqljdbc4.jar dependency to your pom.xml (Version 4 of the sqljdbc driver is required).

 

Step 3: Configure the Database Filter

  • From the uPortal source directory, open the uPortal-4.x.x/filters/local.properties file and add your database information (Note: for ease of development we generally suggest leaving local.properties with hsql and adjusting dev.properties, test.properties, and prod.properties to your chosen DB.  If you do this, pass "-Denv=dev" or whatever on your ant commands; e.g. "ant -Denv=dev dbtest").

 

Step 4: Test the Configuration

Running the dbtest ant target will tell you if you have configured the database connection properly.

 

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. 

Note: Executing the command "ant clean initportal" will drop and recreate the database tables and all existing data will be lost. This will result in a clean uPortal database structure. If you want to keep the contents of your existing database, use "ant clean deploy-war"

Step 6: Restart Tomcat

 

 

Additional References

 

Having problems with these instructions?

Please send us feedback at uportal-user@lists.ja-sig.org

  • No labels

2 Comments

  1. We have been testing uPortal 4.0.x with SQL Server 2008 R2 and SQLJDBC4 driver and can add a few points to the instructions:

    1) environment.build.hibernate.dialect

    org.jasig.portal.utils.PortalDialectResolver is programmed to return an instance of org.hibernate.dialect.SQLServer2005Dialect for SQL Server v. 2008 and above. This was done when jTDS drivers (1..2.x) did not support SQL Server 2008+ - see UP-3358 - Event aggregation does not work with MSSQL 2008 Closed .

    With jTDS 1.3.x  - and definitely with sqljdbc4.jar, org.hibernate.dialect.SQLServer2008Dialect can be used. We had to update the above class in our deployment as well - and not just set the dialect in the properties file.

    2) environment.build.hibernate.connection.url

    We were getting "aggregateRawEvents failed" errors due to the following "The data types time and datetime are incompatible in the greater than or equal to operator." As described in this blog - http://blogs.msdn.com/b/jdbcteam/archive/2010/04/08/using-time-and-date-data-types-part-1-what-time-is-it.aspx - JDBC driver needs to be told explicitly to use the time data type rather than the datetime data type with setTime/updateTime by setting the connection property "sendTimeAsDateTime=false":

    environment.build.hibernate.connection.url=jdbc:sqlserver://<servername>:<port>;databaseName=<databasename>;sendTimeAsDateTime=false
  2. As I recall SQLServer2008 Dialect has issues with some of the portlets still using an older version of hibernate that doesn't have this dialect.  I suggest sticking with org.hibernate.dialect.SQLServerDialect or org.hibernate.dialect.SQLServer2005Dialect until all portlets are updated to newer versions of hibernate.