Wednesday, March 6, 2013

Set remote debugging in JDeveloper + WebLogic Server

Some troubles were for me to set the remote debugging in JDeveloper.
I want to share my knowledge in this area.
First of all you must have installed JDeveloper and WebLogic (local or remote(on remote server)).
I will provide you information when the WebLogic was installed on local machine.

MAIN STEPS WITH IMAGES:

1)  Go to directory <disk>:\<folder_where_server_is_lying>\user_projects\domains\<your_domain>\bin, open the file setDomainEnv.cmd and in this file set next property
set debugFlag=true  (you can set that property in the begining of the file in after set BEA_JAVA_HOME=)
      *REMARK (if you start two or more servers, the first one will be weblogic and the second one will be soa server for example, the soa server won't run because of port conflict) If you have some servers the best way to "set debugFlag" in the file named startWebLogic.cmd in the same directory (<disk>:\<folder_where_server_is_lying>\user_projects\domains\<your_domain>\bin). Set the "set debugFlag=true" before "set DOMAIN_HOME".
 
This flag provide you default debug port 8453. After that restart your server. In WebLogic-console you will see the next:
Great ! The first step is over.

2) (optional) Go to WebLogic console in browser, when the WebLogic Server started its work. Click to environment -> servers -> and in the right part choose the runnig server on which you want to set remote debugging.

After click go to the tab debug as on picture below
After that you should click on "+" near weblogic in column "Debug Scopes and Attributes" than look through the attributes which you want to log more info about component's working into the 'black' console of WebLogic Server , check them and click button "Enabled". After that you may not restart the server Weblogic.
 Great! Let's go to 3rd step =).

3) Open your JDeveloper. Open project. Deploy it on server WebLogic. Right mouse click and go to the project properties and look at the picture below

 Click on the "Edit" button

 After clicking "Remote" you should set the next options
 Click on "Ok" button.
The next step is to run the debug. Click on debug (bug) and you will see the message in JDeveloper console like

Debugger attempting to connect to remote process at localhost 8453.
Debugger connected to remote process at localhost 8453.
Debuggee process virtual machine is Java HotSpot(TM) 64-Bit Server VM.

And than run for example your JUnit test which call the Service which need to be debugged. If you want to debug JUnit tests you need to create new module where will be tests and specify the dependencies on other projects which connected with tests. =)

Good luck!

2 comments:

  1. Hi, I have a SOA enviroment and I need to debug (see the system outs in jdeveloper) In this case I need debug a ADF project that I need to run in a NODE of SOA (WC_customePortal) Do you hav any idea to how debug it? Thanks

    ReplyDelete
    Replies
    1. in setDomainEnv insert the following lines after "%WL_HOME%\common\bin\commEnv.cmd"


      if "%SERVER_NAME%"=="soa_server1" (
      set debugFlag=true
      )

      Delete