Wednesday, November 6, 2013

Oracle SOA: How to Configure Transaction Timeout for BPEL on SOA 11g

During runtime of your BPEL process you may be seeing errors like this:

Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: 
Transaction timed out after 30 seconds 
BEA1-484455D7A39364D50D1F
 at 
weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1788)

 at 
weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1676)

 at 
weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1988)

 at 
weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:1586)

 at 
weblogic.transaction.internal.WLSTimer.timerExpired(WLSTimer.java:35)
 at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
 at 
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)

 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
; nested exception is: weblogic.transaction.internal.TimedOutException: 
Transaction timed out after 30 seconds 
BEA1-484455D7A39364D50D1F

The solution is typically to increase the transaction timeout for the process.
But how do we could configure transaction timeout for BPEL on SOA 11g?

In the first, before we start changing, we should keep in mind two generall rules:
  • This solution is ONLY applicable to Sync Processes
  • syncMaxWaitTime < BPEL EJB's transaction timeout < Global Transaction Timeout

Let's start from syncMaxWaitTime. This property controls the maximum time the process result receiver will wait for a result before returning for Sync processes.

To change default value you should run Enterprise Manager and go to Farm -> SOA -> "soa-infra" branch and next select from context menu: SOA Administration -> BPEL Properties and expand "More BPEL Configuration Properties...".


Next thing you can change is BPEL EJB's transaction timeout. You can/should update the timeout for following EJB's:
  • BPELActivityManagerBean
  • BPELDeliveryBean
  • BPELDispatcherBean
  • BPELEngineBean
  • BPELFinderBean
  • BPELInstanceManagerBean
  • BPELProcessManagerBean
  • BPELSensorValuesBean
  • BPELServerManagerBean
The timeout properties for the EJBs control the particular timeout setting for the SOA application, overriding the global setting specified by the JTA timeou.

To perform changes you have to run Administration Console, stop SOA server/cluster and next go to Deployments -> soa-infra and expand this position:


For each of cited EJB's you can change default timeout value in Configuration tab (you have to click on selected EJB to view its properties and next select second tab described as Configuration).

To modify Global Transaction Timeout go to Services -> JTA in Administration Console, as shown below:


After applying this change you have to restart Weblogic Domain.


Tuesday, November 5, 2013

New and usefull services in WebcenterContent 11.1.1.8

In last version of WebcenterContent (UCM) I found two, new, very usefull services. The first of them is COPY_REVISION service.

The COPY_REVISION service copies one document revision, creating a new rev class from it. As says "Services Reference for Oracle WebCenter Content" most of the document metadata from the original revision will be carried over. The caller can also overwrite any metadata value by setting it in the request parameters.

You can use COPY_REVISION service as shown below:

// Databinder for Creating the clone request

DataBinder dataBinder = idcClient.createBinder();
dataBinder.putLocal("IdcService", "COPY_REVISION");

//Original Content dID and Content Id (dDocname)
dataBinder.putLocal("dID","1001");
dataBinder.putLocal("dDocName","001001");

//clone item Content ID - this is not mandatory - If set to Auto Content ID this need not be added 
//dataBinder.putLocal("newdDocName","Cloned_item");

//The user only needs READ permissions to the original document revision. 
//However, because the new revision inherits the metadata of the original, new security metadata values 
//must be set if the user does not have WRITE permissions to the original revision. By example you can modify group and ACL
dataBinder.putLocal("dSecurityGroup","New_better_group");
dataBinder.putLocal("xClbraUserList","your_user(RW)");

//If the original content is in a Contribution Folder (Folders_g) then below parameter is mandatory - Either blank Collection ID or set a new Folder ID
//In case of Framework Folder this parameter is not needed
dataBinder.putLocal("xCollectionID","1214234324324324");

//Clone Item's Content Title
dataBinder.putLocal("dDocTitle","Title-cloned");

//Any other new / custom metadata for Clone Item
dataBinder.putLocal("Custom","Clone Item Metadata");

Service returns two ResultSets:
  • NewDocInfo: Information about the newly created document.
  • OriginalDocInfo: Information about the original document that was copied.
Next interesting service is RESTORE_REVISION. The service restores the document revision corresponding to the supplied dID as a new (latest) revision.

To call this service you should supply only dID of source revision:


// Databinder for Creating the restore request

DataBinder dataBinder = idcClient.createBinder();
dataBinder.putLocal("IdcService", "RESTORE_REVISION");

