Tuesday, September 13, 2016

BPM 12c Error: SQL Server Database Insert Issue

When I was trying to perform insert operation in BPM  (12C) process, i got following exception

Could not invoke operation 'insert' against the 'db' due to: [[
BINDING.JCA-11622
Could not create/access the TopLink Session.
This session is used to connect to the datastore.
Caused by Exception [EclipseLink-7042] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Database platform class [weblogic.jdbc.sqlserver.SQLServerDriver] not found.
Internal Exception: java.lang.ClassCastException: weblogic.jdbc.sqlserver.SQLServerDriver cannot be cast to org.eclipse.persistence.internal.databaseaccess.Platform.
You may need to configure the connection settings in the deployment descriptor (i.e. DbAdapter.rar#META-INF/weblogic-ra.xml) and restart the server. This exception is considered not retriable, likely due to a modelling mistake.
]]

The error is followed by an exception with the following stack trace:
java.lang.ClassCastException: weblogic.jdbc.sqlserver.SQLServerDriver cannot be cast to org.eclipse.persistence.internal.databaseaccess.Platform

It was very hard to find out the reason. Even google did not help much. With the help of oracle support we came with following reasons for the error.

1. The DB adapter configuration for the connection pool ( Weblogic console -> Deployments -> DbAdapter -> Configuration ->outbound connection pool has incorrect setting for the platformClassName property.
  Outbound Connection pool) 
for the given co
 Depending on the class set there you may see different  java.lang.ClassCastException source classes

2. There was some  incorrect configuration specified in the weblogic-ra.xml

3. The Plan.xml files were different on different servers.


Solution: 


1. Set the correct platformClassName value for the DB Adapter configuration pool within Weblogic console -> Deployments -> DbAdapter -> Configuration -> Outbound Connection pool -> <Your pool>

For Oracle DB connection the platformClassName should have the org.eclipse.persistence.platform.database.Oracle10Platform and for Microsoft SQL server it should have org.eclipse.persistence.platform.database.SQLServerPlatform

Notice that the class is always in the org.eclipse.persistence.platform.database package and extends the org.eclipse.persistence.platform.database.Platform class


2. Please refer to the documentation: https://docs.oracle.com/cd/E24329_01/web.1211/e24971/creating.htm#ADAPT129
 and confirm the weblogic-ra.xml file is correct

3. Please ensure the Plan.xml files are identical in all servers.



No comments:

Post a Comment