Friday, October 18, 2013

Webcenter Content: How to get all Aliases

In Webcenter Content you can create a group of users that can be then referenced by a single name, or ALIAS, in workflows, subscriptions, and projects.

Sometimes you may need to develop a custom user interface to view or manage Aliases. Below you have an example code which I use to load list of Webcenter Content Aliases. What more, you can with this code get users list per each Alias:

  IdcClient idcClient;
  IdcContext userContext;

    // .......... 

    // UcmAlias is my custom object which contains alias metadata


    Map<String,UcmAlias> aliases = new LinkedHashMap<String,UcmAlias>();
    DataBinder binder = idcClient.createBinder();           
    binder.putLocal("IdcService", "GET_ALIASES");
    ServiceResponse response = idcClient.sendRequest (userContext, binder); 
    DataBinder serverBinder = response.getResponseAsBinder();
    DataResultSet resultSet =
        serverBinder.getResultSet("Alias");
    for (DataObject dataObject : resultSet.getRows()) {
      UcmAlias alias = new UcmAlias();
      String nazwa = dataObject.get("dAlias");
      alias.setDAlias(nazwa);
      alias.setDAliasDescription(dataObject.get("dAliasDescription"));
      alias.setDAliasDisplayName(dataObject.get("dAliasDisplayName"));
      List<String> users = new ArrayList<String>();
      alias.setUsers(users);
      
      aliases.put(nazwa,alias);
    }
    DataResultSet resultSet1 =
        serverBinder.getResultSet("AliasUserMap");
    for (DataObject dataObject : resultSet1.getRows()) {
      String nazwa = dataObject.get("dAlias");
      String user = dataObject.get("dUserName");
      
      aliases.get(nazwa).getUsers().add(user);
    }
   
    // here you get list of all aliases in custom map

JSF Tables and dynamic data models

I came today to an interesting thread on one of the forums. The discussion was concerned to "dynamic" data models of JSF data tables. Because this issue focuses in the center of my current interest, I want write a few words on this topic.

Returning to the forum entries, one of participants argued that :

" ... When workig on real application there are a thousands of even a millions rows.

But I have seen several JSF dagatable components.
They implement pagination, sorting and filtering on client side!! According to me this is very silly. This technology is called enterprise and they sort the data on the client side with java script!

I have not seen any good JSF data grid that has build in features for sorting, filtering and lazy loading on the server side.

Why is that? Am I looking in wrong direction or really there in no build support for this. Lately I am testing primefaces and lazy loading datatable. It really works fine, but the table i can only lazy load. If you add sort and filter then the problems begin...

Is there any datatable JSF component than can perform lazy load pagination, and filtering and sorting on server side?"

One of answers was:

No, there isn't. Because the component library cannot know what will be the persistence mechanism.

In my opinion the answer isn't correct. There are implementations of JSF components where problem was solved. One of this is ADF Faces based on Apache Trinidad component set. The second is by example Richfaces with data table component.
But, in fact, in ADF Faces the data model which supports sorting or searching on the server side is a very specific solution. In this sense cited answer is valid. Table component designed as generic solution, without "knowledge" about model and based on JSF standard data model (javax.faces.model.DataModel), can't deal with logic which obviously should work on the model side.

Ok. In conclusion the problem can be solved, but don't exists a one standard solution method. So let's see what solutions are used.

In ADF Faces ADF Table (af:table) component can "consume" model derived from org.apache.myfaces.trinidad.model.CollectionModel. The same data model is used by the Trinidad Table and Iterator components. CollectionModel class extends the Faces DataModel (javax.faces.model.DataModel) class and adds on support for rowKeys and sorting. What more construction of CollectionModel class provides possibility to implement simple lazy, incremental loading of data portions.

Very elegant solution is the fact that ordinary DataModels are still supported, and will automatically be wrapped into CollectionModels. However, in this case, the functionality added by CollecionModel isn't anymore supported.

