Google Analytics

Tuesday, November 17, 2015

The loading of OPSS java security policy provider failed due to exception

ADF development mode "weblogic.security.SecurityInitializationException: The loading of OPSS java security policy provider failed due to exception" is a common issue that most of the ADF developers face.

Solutions:

1) Disable the virus guard and try. Still issue exists, consider point 2.

2) Close Jdeveloper. Rename the existing DefaultDomain. Open the Jdeveloper. Don't get previous Domain settings to new Domain. Still issue exist, consider point 3.

3) Close Jdeveloper. Find cwallet.sso file under MDW_H\DefaultDomain\config\fmwconfig and give the Admin rights to the file. Open the Jdeveloper. Still issue exists, consider point 4.

4) Close Jdeveloper. Find system-jazn-data.xml corrupted file under MDW_H\DefaultDomain\config\fmwconfig. Replace with newest system-jazn-data.xml file.

>Point 4 is worked for me. In my case jazn-data.xml file size is over 3.5 Mb and seems too big.       Jdeveloper try to merge the Application jazn-data.xml with integrated weblogic system-jazn-data.xml file. 

>If the file application jazn-data.xml file is too big  "java.io.IOException: The process cannot access the file because another process has locked a portion of the file" error occurred and after long time application deploy and run.

>Delete existing application roles to reduce the size. Then remove the application large jazn-data.xml and replace small jazn-data.xml file.

5) Every application deployment jazn-data.xml file overwrite/merge with system-jazn-data.xml file. This error can be stop by avoiding above merging process. Keep setting as below image.





More Details:
https://community.oracle.com/thread/2268436
http://fortunefusionminds.blogspot.com/2014/05/xmlstreamexception-end-document-reached.html

Tuesday, November 10, 2015

Statement cancelled, probably by transaction timing out

According to the below article, Oracle recommond normal(e.g. thin) DB driver over XA drivers. Presentation


In recent days/weeks I'm getting multiple requests with questions of following type: I have a problem with the rollback, I'm working with weblogic 10.3.6. In my application back when I do a rollback, but at the launch of the back gives me this error - java.sql.SQLException: Statement cancelled, probably by transaction timing out and similar. People are facing this issue when they move application to production or test server, on development environment embedded WebLogic everything works fine.

But really this is not an issue at all. What happens is - WebLogic administrators define wrong data source (XA data source). Error is not reproduced on embedded WebLogic, because data source is created automatically for you in development environment. XA data source should be never user with ADF/Fusion applications because it closes all cursors upon commit. Read more here from ADF developer guide - 
41.3.7 What You May Need to Know About JDBC Data Source for Oracle WebLogic Server. [Extracted from below article]

Please refer below article:
http://andrejusb.blogspot.com/2012/05/dont-use-oracles-driver-thin-xa-to.html

ADF Application Infinite Loop

Jsession Id can be set in ADF application to avoid session conflicts. However after change in that it makes infinite loop in URL with security enabled load balanced enviornment.

Below Article explain a solution:

http://www.trumbleshoot.com/home/announcements/adfapplicationinfiniteloopinaclusteredenvironment

ADF Jsession management

If you see below error message when two different contex root ADF applications request:





It may be due to session conflict. ADF use default sessionId and need to change according to the application.

Please see below URL:
http://rohanwalia.blogspot.com/2015/05/change-default-jsession-id-name-for-adf.html




Saturday, November 7, 2015

Clean the ADF session store table PS_TXN

Please follow below url to find out more details. Presentation

http://docs.oracle.com/cd/E12839_01/web.1111/b31974/bcstatemgmt.htm#ADFFD1313

40.5.4 Cleaning Up Temporary Storage Tables

JDeveloper provides the adfbc_purge_statesnapshots.sql script to help with periodically cleaning up the application module state management table. You can find this file in the oracle_common subdirectory of your Oracle Middleware installation directory (for example,ORACLE_HOME\oracle_common\common\sql).
Persistent snapshot records can accumulate over time if the server has been shutdown in an abnormal way, such as might occur during development or due to a server failure. Running the script in SQL*Plus will create the BC4J_CLEANUP PL/SQL package. The two relevant procedures in this package are:
  • PROCEDURE Session_State(olderThan DATE)
    This procedure cleans-up application module session state storage for sessions older than a given date.
  • PROCEDURE Session_State(olderThan_minutes INTEGER)
    This procedures cleans-up application module session state storage for sessions older than a given number of minutes.
You can schedule periodic cleanup of your ADF temporary persistence storage by submitting an invocation of the appropriate procedure in this package as a database job.
You can use an anonymous PL/SQL block like the one shown in Example 40-5 to schedule the execution ofbc4j_cleanup.session_state() to run starting tomorrow at 2:00am and each day thereafter to cleanup sessions whose state is over 1 day (1440 minutes) old.


Extracted from : http://docs.oracle.com/cd/E12839_01/web.1111/b31974/bcstatemgmt.htm#ADFFD1313


Tuesday, November 3, 2015

Oracle ADF Inital Page not loading - Invalid region

Oracle ADF 11.1.2.3.0 page content not show when the page contains too many ADF components.
We can test this by deleting several components and reload the page.

Also initial page load with empty gray page when AM DB data source configuration is wrong or Data source not created in weblogic. Also this may be a reason to invalid region error.

Invalid region error occurred when duplicate component ID exist.


Oracle ADF 11.1.2.4.0 AM Impl methods sometime generate unexpected null pointers .

ADF 11.1.2.4.0 AM Impl class method execution in bean should execute proper way to avoid null pointer exception
in some times (It is obvious that if you not add the method to page def first time, there is a null pointer). This behaviour not seen in 11.1.1.3.0 and 11.1.2.3.0.

Wrong code
Map results = (Map)perationBindingM.execute();

Correct code
perationBindingM.execute();
Map results = (Map)perationBindingM.getResult();

Map results = new HashMap);
try {
operationBindingM.execute();
if((!operationBindingM.getErrors().isEmpty())) {
results.put("ERROR : " + operationBindingM.getErrors());
return results;
} else {
return operationBindingM.getResult() != null ? (Map) operationBindingM.getResult() : null;
}
} catch (Exception e) {
results.put("ERROR", "Exception : "+ e.getMessage());
e.printStackTrace();
return results;
}

Oracle ADF LOV value change listener index selection convert to Value

ADF value change listner directly access index and hard code the valued according to the DB order will make issues when data order is changed. Presentation

String valChangeIndex = valueChangeEvent.getNewValue().toString();

0 - Male
1 - Female

Use as below.

public void aaaVCL(ValueChangeEvent valueChangeEvent) {
String indexValue = null;
if (valueChangeEvent == null || valueChangeEvent.getNewValue() == null) {
indexValue = "0";
} else {
indexValue = valueChangeEvent.getNewValue().toString();
}

String indexValueData =
(String)aaaUtils.evaluateEL("#{bindings.aaaVVO.items['" +
 indexValue + "'].label}");
}

public static Object evaluateEL (String el) {
FacesContext facesContext = FacesContext.getCurrentInstance();
ELContext elContext = facesContext.getELContext();
ExpressionFactory expressionFactory =
facesContext.getApplication().getExpressionFactory();
ValueExpression exp =
expressionFactory.createValueExpression(elContext, el,
Object.class);
return exp.getValue(elContext);
}