November 21, 2015

How to import certificates to weblogic server

Below is the procedure to be done to import certificates to weblogic server.
  • Import or download the certificate to a local folder ex: D:\myprojects\Docs\certs\fap0424.cer ; where fap0424.cer is my certificate
  • Using below command, import the certificate to the weblogic server
keytool -import -alias fap0424  -file D:\myprojects\Docs\certs\fap0424.cer -keystore C:\Oracle\Middleware\JDev11.1.1.7.1\wlserver_10.3\server\lib\DemoTrust.jks
  • To verify the import, use below command which list out all the certificates in the weblogic server
keytool -list -alias fap0424 -keystore C:\Oracle\Middleware\JDev11.1.1.7.1\wlserver_10.3\server\lib\DemoTrust.jks

In the above example the file path C:\Oracle\Middleware\JDev11.1.1.7.1\wlserver_10.3\server\lib\DemoTrust.jks represents the weblogic file to which we should export our certificate.

November 18, 2015

java.sql.SQLException: stale connection

If you are getting the exception "java.sql.SQLException: stale connection" then you should check whether the Connection object is closed anywhere in the app and you are trying to access the same object. In this case, the object is closed and no longer available, so you can not do any execution on that object. 

Solution is to create a fresh connection object. 

If the error received in MAF apps, then remove the close statements as you don't need to close the connection in the mobile.

October 29, 2015

How to refresh a binding iterator through program

I have a data control created for a java class and using this I have created a table on a jspx page. On click of a button, I am doing some data changes in the bean and want to reflect them on the screen. Generally, we give partialTrigger to the table on the button which is alone not suffecient to update the content of the table on the page. The binding iterator has to be refreshed from the bean.

Below code snippet helps to refresh a binding iterator programmatically from ADF where "listRequestsIterator" is my binding iterator name on the page.          
   
BindingContext bctx = BindingContext.getCurrent();
BindingContainer bindings = bctx.getCurrentBindingsEntry();
DCIteratorBinding iter = (DCIteratorBinding)
bindings.get("listRequestsIterator");
iter.clearForRecreate();