An important feature is support for rowKeys. In the Faces DataModel, rows are identified entirely by index. This causes major problems if the underlying data changes from one request to the next - a user request to delete one row may delete a different row because a row got added by another user, etc. To work around this, CollectionModel is based around unique row keys.

Although Trinidad CollectionModel looks like complete solution, however some functionalities like filtering are solved outside of main model class. The specific properties of ADF BC are used to provide those functions.

Different approach to the problem presents RichFaces. Base class for all models used by RichFaces is org.ajax4jsf.model.ExtendedDataModel. Just as in Trinidad CollectionModel, ExtendedDataModel introduces rowKeys as an unique identification of rows. ExtendedDataModel introduces also one simple method to "walk" through the data collection. In CollectionModel class isn't so easy to figure out where we should load the data from external datasource, and because of this I like the solution in ExtendedDataModel.

Default implementation of the ExtendedDataModel for the tables when filtering and sorting will be not used is SequenceDataModel. But functionalities like sorting and filtering need the more extensive model. For this purpose RichFaces provides org.richfaces.model.ArrangeableModel, an implementation of the ExtendedDataModel which implements Arrangeable interface for sorting and filtering support.

Class ArrangeableModel contains one universal method arrange which can be used in derived classes when implementing sorting and filtering behaviours. The object org.richfaces.model.ArrangeableState passed as a parameter to arrange method contains informations sufficient for implementing own mechanism of sorting or filtering.

Comparing the two presented approaches, especially when you compare source code, it is easy to see that JBoss approach looks very simple and clean, whereas Oracle's code is at first sight unclear. On the other hand Trinidad CollectionModel is direct implementation of javax.faces.model.DataModel without any additional "decoration", and because of this can look some poor. What more af:table component used in combination with ADF Bussiness Components is the best I've ever seen, because of possibility to create fully dynamic data table in seconds and only declaratively.

The purpose of my exercise wasn't comparison of datatable models only for the sake of this article. A problem which I wrote about refers to the situation when we create custom datatable component and we should decide what model of data would be used.

The basic idea was that the designed component will have built-in features for sorting, filtering and lazy loading, all working on the server side. As I wrote, there doesn't exists ready mechanism for these functionalities in base JSF DataModel implementation. Different vendors provide own specific solutions of this problem.

The component based on Datatables plug-in for the jQuery Javascript library has extensive user interface with possibility of sorting, filtering, lazy-loading, in-place editing and so on. The only problem was to design a model that will let easy to implement server-side logic. What more the model should let us consume in easy way the models developed for datatable components from ADF (Trinidad) and RichFaces sets. At the first sight, because of simplicity of solution for server-side filtering we choosed RichFaces approach as our pattern. But then we decided to turn back and start extending javax.faces.model.DataModel in our own way. We also provide possibility to consume in our datatable any object which implementats the Trinidad CollectionModel. This works on-the-fly through the wrapping original model and dynamic conversion of the methods calls.

Friday, October 4, 2013

ADF how-to: using af:message component inside an af:iterator

Sometimes you need create dynamic collections of form elements. What more you might want to have collecion with variable number of elements/rows. In this situation you would use af:iterator and inside this component any set of inputs like af:inputText. When you also need validate those inputs, achieving the desired effect can be difficult, especially when you want to use separate af:message against each input component.

The problem is that when a control is used inside an iterator, its ID changes internally to account the fact that there would be otherwise duplicate IDs. Cause of this if the af:message component is not configured properly for the iterator, it woludn't work properly.

Here is an example hot to use af:message components inside af:iterator:
<af:iterator id="i1" value="#{backingBeanScope.MyBean.listForIterator}" varStatus="vs">

    <af:inputText label="Input #{vs.index}" id="it1">

          <af:validateLongRange minimum="5" maximum="10"/>

    </af:inputText>

    <af:message id="m1" for="#{vs.index}:it1"/>

</af:iterator>

..

ADF: Error "java.lang.ClassNotFoundException:oracle.adf.model.servlet.ADFBindingFilter" or "Caused by: java.lang.ClassNotFoundException: oracle.adf.library.webapp.ResourceServlet" is thrown when deploying Application WAR File directly to Weblogic

