Getting Started with Oracle WebLogic Server 12c: Developer’s Guide


Getting_Started_with_Oracle_WebLogic_Server_12c-_Developer’s_Guide

Getting Started with Oracle WebLogic Server 12c: Developer’s Guide

It took me a while to update the blog and get back on writing again due to the elaboration of this new material which became the Getting Started withx Oracle WebLogic Server 12c: Developer’s Guide book.  We started to write the book about 12c (12.0.0) which ended up being an not so stable  OK version and had to rapidly update to 12.0.1.

But then, when we’re about to finish the book the 12.0.2 release came out with a lot of improvements and we again updated all the material and included the revisions for the new installer, new type of WebLogic clusters and new JMS resources targeting, among other changes that this version had.

The book follows a tutorial approach, with step-by-step instructions and a lot of screenshots to make it very easy for new users and people that are really starting with the product.

Hopefully I’m going to get back on publishing more frequently on the blog, but now “It’s all about GemFire“! ;)

How to add third-party JDBC drivers on WebLogic

Oracle WebLogic data sources supports many databases types by default and also comes with some JDBC drivers for most of them.

But, not very often, you are working with third-party databases (non-Oracle) and endup needing to download the JDBC drivers from the database provider and doing the setup on WebLogic by yourself. The steps are pretty simple, but some still have questions on how to do it and I will try to create a step-by-step guide on this post.

In this example, the environment is Oracle WebLogic 12c running on a Mac OS X and doing the simulation of a Microsoft SQL Server JDBC Driver installation.

To simulate the issue of a missing driver, try to create a new Data Source selecting the following parameters on a default installation:

  • Database Type: MS SQL Server
  • Database Driver: Microsoft’s SQL Server Driver (Type 4) Version: 2005 and later

Complete the wizard with your database access information (host, port, username, password) and try to Test the Connection before saving. You should see the error below stating that you don’t have the driver classes on the classpath.

Image

Ok, let’s setup the JDBC driver:

      1. Download the JDBC Driver – MS SQL Server JDBC drivers are currently hosted on this link: http://msdn.microsoft.com/en-us/sqlserver/aa937724.aspx
      2. Unpack the zip or tarball with the JDBC driver jar file and copy the specified file to the WebLogic installation directory, under the ${WL_HOME}/server/lib folder.
        (markito@luke)$ tar -xzvpf sqljdbc_4.0.2206.100_enu.tar.gz
        (markito@luke)$ cd sqljdbc_4.0/enu/
        (markito@luke)$ cp sqljdbc.jar ${WL_HOME}/server/lib/
        
      3. Now, modify the commEnv.sh script. This script sets common environment variables for WebLogic and set the WebLogic classpath with some base libraries from the WebLogic installation directory.
        The file is located under: ${WL_HOME}/common/bin/commEnv.shBefore:

        # set up WebLogic Server's class path
        WEBLOGIC_CLASSPATH="${JAVA_HOME}/lib/tools.
        jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic_sp.
        jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic.
        jar${CLASSPATHSEP}${FEATURES_DIR}/weblogic.server.modules_13.1.1.0.
        jar${CLASSPATHSEP}${WL_HOME}/server/lib/webservices.
        jar${CLASSPATHSEP}${ANT_HOME}/lib/ant-all.
        jar${CLASSPATHSEP}${ANT_CONTRIB}/lib/ant-contrib.jar"
        export WEBLOGIC_CLASSPATH
        

        After:

        # set up WebLogic Server's class path
        WEBLOGIC_CLASSPATH="${JAVA_HOME}/lib/tools.
        jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic_sp.
        jar${CLASSPATHSEP}${WL_HOME}/server/lib/weblogic.
        jar${CLASSPATHSEP}${FEATURES_DIR}/weblogic.server.modules_13.1.1.0.
        jar${CLASSPATHSEP}${WL_HOME}/server/lib/webservices.
        jar${CLASSPATHSEP}${ANT_HOME}/lib/ant-all.
        jar${CLASSPATHSEP}${ANT_CONTRIB}/lib/ant-contrib.jar
        <strong>jar${CLASSPATHSEP}${WL_HOME}/server/lib/sqljdbc4.jar"
        export WEBLOGIC_CLASSPATH
        
      4. Now restart the WebLogic server and repeat the process to create a new MS SQL Server data source.

There is a bonus step which is not always required – Since you’re using a new JDBC driver, sometimes you don’t have the entry under WebLogic database drivers list. To update this list modify the ${WL_HOME}/server/lib/jdbcdrivers.xml file accordingly, the description of the file is very explanatory:

<!-- This xml file contains meta information regarding JDBC Driver's and making connections to the DBMS.
It is designed to hold information so that UI can gather information from a user and configure
The Driver classname, The Driver URL and the driver Properties to make a connection to the DBMS

This XML entry is a required peice of data that could be required in the URL or in the properties object

       There are 5 well known property names:
       DbmsHost
       DbmsPort
       DbmsName
       DbmsUsername
       DbmsPassword

       Properties that don't match the well know ones above, will be passed as name=value pairs to either
       the URL or the properties object (based on InURL=false or true.

       Then the UI would prompt:
       Please Enter
       Database Type : normal
       This is required to Indicate your DB type.
       And after the user providing it the UI would stuff it into the JDBCDriverInfo object and the JDBCURLHelper would do the right thing with it
       stick it in the URL or in the properties object
--!>

Remember that although you can add or update third-party drivers, you should still follow the supported database list provided by the WebLogic Certification Matrix in order to keep with a supported installation.

References:

http://docs.oracle.com/cd/E24329_01/web.1211/e24367/third_party_drivers.htm

My Article at OTN: Oracle Service Bus and Coherence caching example

Today I’ve published an article at Oracle Technology Network (OTN) about Oracle Service Bus and Oracle Coherence integration. It shows a case study example and how you can use caching strategies for  Web Services.

It’s a step-by-step tutorial on how to setup a Coherence Server with Weblogic, how to access this server with Coherence console and how to use out-of-process caching strategy to scale your caching with no impact on the Enterprise Service Bus.

To read the full article click here.

References:

Weblogic 10.3.5 Released!

And here we go! A new release of Weblogic Server is out now! Besides it’s still missing the support for Java EE 6, this release is more focused on fixes for Fusion Middleware and Fusion Applications.   Now I’m just downloading everything (around 5gb) again, SOA Suite, JDev, WLS….   New environment is on the way…

Detailed information: https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=1316076.1

What’s New from Documentation: http://download.oracle.com/docs/cd/E21764_01/web.1111/e13852/toc.htm