Showing posts with label Debugging. Show all posts
Showing posts with label Debugging. Show all posts

Saturday, December 15, 2012

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.

Wednesday, October 3, 2012

Jdeveloper Remote Debugging

Sometimes we see application issues on standalone weblogic server which is not reproducible while running the same application in integerated weblogic server inside Jdeveloper..

The best option is remote debugging.. Its very simple to setup..

1. Open the file $DOMAIN_HOME/bin/setDomainEnv.cmd
    a. set debugFlag = true
    b. Disable assertions: search for -ea and replace it with -da (keep a backup to restore it)
    c. Note down the debug_port (default is 8453).
    d. Start weblogic server. Make sure that you see Listening for transport dt_socket at address: 8453 in the
        Server log file.


2. On Jdeveloper:

Right click your project -> Project Properties


Run/Debug/Profile -> Edit


 Select Remote debugging



On Same Window, Select Tool Settings -> Debugger -> Remote and have the following settings.

Protocol -> Attach to JPDA
Host: Host of your WLS Server
Port: WLS Debugger port, default is 8453.


Right click your project, Start Remote Debugger.






That's it.. Now you have connected your remote application in debug mode.. Put breakpoints on your code and see what's going on..

Happy Debugging :-)

Note : Please make sure that the code you have deployed in weblogic server and the code you have connected from jdeveloper are same.