Saturday, December 15, 2012

Never forget resetActionListener when there is rollbackTransaction action


Whenever you put a button (any action component) to rollbackTransaction make sure you have resetActionListener also.. Usually when you drag and drop rollback operation as action component this is created by default. But in the scenarios where you add action component separately you have to put it manually..

Many times I missed to put resetActionListener inside my button and the application data looks very odd when I click Cancel button... And I spent hours to debug the issue and found that resetActionListener  is missing..

<af:commandToolbarButton text="#{viewcontrollerBundle.DISCARD_CHANGES}" id="ctb2"
                                                   icon="/images/Discard.png" accessKey="Z"
                                                   actionListener="#{ManagedBean.rollbackChanges}" immediate="true">
         <af:resetActionListener/>
</af:commandToolbarButton>

So never forget(saying to myself) resetActionListener and rollbackTransaction!!

Jdeveloper 11.1.2.0 & Debug Mode

When you run the application in Debug mode in Jdeveloper 11.1.2.0, compile any java file and refresh the page you get java.lang.NullPointerException.

This issue is discussed in detail at
https://forums.oracle.com/forums/thread.jspa?threadID=2244097&tstart=0

and the summary is:
------------------------------------------------------------------------------------------
Option 1:  Change Tools->Preferences->Run->WebLogic and setting Select Hot Class Reload Policy to Fast Swap.

Option 2 : Turn off copying of any rebuilt files into the exploded EAR.
Usually the jdev shortcut target will be:
C:\Oracle\Middleware\jdeveloper\jdeveloper.exe

Modify this to C:\Oracle\Middleware\jdeveloper\jdeveloper.exe -J-Doracle.jdeveloper.adrs.incr.buildMonitor=false
and then restart jdeveloper.

Please use option 2 as a last resort. Since the debugger already provides some support for class redefinition, perhaps this will be useful for many who use debug mode.
------------------------------------------------------------------------------------------

I set Option 1 and it was working fine. But my weblogic server started crashing intermittently. I'm still working on exact reproducible steps but meanwhile I tried option 2 and it works properly.

East to West

Moved to California from New York.. Just got settle down..

Next posts are on the way...

Thiru