Friday, March 8, 2013

java.io.InvalidClassException: org.eclipse.persistence.indirection.IndirectList

Due to Eclipselink.jar incompatibility within JDeveloper I faced the following exception:


Exception in thread "main" javax.ejb.EJBException: failed to unmarshal interface java.util.List; nested exception is: 
java.io.InvalidClassException: org.eclipse.persistence.indirection.IndirectList; local class incompatible: stream classdesc serialVersionUID = 4038061360325736360, local class serialVersionUID = -494763524358427112; nested exception is: java.io.InvalidClassException: org.eclipse.persistence.indirection.IndirectList; local class incompatible: stream classdesc serialVersionUID = 4038061360325736360, local class serialVersionUID = -494763524358427112
java.io.InvalidClassException: org.eclipse.persistence.indirection.IndirectList; local class incompatible: stream classdesc serialVersionUID = 4038061360325736360, local class serialVersionUID = -494763524358427112


Solution:

Replace the Eclipselink.jar with the JAR file found at the following location:

 Middleware_Home\oracle_common\modules\oracle.toplink_11.1.1\eclipselink.jar

Compile and Run the program again and it will run without any problem.

Wednesday, March 6, 2013

Get OIM DB Connection

We have OIM APIs to get connection to OIM DB and we can fire up a query to get data from OIM DB tables.

           
/**
* OIM DB Table: UPA_UD_FORMFIELDS
*Column Name: OLD_VALUE

*/

String query =
               "select * from UPA_UD_FORMFIELDS";

Connection connection = Platform.getOperationalDS().getConnection();
PreparedStatement prepared_statement = connection.prepareStatement(query);
ResultSet resultSet = prepared_statement.executeQuery();

String  field_old_value = resultSet.getString("OLD_VALUE");
            
            System.out.println("field_old_value: "+field_old_value);


List of OIM DB tables:

http://www.reachdba.com/showthread.php?701-OIM-List-of-Tables-and-Description