This error is caused by specific construction of Weblogic Server. The error can look like:

[01:08:16 PM] Weblogic Server Exception: weblogic.application.ModuleException: Failed to load webapp: 'ViewController_webapp1.war'
[01:08:16 PM] Caused by: java.lang.ClassNotFoundException: oracle.adf.library.webapp.ResourceServlet
[01:08:16 PM]   See server logs or server console for more details.
[01:08:16 PM] weblogic.application.ModuleException: Failed to load webapp: 'ViewController_webapp1.war'


Generally speaking, do not deploy ADF application in the form of WAR directly. Oracle says: "ADF applications that use business components need the weblogic-application.xml deployment descriptor to be present to be able to work on a WLS.". In other words to deploy ADF Web Application you should wrap the WAR file in an EAR file, and next deploy EAR to Weblogic.

Wednesday, October 2, 2013

Webcenter Portal MDS Error: MDS-00168: MDS object oracle.mds.core.MDSInstance@2ba79b5 is being used after it or its MDSInstance or PManager has been released.

Because of cited below error I can't sleep last days:)

[2013-10-01T15:02:21.093+02:00] [WC_Portal1] [NOTIFICATION] [] [oracle.webcenter.framework.service] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: S5346] [ecid: 85a78414c7dd2b93:8c4d4b8:14173cb601b:-8000-00000000000027f9,0] [APP: WiPortal_application1] [DSID: 0000K5o674pCwk85njP5iZ1IIfCB00005b] Ścieżka wymaganego zasobu: /oracle/webcenter/portalapp/shared/js/jquery.ui.sortable.js
[2013-10-01T15:02:21.093+02:00] [WC_Portal1] [ERROR] [] [org.apache.myfaces.trinidad.webapp.ResourceServlet] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: S5346] [ecid: 85a78414c7dd2b93:8c4d4b8:14173cb601b:-8000-00000000000027f9,0] [APP: WiPortal_application1] [DSID: 0000K5o674pCwk85njP5iZ1IIfCB00005b] An Exception occured in ResourceServlet.service().[[
  request.pathTranslated:C:\oracle\fmw\user_projects\domains\WI\servers\WC_Portal1\tmp\_WL_user\WiPortal_application1\2qz9by\war\js\jquery.ui.sortable.js
  request.requestURI:/wi/oracle/webcenter/portalapp/shared/js/jquery.ui.sortable.js
  FacesContext: org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit@2612948
  ServletContext: ServletContext@35122915[app:WiPortal_application1 module:mir path:/mir spec-version:2.5]
 oracle.mds.exception.MDSRuntimeException: MDS-00168: MDS object oracle.mds.core.MDSInstance@2ba79b5 is being used after it or its MDSInstance or PManager has been released.
    at oracle.mds.core.MDSInstance.checkNotReleased(MDSInstance.java:1600)
    at oracle.mds.core.MDSInstance.getPersistenceManager(MDSInstance.java:906)
    at oracle.mds.core.MDSSession.getPersistenceManager(MDSSession.java:2792)
    at oracle.mds.internal.net.AbstractOraMDSURLConnection.getLastModified(AbstractOraMDSURLConnection.java:435)
    at oracle.mds.internal.net.OraMDSURLConnection.getLastModified(OraMDSURLConnection.java:127)
    at org.apache.myfaces.trinidad.util.URLUtils.getLastModified(URLUtils.java:86)
    at org.apache.myfaces.trinidad.util.URLUtils.getLastModified(URLUtils.java:46)
    at org.apache.myfaces.trinidad.webapp.ResourceServlet.getLastModified(ResourceServlet.java:261)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:703)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.apache.myfaces.trinidad.webapp.ResourceServlet.service(ResourceServlet.java:166)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:181)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:74)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

]]
[2013-10-01T15:02:21.124+02:00] [WC_Portal1] [NOTIFICATION] [] [oracle.webcenter.framework.service] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: S5346] [ecid: 85a78414c7dd2b93:8c4d4b8:14173cb601b:-8000-00000000000027fb,0] [APP: WiPortal_application1] [DSID: 0000K5o674pCwk85njP5iZ1IIfCB00005b] Ścieżka wymaganego zasobu: /oracle/webcenter/portalapp/shared/js/jquery.metroui.js
[2013-10-01T15:02:21.124+02:00] [WC_Portal1] [ERROR] [] [org.apache.myfaces.trinidad.webapp.ResourceServlet] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: S5346] [ecid: 85a78414c7dd2b93:8c4d4b8:14173cb601b:-8000-00000000000027fb,0] [APP: WiPortal_application1] [DSID: 0000K5o674pCwk85njP5iZ1IIfCB00005b] An Exception occured in ResourceServlet.service().[[
  request.pathTranslated:C:\oracle\fmw\user_projects\domains\WI\servers\WC_Portal1\tmp\_WL_user\WiPortal_application1\2qz9by\war\js\jquery.metroui.js
  request.requestURI:/wi/oracle/webcenter/portalapp/shared/js/jquery.metroui.js
  FacesContext: org.apache.myfaces.trinidadinternal.context.FacesContextFactoryImpl$CacheRenderKit@2654905
  ServletContext: ServletContext@35122915[app:WiPortal_application1 module:mir path:/mir spec-version:2.5]
 oracle.mds.exception.MDSRuntimeException: MDS-00168: MDS object oracle.mds.core.MDSInstance@2ba79b5 is being used after it or its MDSInstance or PManager has been released.
    at oracle.mds.core.MDSInstance.checkNotReleased(MDSInstance.java:1600)
    at oracle.mds.core.MDSInstance.getPersistenceManager(MDSInstance.java:906)
    at oracle.mds.core.MDSSession.getPersistenceManager(MDSSession.java:2792)
    at oracle.mds.internal.net.AbstractOraMDSURLConnection.getLastModified(AbstractOraMDSURLConnection.java:435)
    at oracle.mds.internal.net.OraMDSURLConnection.getLastModified(OraMDSURLConnection.java:127)
    at org.apache.myfaces.trinidad.util.URLUtils.getLastModified(URLUtils.java:86)
    at org.apache.myfaces.trinidad.util.URLUtils.getLastModified(URLUtils.java:46)
    at org.apache.myfaces.trinidad.webapp.ResourceServlet.getLastModified(ResourceServlet.java:261)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:703)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.apache.myfaces.trinidad.webapp.ResourceServlet.service(ResourceServlet.java:166)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:181)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.wcps.client.PersonalizationFilter.doFilter(PersonalizationFilter.java:74)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.webcenter.content.integration.servlets.ContentServletFilter.doFilter(ContentServletFilter.java:168)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:324)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:460)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:163)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

]]