//Original Content dID
dataBinder.putLocal("dID","1001");

As the results the service returns:
  • dID: The document ID of the new revision created.
  • dDocName: The document name of the new revision created.
  • dDocTitle: The document title of the new revision created.

HowTo: How to create JAX_WS WebMethod which returns a complex type, by example java.util.HashMap

In simple words, you can't do this directly. The only way is use of workaround.

But one by one. I decided to write this post after reading a few threads on Oracle's Forum. By example this thread: https://forums.oracle.com/message/7015500. I found also many other posts with issues "what to do when WebMethod returns null value instedad of complex type" - which is a typical symptom when you try to return an unacceptable type.

As says Java EE 6 Tutorial:

"JAX-WS delegates the mapping of Java programming language types to and from XML definitions to JAXB. Application developers don’t need to know the details of these mappings but should be aware that not every class in the Java language can be used as a method parameter or return type in JAX-WS."

next we have a list of Schema-to-Java mappings:

XML Schema Type Java Data Type
xsd:string java.lang.String
xsd:integer java.math.BigInteger
xsd:int int
xsd.long long
xsd:short short
xsd:decimal java.math.BigDecimal
xsd:float float
xsd:double double
xsd:boolean boolean
xsd:byte byte
xsd:QName javax.xml.namespace.QName
xsd:dateTime javax.xml.datatype.XMLGregorianCalendar
xsd:base64Binary byte[]
xsd:hexBinary byte[]
xsd:unsignedInt long
xsd:unsignedShort int
xsd:unsignedByte short
xsd:time javax.xml.datatype.XMLGregorianCalendar
xsd:date javax.xml.datatype.XMLGregorianCalendar
xsd:g javax.xml.datatype.XMLGregorianCalendar
xsd:anySimpleType java.lang.Object
xsd:anySimpleType java.lang.String
xsd:duration javax.xml.datatype.Duration
xsd:NOTATION javax.xml.namespace.QName

and Java-to-Schema mappings:

Java Class XML Data Type
java.lang.String xs:string
java.math.BigInteger xs:integer
java.math.BigDecimal xs:decimal
java.util.Calendar xs:dateTime
java.util.Date xs:dateTime
javax.xml.namespace.QName xs:QName
java.net.URI xs:string
javax.xml.datatype.XMLGregorianCalendar xs:anySimpleType
javax.xml.datatype.Duration xs:duration
java.lang.Object xs:anyType
java.awt.Image xs:base64Binary
javax.activation.DataHandler xs:base64Binary
javax.xml.transform.Source xs:base64Binary
java.util.UUID xs:string

If your desired type wasn't listed above, you have to come up with some workaround. For types like lists and maps you can convert those types to array of simple java types. By example:

/**
* We need return Map<String,String> but because we can't do this, 
* we would use workaround and return an two-dimensional array of Strings
*/

@WebMethod()
@WebResult(name="MyMethod",targetNamespace="http://my-java-planet.blogspot.com/my-java-planet")
public String[][] MyMethod(
        @WebParam(name="Symbol",targetNamespace="http://my-java-planet.blogspot.com/my-java-planet") 
        String projectSymbol,             
        @WebParam(name="Year",targetNamespace="http://my-java-planet.blogspot.com/my-java-planet") 
        String projectYear)
{

      try
      {
             LinkedHashMap<String,String> re = getData(projectSymbol, projectYear); 
             
             String ra[][] = new String[re.size()][2]; 
             int i = 0; 
             for(Map.Entry<String,String> entry : re.entrySet())
             { 
                         ra[i][0] = entry.getKey(); 
                         ra[i][1] = entry.getValue(); 
                         i++; 
             } 
             return ra; 
      } 
      catch (Exception ex) 
      { 
             String methodName=Thread.currentThread().getStackTrace()[1].getMethodName();
             logger.severe("Exception "+ex.getMessage()+" in "+methodName );
             String re[][] = new String[][]{{"ERROR",ex.getMessage()}};
      }
} 

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.

Monday, September 30, 2013

ADF Faces: what is this _afrLoop parameter in ADF aplications URLs

When you access your ADF Faces application and navigate through the different pages, parameters like "_afrLoop" are added dynamically to the URL.

Because I had some problems to find informations regarding _afrLoop parameter, when I found finally needed informations, I decided to share them:)

