We were getting the below error in the SystemOut.logs in our newly added WebSpherePortal server during restart and at runtime .
Error:
[6/14/16 14:18:14:404 IST] 00000063 JPAEventlogRe E Synchronization Failed. Error: Unable to obtain an object lock on “null”. <openjpa-2.2.3-SNAPSHOT-r422266:1564471 fatal store error> org.apache.openjpa.persistence.OptimisticLockException: Unable to obtain an object lock on “null”.
FailedObject: SELECT V FROM VirtualPortalEntryImpl V WHERE V.VP = :VP [java.lang.String]
at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(DBDictionary.java:4983)
[6/14/16 14:18:15:994 IST] 00000063 ModuleManager E <openjpa-2.2.3-SNAPSHOT-r422266:1564471 fatal store error> org.apache.openjpa.persistence.OptimisticLockException: Unable to obtain an object lock on “null [java.lang.String]”.
FailedObject: 0 [org.apache.openjpa.util.IntId] [java.lang.String]
Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-00942: table or view does not exist
{prepstmnt 1108295475 SELECT t0.VPID FROM jcr.WCM_VPORTALS t0 WHERE t0.VPID = ?} [code=942, state=42000]
Background:
It’s a newly created Server with vertical cluster and two Members ie WebSphere_Portal and WebSphere_Portal_1
1) The Portal Cluster Creation was performed before the DB transfer
2) Second Portal Vertical Cluster member was created after the DB transfer
3) DB Oracle :Schema Names , FDKBUSR,LMDBUSR,RELDBUSR,COMDBUSR,CUSTDBUSR,
JCRDBUSR
4) The error were only displayed in the SystemOut.log for Second Portal Member
“WebSphere_Portal_1”
Steps Taken:
As the logs mentioned some locking errors,
a) I stopped WebSphere_Portal and just working on “WebSphere_Portal_1” still same error on WebSphere_Portal_1
b) I started WebSphere_Portal_1 first and then started WebSphere_Portal ..still same error on WebSphere_Portal_1
On reanalyzing the logs found this entry in the logs of WebSphere_Portal_1
“Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-00942: table or view does not exist
{prepstmnt 1108295475 SELECT t0.VPID FROM jcr.WCM_VPORTALS t0 WHERE t0.VPID = ?} [code=942, state=42000]”
>>Our schema for JCRDB is JCRDBUSR whereas in the error its referring to “SELECT t0.VPID FROM jcr.WCM_VPORTALS t0 WHERE t0.VPID = ?}”
Also this table didn’t exist in the Database
So it seems “WebSphere_Portal_1” was somehow referring to the default schema instead of the one configured for the Cluster
Solution :
On checking the WebSphere Variable Under Scope : Node : Nodename and Server = ServerName
Ie Scope : Node : NodeName and Server : WebSphere_Portal_1
Here the Variable for WebSphere_Portal_1
WCM_Schema : jcr
WCM_DATASOURCE= jdbc/wpdbDS
These were the default settings but those details were not as per our environment
Comparing with same variables from WebSphere_Portal for these parameters
For WebSphere_Portal the variables were :
WCM_Schema : JCRDBUSR
WCM_DATASOURCE= jdbc/wpdbDS_jcr
WCM_PORT=10028
I changed the Websphere Variable for Node : NodeName and Server : WebSphere_Portal_1 from
WCM_Schema : jcr
WCM_DATASOURCE= jdbc/wpdbDS
WCM_PORT=10028
To
WCM_Schema : JCRDBUSR
WCM_DATASOURCE= jdbc/wpdbDS_jcr
WCM_PORT=10103
>>Sync the config and Save the changes
>>Restart the Portal Servers
This resolved the Errors from the logs and we were able to login and access the portal url of WebSphere_Portal_1
Additional Link:
Later found this link which mentions to make those changes if “transferred your databases after you created the cluster, “
https://www.ibm.com/support/knowledgecenter/SSHRKX_8.5.0/mp/install/add_vert_clus.html
“ If you transferred your databases after you created the cluster, complete the following steps on each vertical cluster member:
- Log on to the deployment manager WebSphere Integrated Solutions Console.
- Go to Environment > WebSphere Variables.
- From the Scope menu, select the Node=nodename, Server=servername option to narrow the scope of the listed variables. Node=nodename is the node that contains the WebSphere Portal application server.
- Update the WCM_DATASOURCE variable with the JCR data source name. Create the variable in the jdbc/jcr.DataSourceName format. For example, jdbc/wpdbds_jcr.
- Save all changes and synchronize the nodes.