The Source for Java Technology Collaboration
User: Password:



Gregg Sporar

Gregg Sporar's Blog

uPortal Development, Part 3

Posted by gsporar on February 27, 2006 at 09:04 PM | Comments (1)

Part 1 of this series showed how to create a project for the uPortal Quickstart source code. The project template used was "Web Application with Existing Ant Script." This provides a significant advantage: by having the NetBeans IDE use the Quickstart's build.xml you are guaranteed that the code is built the same way both within and outside of the IDE.

There is a slight inconvenience, however, to creating what the NetBeans IDE refers to as a "free-form" project. The inconvenience is that the build.xml from the Quickstart does not contain targets that the IDE needs in order to perform "IDE only" functions. Keep in mind that the NetBeans IDE uses Ant as the basis for its project system. Every time you direct the IDE to do something with a project (clean, build, deploy, run, etc.) what ends up happening is that the IDE runs an Ant target. Since the build.xml from the Quickstart has no reason to include, for example, a target that starts the NetBeans IDE's debugger then you will have to create one. If the IDE had created the build.xml file then that target (and several others) would be included.

Fortunately, creating the debugger target is easy because the IDE will do it for you. The steps are:

1. Create .war and .jar Files

  1. Right-click the build.xml file and choose Run Target > Deploy. This will create the .war and .jar files, which the debugger will need later.
  2. Right-click the uPortal entry in the Projects window and choose Properties.
  3. Click the Output entry in the Category column on the left.
  4. Click the Add Jar/Folder button and then select the uPortal.jar and uPortal.war files that are in the dist folder.

2. Start Tomcat in Debug Mode

In the Runtime window, expand the Servers entry and then right-click the entry for Tomcat. If Tomcat is already running, choose Stop. Right-click the entry for Tomcat and choose Start in Debug Mode .

3. Configure the Debugger Properties

  1. Verify that uPortal is the IDE's Main Project. Right-click the uPortal entry in the Projects window and choose Set Main Project.
  2. From the main menu, choose Run > Debug Main Project. The IDE will display this dialog:

    generateDebug.png

  3. Click the Generate button.
  4. The IDE will open the debug.properties file. By default it directs the IDE's debugger to use a socket to communicate with Tomcat. By default Tomcat is configured to use shared memory when running on Windows. So if you are running on Windows comment out the socket settings and un-comment the shared memory settings so that it looks like:

    sharedMem.png

  5. Change the client.url property to be client.url=http://localhost:8080/uPortal
  6. Save the debug.properties file.

4. Start the Debugger

Once again, choose Run > Debug Main Project. The uPortal logon page should be displayed in a browser.

5. Start Debugging

Set some breakpoints, watch the code run, in other words all the usual stuff. There is helpful information on the debugger in the online guide to using the NetBeans IDE . For example, setting a breakpoint on line 227 of CSnoop.java and then logging into uPortal as demo/demo resulted in the breakpoint being hit (click for full size):

debugSmall.png

When finished, select Run > Finish Debugger Session. Also, note that for web applications like uPortal, the HTTP Monitor is an additional debug tool provided by the NetBeans IDE. For more information on it, refer to the IDE's Help file.

Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • The fourth wow power leveling latest game in wow power leveling Warcraft series is ‘wow power leveling’. Also known as wow power leveling, it represents a wow power leveling multiplayer online wow power leveling game, the best of wow power leveling kind. Initially, it was wow gold it be released in 2001, but wow powerleveling was delayed wow powerleveling 2004, thus wow powerleveling the 10 years ofwow powerleveling franchise of thiswow gold series. The world of warcraft power leveling was not world of warcraft power levelingfulfilling, because wow power levelproblems with wow power level server’s stability power leveling wow performance occurred, but power leveling wow game still power leveling wow a financial success powerleveling wow the most powerleveling wow game of its kind. The number cheap wow power leveling users that play Maple Story mesos, exceeds 8.5 MapleStory mesos, worldwide.As a form ms mesos,recognition for mesos,outstanding popularity, the game SilkRoad Gold, received aSRO Gold, of awards. Now the question eq2 plat, why is eq2 gold, game eq2 Platinum, popular? For anyoneEverQuest 2 Platinum, played the previous EverQuest 2 gold, and EverQuest 2 plat, already initiated lotro gold, the mysterious world lotr gold, the breathtaking Lord of the Rings online Gold, this Rolex Replica nothing but an Replica Rolex adventure that continues the story of ‘Warcraft III: Frozen Throne’, four years after conclusion, in the world of Azeroth. The game is online role-playing, the previous versions being online and offline strategy games. The major thrills and unique features are present as in every Blizzard game.

    Posted by: zhulie on May 29, 2008 at 12:49 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds