Tuesday, 31 May 2016

Reseting the table sort

Generally we can do sort on tables asc/desc order. Some times we need to reset the table. In that case use below code


  1. public void resetTableSort(RichTable tableComponent, String iteratorName)  
  2.   {  
  3.     BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();  
  4.     DCIteratorBinding iter = (DCIteratorBinding) bindings.get(iteratorName);  
  5.     tableComponent.queueEvent(new SortEvent(tableComponent, new ArrayList<SortCriterion>()));  
  6.     Key currentRow = null;  
  7.     Row row = iter.getCurrentRow();  
  8.     if (row != null)  
  9.     {  
  10.       currentRow = row.getKey();  
  11.     }  
  12.     SortCriteria[] sc = new SortCriteria[0];  
  13.     iter.applySortCriteria(sc);  
  14.     iter.executeQuery();  
  15.     if (currentRow != null)  
  16.     {  
  17.       iter.setCurrentRowWithKey(currentRow.toStringFormat(true));  
  18.     }  
  19.   }    


Error: Server Instance canot be started because Integrated WebLogicServer domain not build

Whenever we running JDeveloper first time(Server Instance) on Windows 8 or above versions of operating system, some times we are getting the below error.

The Server Instance cannot be started because the IntegratedWebLogicServer Domain was not built successfull.

and Log file is
------------------------------------------------------------------------------------------------------------

Adding environment variable to WLST script USER_MEM_ARGS = -Xms32m -Xmx1024m -XX:MaxPermSize=384m
Log File:      C:\Users\DevaRaju\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\o.j2ee.adrs\BuildDefaultDomain.log
Label:         JDEVADF_MAIN_GENERIC_151011.0031.S
Product Home:  F:\MWH_WEBCENTERJdev\Oracle\Middleware\jdeveloper\jdev\
Domain:        C:\Users\DevaRaju\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\DefaultDomain
BuildDefaultDomain1.py      2016-05-28 14:00:31
cmd.exe /c ""F:\MWH_WEBCENTERJdev\Oracle\Middleware\oracle_common\common\bin\wlst.cmd" "C:\Users\DevaRaju\AppData\Roaming\JDeveloper\system12.2.1.0.42.151011.0031\o.j2ee.adrs\BuildDefaultDomain1.py""
Process started
wlst >
wlst > Initializing WebLogic Scripting Tool (WLST) ...
wlst >
wlst > Welcome to WebLogic Server Administration Scripting Shell
wlst >
wlst > Type help() for help on available commands
wlst >
wlst > Failed to get environment, environ will be empty: (0, 'Failed to execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run program "sh": CreateProcess error=2, The system cannot find the file specified')
wlst > Error:  ADRS_DOMAIN_PASSWORD environment variable not set.
wlst >
wlst >
wlst > Exiting WebLogic Scripting Tool.
wlst >
wlst > Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
Elapsed time:  19384 ms

----------------------------------------------------------------------------------------------------------------------------------
Solution:
Log says that it not able to identify the OS name while running the script. for that
Open jython-modules.jar with any archiever. 

Go to C:\Oracle\Middleware\wlserver_10.3\common\wlst\modules\jython-modules.jar.
Extract the jython-modules.jar by winrar or any other utility. O

In lib folder open  javashell.py python script by notepad++ or editplus3 

Add the entry for your OS. Example Windows 8/windows 8.1/Windows 10
Save it and then restart the Jdeveloper and start the server instance.