Wednesday Dec 11, 2013

Disable JDBC object wrapping in GlassFish

As outlined in my previous blog entry, if you run CMSDK 9.0.4.6 on middleware such as Oracle WebLogic Sever or Oracle GlassFish, you need to disable the JDBC object wrapping first. Otherwise you might be seeing this exception during the startup of a CMSDK Node in GlassFish:

...
oracle.ifs.core.agents.InboundQueueListenerAgent [39] WARNING: Error while processing incoming message.
oracle.ifs.common.IfsException: IFS-13001: Unable to dequeue message
java.lang.ClassCastException: com.sun.gjc.spi.jdbc40.ConnectionWrapper40 cannot be cast to oracle.jdbc.OracleConnection
    at
oracle.ifs.server.S_Queue.dequeue(S_Queue.java:342)
...

How to Disable JDBC Object Wrapping in GlassFish

It is required to disable JDBC object wrapping when using a data source for CMSDK 9.0.4.6. These instructions are for GlassFish 3.1.1 or above, as we don’t support earlier versions of GlassFish with CMSDK.

To disable wrapping of JDBC objects using the Administration Console:

  1. In the Domain Structure tree, expand Resources, then expand JDBC.
  2. Select JDBC Connection Pool in the tree structure.
  3. On the Summary of JDBC Connection Pool page, click the connection pool name that your data source is based on.
  4. Select the Advanced: Edit JDBC Connection Pool Advanced Attributes tab.
  5. In Wrap JDBC Objects, deselect the checkbox to disable wrapping.
  6. Click Save.

    This change does not take effect immediately—it requires that the data source be redeployed or the server be restarted.

In Oracle GlassFish Server this property can also be modified in the domain.xml file or via asadmin command.

Friday Dec 06, 2013

Disable JDBC data type wrapping in WLS

I've now seen this problem several times in customer environments. During startup of a CMSDK Node you see a ClassCastExceptions related to weblogic.jdbc.wrapper.

If something like this shows up in your log file:

...
oracle.ifs.common.IfsException: IFS-45206: Unable to get credential
oracle.ifs.common.IfsException: IFS-10184: Unable to get token
oracle.ifs.common.IfsException: IFS-10191: Unable to make token credential persistent
java.lang.ClassCastException: weblogic.jdbc.wrapper.Blob_oracle_sql_BLOB
    at oracle.ifs.server.S_LibrarySession.getTokenCredentialBlob(S_LibrarySession.java:23888)
...

you have probably not disabled the JDBC data type object wrapping that is enabled by default in WebLogic Server (WLS).

Background

Some JDBC objects from a driver that are returned from WLS are wrapped by default. Wrapping data source objects provides WLS the ability to:

  • Generate debugging output from all method calls.
  • Track connection utilization so that connections can be timed out appropriately.
  • Provide transparent automatic transaction enlistment and security authorization.

WLS provides the ability to disable wrapping which provides the following benefits:

  • Although WLS generates a dynamic proxy for vendor methods that implement an interface to show through the wrapper, some data types do not implement an interface. For example, Oracle data types Array, Blob, Clob, NClob, Ref, SQLXML, and Struct are classes that do not implement interfaces. Disabling wrapping allows applications to use native driver objects directly.
  • Eliminating wrapping overhead can provide a significant performance improvement.

When wrapping is disabled (the wrap-types element is false), the following data types are not wrapped:

  • Array
  • Blob
  • Clob
  • NClob
  • Ref
  • SQLXML
  • Struct
  • ParameterMetaData
    • No connection testing performed.
  • ResultSetMetaData
    • No connection testing performed.
    • No result set testing performed.
    • No JDBC MT profiling performed.

How to Disable Wrapping

It is required to disable JDBC data type wrapping when using a data source with CMSDK 9.0.4.6. This only works in WLS 10.3.4 or above. Since there is no way to change it for WLS versions earlier than 10.3.4, we don’t support those WLS versions with CMSDK.

To disable wrapping of JDBC data type objects using the Administration Console:

  1. If you have not already done so, in the Change Center of the Administration Console, click Lock & Edit.
  2. In the Domain Structure tree, expand Services, then select Data Sources.
  3. On the Summary of Data Sources page, click the data source name.
  4. Select the Configuration: Connection Pool tab.
  5. Scroll down and click Advanced to show the advanced connection pool options.
  6. In Wrap Data Types, deselect the checkbox to disable wrapping.
  7. Click Save.
  8. To activate these changes, in the Change Center of the Administration Console, click Activate Changes.

    This change does not take effect immediately—it requires that the data source be redeployed or the server be restarted.

After that you should not see the ClassCastException anymore and your CMSDK Node should start without errors.

About

My name is Frank Closheim. I lead Development for CMSDK at Oracle and want to share the latest news, best practices, examples and product updates about CMSDK with the Blogsphere.

Search

Archives
« December 2013 »
SunMonTueWedThuFriSat
1
2
3
4
5
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today