After small investigation I found some infos regarding identical error with suggestion, that this error can occur in development stage in JDeveloper when the project is run many times without restarting the integrated WebLogic server.

The main cause is know issue:

"To initialize the ADFShare components in a web environment the oracle.adf.share.http.ServletADFContext must be initialized per request. Normally, this is achieved because the jdev design time adds the ADFBindingFilter to the project web.xml when certain actions are taken (like creating a binding on a page). However, it is still possible to use the ADFContext without this design time support. The ServletADFFilter must be used for correct use of ADFContext. ServletADFFilter specifically setup ServletADFContext properly at the start of the request. The ADFBindingFilter does that and other stuff also."

The suggested solution is to add the definition for the ServletADFContextFilter to web.xml:

...
<filter>
  <filter-name>ServletADFContextFilter</filter-name>
  <filter-class>oracle.adf.share.http.ServletADFFilter</filter-class>
</filter>
<filter-mapping>
  <filter-name>ServletADFContextFilter</filter-name>
  <url-pattern>/*</url-pattern>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>FORWARD</dispatcher>
</filter-mapping>
...  

But. In my case error occurs in environment not integrated with JDeveloper, in Webcenter Portal managed server. What a more, MDS domain is cleared before each deployment.

If I will find any solution, I will share it with you. But now my problem is not solved.

Oracle SOA problem: javax.transaction.xa.XAException: Unexpected error during start for XAResource 'SOADataSource'

Last time I fixed a following SOA error:
<2013-09-19 21:28:50 CEST> <Error> <oracle.soa.mediator.common.listener> <BEA-000000> <DBLocker caught exception while locking messages
Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.5.0) (Build 110305)): oracle.toplink.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'SOADataSource_SEOD': XAER_RMERR : A resource manager error has occured in the transaction branch
javax.transaction.xa.XAException: Unexpected error during start for XAResource 'SOADataSource': Transaction timed out after 29 seconds 
BEA1-674681EEEF9446F2E2A4
    at weblogic.jdbc.wrapper.XA.createException(XA.java:103)
    at weblogic.jdbc.jta.DataSource.start(DataSource.java:792)
    at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1231)
    at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1164)
    at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:285)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:522)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:449)
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1599)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1503)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:123)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:84)
    at oracle.toplink.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:153)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:273)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:231)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:478)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1347)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:251)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:512)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:468)
    at oracle.toplink.internal.sessions.AbstractSession.executeCall(AbstractSession.java:800)
    at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:115)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:222)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:202)
    at oracle.toplink.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:55)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:679)
    at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:602)
    at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2807)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1079)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1063)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1037)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1009)
    at oracle.tip.mediator.common.error.ErrorDBLocker.lock(ErrorDBLocker.java:90)
    at oracle.tip.mediator.common.listener.DBLocker.lockMessages(DBLocker.java:113)
    at oracle.tip.mediator.common.listener.DBLocker.run(DBLocker.java:77)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)

    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1604)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1503)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:123)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:84)
    at oracle.toplink.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:153)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:273)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:231)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:478)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1347)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:251)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:512)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:468)
    at oracle.toplink.internal.sessions.AbstractSession.executeCall(AbstractSession.java:800)
    at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:115)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:222)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:202)
    at oracle.toplink.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:55)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:679)
    at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:602)
    at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2807)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1079)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1063)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1037)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1009)
    at oracle.tip.mediator.common.error.ErrorDBLocker.lock(ErrorDBLocker.java:90)
    at oracle.tip.mediator.common.listener.DBLocker.lockMessages(DBLocker.java:113)
    at oracle.tip.mediator.common.listener.DBLocker.run(DBLocker.java:77)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)

Error Code: 0
Call: SQLCall(update  MEDIATOR_CASE_INSTANCE  set  STATUS ='locked',  LOCK_TIME =?,  CONTAINER_ID =? where  STATUS  = 'ready' and rownum < ?)
Query: DataModifyQuery()
    at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:282)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:128)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:84)
    at oracle.toplink.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:153)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:273)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:231)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:478)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1347)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:251)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:512)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:468)
    at oracle.toplink.internal.sessions.AbstractSession.executeCall(AbstractSession.java:800)
    at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:115)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:222)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:202)
    at oracle.toplink.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:55)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:679)
    at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:602)
    at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2807)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1079)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1063)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1037)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1009)
    at oracle.tip.mediator.common.error.ErrorDBLocker.lock(ErrorDBLocker.java:90)
    at oracle.tip.mediator.common.listener.DBLocker.lockMessages(DBLocker.java:113)
    at oracle.tip.mediator.common.listener.DBLocker.run(DBLocker.java:77)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
Caused By: java.sql.SQLException: Unexpected exception while enlisting XAConnection java.sql.SQLException: XA error: XAResource.XAER_RMERR start() failed on resource 'SOADataSource_SEOD': XAER_RMERR : A resource manager error has occured in the transaction branch
javax.transaction.xa.XAException: Unexpected error during start for XAResource 'SOADataSource': Transaction timed out after 29 seconds 
BEA1-674681EEEF9446F2E2A4
    at weblogic.jdbc.wrapper.XA.createException(XA.java:103)
    at weblogic.jdbc.jta.DataSource.start(DataSource.java:792)
    at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1231)
    at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1164)
    at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:285)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:522)
    at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:449)
    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1599)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1503)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:123)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:84)
    at oracle.toplink.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:153)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:273)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:231)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:478)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1347)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:251)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:512)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:468)
    at oracle.toplink.internal.sessions.AbstractSession.executeCall(AbstractSession.java:800)
    at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:115)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:222)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:202)
    at oracle.toplink.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:55)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:679)
    at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:602)
    at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2807)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1079)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1063)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1037)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1009)
    at oracle.tip.mediator.common.error.ErrorDBLocker.lock(ErrorDBLocker.java:90)
    at oracle.tip.mediator.common.listener.DBLocker.lockMessages(DBLocker.java:113)
    at oracle.tip.mediator.common.listener.DBLocker.run(DBLocker.java:77)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)

    at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1604)
    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1503)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:123)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:84)
    at oracle.toplink.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:153)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:273)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:231)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:478)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1347)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:251)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:512)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:468)
    at oracle.toplink.internal.sessions.AbstractSession.executeCall(AbstractSession.java:800)
    at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:115)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:222)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:202)
    at oracle.toplink.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:55)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:679)
    at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:602)
    at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2807)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1079)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1063)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1037)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1009)
    at oracle.tip.mediator.common.error.ErrorDBLocker.lock(ErrorDBLocker.java:90)
    at oracle.tip.mediator.common.listener.DBLocker.lockMessages(DBLocker.java:113)
    at oracle.tip.mediator.common.listener.DBLocker.run(DBLocker.java:77)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)

    at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1522)
    at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:446)
    at weblogic.jdbc.jta.DataSource.connect(DataSource.java:403)
    at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:364)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:123)
    at oracle.toplink.jndi.JNDIConnector.connect(JNDIConnector.java:84)
    at oracle.toplink.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:153)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.connectInternal(DatasourceAccessor.java:273)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:231)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.reconnect(DatasourceAccessor.java:478)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.reconnect(DatabaseAccessor.java:1347)
    at oracle.toplink.internal.databaseaccess.DatasourceAccessor.incrementCallCount(DatasourceAccessor.java:251)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:512)
    at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:468)
    at oracle.toplink.internal.sessions.AbstractSession.executeCall(AbstractSession.java:800)
    at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:115)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelectCall(DatasourceCallQueryMechanism.java:222)
    at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeNoSelect(DatasourceCallQueryMechanism.java:202)
    at oracle.toplink.queryframework.DataModifyQuery.executeDatabaseQuery(DataModifyQuery.java:55)
    at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:679)
    at oracle.toplink.queryframework.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:602)
    at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2807)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1079)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1063)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1037)
    at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1009)
    at oracle.tip.mediator.common.error.ErrorDBLocker.lock(ErrorDBLocker.java:90)
    at oracle.tip.mediator.common.listener.DBLocker.lockMessages(DBLocker.java:113)
    at oracle.tip.mediator.common.listener.DBLocker.run(DBLocker.java:77)
    at oracle.integration.platform.blocks.executor.WorkManagerExecutor$1.run(WorkManagerExecutor.java:120)
    at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:183)
    at weblogic.work.DaemonWorkThread.run(DaemonWorkThread.java:30)
> 
As I found the problem can occur due to several different reasons such as:
  • Database connection timeout 
  • Slow database 
  • Large message or payload size 
  •  Network interruption 
  • Transaction timeou
In my case I supposed slow database or any network issue. To fix it I tried to remove entry oracle.net.CONNECT_TIMEOUT=10000 from jdbc connection properties, as shown below:



In my case this workaround works perfectly. But I found also another solution, which I don't tried. It consist in the fact that the initial value of the entry oracle.net.CONNECT_TIMEOUT (which equals 10000) should be replaced with much higher value, by example 1000000.