As Oracle says parameter called New Window Detection Token: "is an unique identifier that is used by ADF Faces java script to determine if the current browser window is new or an existing window it's managing."

In addition, I found the info, that in ADF Faces 12c this "feature" is disabled.

But let's start from the beginning. I started looking for informations about _afrLoop cause of strange problem in my Webcenter Portal Application. Well, after the one of deployments I couldn't log in because of continuous reloads of the login page within the Internet Browser. While reloading, the value of the URL parameter _afrLoop was each time increased.
As it turned out I sought for the cause of the problem in wrong place. The problem was caused in the error in one of shared libraries.

Thursday, September 19, 2013

Polemics with article "Top 10 reasons why I don't like JSF"

I stumbled accidentally on the Bruno Borges article "Top 10 reasons why I don't like JSF". The title made me very interested, but soon I found that I do not agree with most of arguments. Hence my polemic.

Bruno wrotes (about the shortcomings of JSF):

    Extra step when defining a project's architecture
    " ... People insist on comparing JSF with other frameworks. They should stop doing that. You can compare MyFaces to RichFaces to Tapestry to Vaadin to GWT. JSF is a specification, not a final product.

    Vendors too insist on marketing JSF as a Web Framework. But they forget to mention that you will be locked-in to their implementation because of lots and lots of non-standard components. It ain't cool.

    You spend a week comparing *one* JSF implementation with other frameworks, and if you chose JSF, you then realize you have an extra step: you have to pick a vendor, an implementation, and then goes another week of POCs, tests and evaluations. And you'll be locked. It is not easy to move from one to another. Specially when you have to use those non-standard components to turn your project on something really functional."

   
    In my opinion, the part of the problem here lies in the confusion of concepts. If we talk about JSF implementation, we should know that there exists only few implementations of JSF specification. And mentioned RichFaces isn't JSF implementation, but it is a component library. Whereas in fact, MyFaces is an Apache implementation of JSF. JSF implementation implements the JSF API specification and contains at least the standard components to display any of the available basic ("plain vanilla") HTML elements, whereas JSF component library just adds extra components on top of the basic implementation. You can't compare MyFaces and RichFaces, cause it's no sense.
   
    In your projects you will usually use one selected JSF implementation. Generally if you will deploy applications to "full-featured" application server, you will have built-in JSF implementation. Of course you can change default implementations, but why?
    In servlet container environment (by example Tomcat) you should select the implementation and add appropriate libraries manually.
   
    Anyway, the main available implementations are:
  •         JSF RI (Mojarra)
  •         JBoss JSF
  •         MyFaces
    The separate part of JSF ecosystem is a library of components (like RichFaces). Well designed and developed libraries should work with each of above implementations. In fact, you can choose from many of libraries, like RichFaces, PrimeFaces, Tobago, Tomahawk, OpenFaces and so on.. Moreover, you can use multiple libraries at the same time, in the same project and in the same view.
   
    Worse, when the libraries are not properly designed and interfere with each other. But it is a problem of a different nature...
   
    Generally speaking, I think the above arguments are irrelevant. The only problem I see is, as they say in my country, the problem of wealth.

    Fragmented Community
    " ... Now, let's say you, developer, works on a project for 6 months, on top of RichFaces. Then you move to another project built on top of MyFaces. Yes, you will have to sign in to another mailing list. To another forum. Different from other products, JSF has no centralized community. If you are working with Wicket, you go to users@wicket.apache.org. If you are working with VRaptor, you go to their Forum. If you are working with JSF, you will need to sign up for at least 3 different mailing lists, sign up for 3 forums and probably, tens of blogs... "

    I agree, i can be a somte kind of problem, but the case is perhaps somewhat demonized :) Most of the problems which mus be solved during the development is common. Of course there exist large libraries, with complicated components, thus sometimes necessity of deep understanding its specifics is inevitable. But as I wrote, in my opinion it's the problem of wealth.

As regards the comparing MyFaces and RichFaces I wrote earlier.


    Fragmented Documentation
    " ...If community is important, imagine documentation. You must have bookmarks of all JSF implementations. If you work with GWT, you need only one. If you work with SpringMVC, just go to springframework.org. Also there's the problem of non-standard components. Let's say you are working with Seam, and you have to bind some component to some RichFaces component. Where will you find a documentation about that? There's no such thing. If you are luck, you might find some blog post on Google. Odds you won't find. You will discover by yourself after hours of debugging and tracing, and in the end, you will not blog about that too. You will just move on... "


