Wednesday Dec 26, 2012

Debugging ADF Mobile Apps on Android

Not that you'll ever need this, after all your code is perfect. But I did run into a situation where I wanted to figure out what exactly is wrong with my ADF Mobile code. The way to do debugging is documented in the ADF Mobile Developer Guide, but here is a version of those instructions with nice pictures (which might make it easier for you to find files etc).

1. First locate the cvm.properties file (In the Application Resources accordion). In this file you'll want to change the value of java.debug.enabled to be true. Also note in this file the value set for java.debug.port,  by default this is 8000 and we are going to keep that default value in our example.

2. Next have a look at your application level deployment profile, or even better create a new deployment profile and call it debugDeploy. The key thing here is to make sure your build mode is in Debug mode and not Release mode (remember the previous post where we told you that Release mode creates a smaller/faster deployment, but right now we do need the bigger package to be able to debug).

3. Next deploy your application with your new debugDeploy profile. We'll assume deployment directly to the device.

4. Now from the command line locate the directory where your Android's SDK adb.exe utility is and issue the following command to let the device (-d) know that we are going to use port forwarding for debug:

adb -d forward tcp:8000 tcp:8000

5. Now on your device start your application. You'll notice that it seems to be stuck, well this is because it is waiting for the debugger to connect to it. So what are you waiting for?

6. In JDeveloper, stand on your viewController project and right click to choose debug. If you changed the port number you'll need to update that info in the dialog that pops up - but if you kept it at the default 8000 we should be ok.


The debugger will now try and connect to your running application, and will stop at the breakpoint you set.

Happy debugging.

By the way if you want to debug on the emulator of Android the only difference will be in step 4 where instead of -d you'll use a -e .

P.S. - you might also be interested in this blog entry about setting up logging on Android with ADF Mobile.

For iOS debugging tips see this blog entry by Joe.

Friday Jun 08, 2012

Introduction to the ADF Debugger

Not that you'll ever need this blog entry - after all there are never bugs in the code that YOU write. But maybe one day one of your peers will ask you for help debugging their ADF application so here we go...

One of the cool features of JDeveloper and ADF is the ADF Debugger - a way to debug the declarative pars of Oracle ADF. The debugger goes beyond your regular Java debugger and shows you in a clear way specific information related to Oracle ADF - things like where are you in the taskflow/region hierarchy, what is in your various scopes, what is the value of a specific EL and much more.

However, from the number of posts on OTN where people are saying "I placed a System.out.println() to see what the value was...", it seems that not many are familiar with the power of the debugger.

So here is a short demo that shows you some aspects of the debugger such as:

  • Setting breakpoints on various ADF artifacts
  • The ADF structure window
  • The ADF Data window
  • The EL Evaluater window

Want to learn more about debugging ADF applications - I highly recommend that you go back in time to 2009 and attend Steve Muench's OOW presentation about ADF debugging. Can't travel in time yet? Then the second best option is to look at his very clear ADF Debugging Slides, which were the inspiration to the above demo.

Wednesday Jan 07, 2009

Tomcat Extensions for JDeveloper 11g

I'm proud to introduce the Tomcat extension for JDeveloper (which can be used for other servers too*).

tomcat001.gif


Here is a little video of the extension at work.

This extension will let you start/stop and start in debug mode an external server such as Tomcat directly from inside JDeveloper.
You can then use the regular one-click deploy and remote debug to run/debug your application on that server.

To install the extension just use help->check for update from inside JDeveloper 11g. (or get it from Here. Note -for JDeveloper 11.1.2 and onward get this version)
Then go into Tools->Preferences->Tomcat and insert the names of 3 bat files that will start/stop/and start debug your server.
An example of these files on my machines are:

mystart.bat

set CATALINA_HOME=C:\apache-tomcat-6.0.18
C:\apache-tomcat-6.0.18\bin\startup.bat

myshutdown.bat

set CATALINA_HOME=C:\apache-tomcat-6.0.18
C:\apache-tomcat-6.0.18\bin\shutdown.bat

mystartdbg.bat

SET JPDA_ADDRESS=4000
SET JPDA_TRANSPORT=dt_socket
SET CATALINA_HOME=C:\apache-tomcat-6.0.18
C:\apache-tomcat-6.0.18\bin\catalina jpda start

I built this extension mostly as another sample for extension development capabilities. I'll post another blog entry highlighting some of the things it shows about extension development. You can download a JDeveloper project with the source for the extension from here - feel free to improve it (especially the Tomcat icons).

*While the extension is called the tomcat extension, you can use it for any other server that you can invoke with bat files - just point to them in the tomcat preferences.

Enjoy,
Shay

P.S. - looking for tips on getting ADF 11g to work on Tomcat see Dana's blog, and this OTN Thread.

Here is the video showing the extension in action:

About

me
I'm a Director of Product Management for the Oracle Java Development Tools.
Follow me:
Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today