We are dealing again with the problem of mixing of concepts. If you have any problem with core JSF, then regardless of the implementation you can solve it in common way. In my opinion JSF is standarized sufficient. You don't need search the solutions in community because you have a lot of documentation, starting from JSF and Java EE specification to the lot of  books like "Core JSF","JavaServer Faces 2.0, The Complete Reference", and so on. Whereas, if you have a problem which is specific to (by example) RichFaces components, you should search in RichFaces documentation. But this isn't a problem of poor documented JSF framework but eventual problem of documentation of RichFaces library.

    Personally I work in recent years with ADF Faces which is in fact poorly documented. The ADF component library is very huge and often causes some problems:) but I haven't lot of difficulties to distinguish between problems on core, implementation level and problems caused clearly by ADF. And if the problem lies on core JSF level, the solution can be find quite easily and it was because of extensive documentation.

    Component Incompatibility
"... Component interoperability between different components can't be easily documented because of JSF's nature. This (documentation) also happens on some non-standard frameworks, but there are others that the core architecture helps a lot the developer to just don't care about this. Wicket is one of them. Components are grained and independent. If you want to interoperate different components, you simply share a Model or deal with events..."

This is a truth.  Some of the components sourced from outside the standard libraries have the problems of interoperability. On the other hand, it is rather a problem of ill-conceived implementation.

    Caveats on some scenarios because of different implementations
" ...This one I heard from a JSF developer. He said RichFaces fires rendering updates in a different way to MyFaces Trinidad. If the developer must be aware of that, odds are you won't find proficient JSF developers.

    I pointed about this one at the Web Frameworks discussion at JavaOne. It is not easy to find a Wicket developer, or a Vaadin developer. But when you find them, probability is they will be proficient, or at least above regular web developers.

    With JSF, which has tons and tons of job offers around the world, but lots of implementations and caveats, probability is that you will easily and quickly find a JSF developer to hire, but he or she won't be proficient. They will be regular developers. I'm not saying this is 100% true. Of course it is possible to find a proficient JSF developer. But with different implementations, it is hard to find one that knows all about of their tricks, tips, issues and secrets..."


Next problem of wealth:). The libraries of components are sometimes really huge. And there is lot of libraries. But I thought that it proof that JSF is popular and better than others.

Actually there is difficult to find a specialist in everything. But it is not true that it is so difficult to move from one library to another. Basis, the implementation remains the standard.
 

    Designers and developers roles mixed
"Oracle said it has set up JDeveloper or some other inside tool with JSF support to their web designers. Now, this is cool. You teach web designers to define templates, UIs, using the Java IDE. In the end you have the view done and all JEE devs need to do is to bind, code and run.

    This is one way of doing it. But usually, it is not the case. Most companies have Web Designers working on Mac, with Photoshop and Dreamweaver or some other WYSIWYG editor. They are great designers partly because of great tools.

    With JSF, designers and developers mix their work. Designers spend their time templating. Developers spend most of their time fixing broken templates after mixing them with JSF components. Now this, ain't cool at all.rs..."


Facelets changes a lot, and now this is default view declaration language for JSF. Using facelets you design webpages in "plain" xhtml.

    Non-functional prototype
"... it sucks a lot when your web designer changes the UI and you must merge those changes. What if you had a functional prototype you can share with your Web Designer? Some frameworks do that. Tapestr and Wicket for example. The output is HTML, your are building HTML, your designer gives you HTML, so why not take advantage of that work done on a previous stage?"

Facelets (nowe default VDL) has a built-in powerful templating functionality:)

    Performance
"Just Google for benchmarks comparing JSF with any other Java Web Framework. The lifecycle is just huge.... "

Hmm. Maybe agree, maybe not. As I suppose most of benchmarks compares old style JSF apps (JSF 1.* and JSP based).

    Web is fast, standards are slow
"... HTML5 is almost there, and we are still waiting for a specification that really improves the Web Development Process. Again, JSF2 is a huge step forward, but too late, and just like to what happened with EJB, people are now afraid of it because its previous version. And that's why people started to choose Rails, Python, GWT and other frameworks.
 

Long learning curve. Slow improvements (thanks to JCP). Everything the Web does not need. Everything Agile methodologies are against to."

Agree:) The learning curve is not optimal. But when a developer has the necessary experience her/his productivity is really very well.