Friday, January 23, 2009

Remote Debugging - SunOne+Eclipse


In server.xml ( for my installation it is at /opt/jsws70/https-<user>/config/server.xml )

1. Set debug option under jvm to true.
<debug>true</debug>

2. Set the port on which debugging to be enabled
<debug-jvm-options>-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<desired port></debug-jvm-options>

3. Now for Eclipse configuration, go to debug configuration. Use server name or IP and in the port option, put the same port that you have set in server.xml <desired-port>

4. If you need more detail, please follow steps in Remote Debugging - Tomcat+Eclipse

Friday, January 16, 2009

Remote Debugging - Tomcat + Eclipse

I am assuming that you have setup Tomcat by exploding its zip distribution. Windows installer distribution of Tomcat doesn't contain all config and script files including catalina.bat or catalina.sh . I used
- Tomcat 6.0.18
- Eclipse 3.4

- Windows XP


Tomcat Configuration
  1. Go to CATALINA_HOME\bin and edit catalina.bat in any editor, say Notepad++ . Here CATALINA_HOME is your tomcat installation directory. For me it is C:\Tomcat6.0 .
  2. Find JPDA_TRANSPORT and set it as JPDA_TRANSPORT=dt_socket .
  3. Find JPDA_ADDRESS and set it as JPDA_ADDRESS=8000 (you can use any unused port).
  4. Check if port specified is not being already being used; by executing "netstat" at command prompt. Check list of local ports.
  5. Save your changes.
  6. Start your server in debug mode by hitting "catalina jpda start". You may like to add CATALINA_HOME\bin in you PATH environment variable.
Eclipse Configuration
  1. Click on green beetle -> debug configurations...
  2. At Remote Java Application, click new and configure the settings.
  3. Give a name to this debug configuration (homebase-tomcat for me).
  4. Type localhost at Host or any name you have given to you localhost, mapped to 127.0.0.1 in hosts file (localhost.mlbam.com for me).
  5. Type 8000 as the port. Please note that the port must be the same with the JPDA_ADDRESS in catalina.bat file.
  6. Browse the project that you would like to debug.
  7. Click on debug button.

Debugging
  1. Go to your code and put breakpoints by double clicking on the left panel, wherever you want to debug.
  2. Hit your server by opening pages, where you want to debug, in browser.
  3. You will see eclipse switches to debug perspective and debug control flow stops at first breakpoint on the way.
  4. Use following eclipse shortcuts to proceed debugging
  • F5 - Step into (you may like to go inside any method on the way)
  • F6 - Step over (line by line)
  • F7 - Step return (coming out back after going down into a call hierarchy)
  • F8 - Resume debugging (breakpoint to breakpoint)
  1. Use terminate and disconnect buttons to stop debugging
You all set to play with debugging!!

Monday, January 12, 2009

Joomla Vs Drupal

Here I'll try to compare two hottest PHP based content management system Joomla and Drupal, based on some prevailing factors, and my experience while working/evaluating Joomla and Drupal.

Joomla

Excels at:
  1. Eye candy themes and templates
  2. Great at functionalities
  3. Shopping Cart - Virtumart and OSCommerce
  4. Huge library of free/commercial extensions
  5. Events & Calendar - good support
  6. Document Management - Promising DocMan extension
  7. Excelent web admin interface
Under performs at:
  1. Architecture is poor
  2. No Multi-site management support (Separate installation for each site)
  3. Poor in standard's compliance
  4. SEO - You may hit your head against wall to make it working
Drupal

Excels at:

  1. Multi-Site Management
  2. Standard's Compliance
  3. Architecture - Very good
  4. SEO - Supports well (Search engine friendly pages)
  5. Better Documentation
  6. Internationalization (using i18n module)
  7. SSL Compatible
Under performs at:
  1. Themes and Templates - are very simple not eye candy
  2. Shopping Cart - addon is not as good (seems good option Ubercart )
  3. Event & Calendars - not great
  4. Document Management - nothing like DocMan in Joomla
Conclusion

Joomla as a CMS appears to excel in elements that can be identified as functional, while Drupal succeeds in the architectural elements. Which element is more important in a CMS, architecture or function? According to Deane Barker he believes it is more important for a CMS to have better architecture.

As a developer with the capability to write code, I find myself much more concerned with architectural matters. Functionality can be programmed, but I’m at the mercy of architecture. Put another way, give me the right tools and materials, and I can build anything. But give me nothing but a pile of sand and a toothbrush, and I’m pretty much screwed.

In other words, if you agree with Barker that architecture is more important than function you're likely going to want to choose Drupal. However, if you need to make a quick sell where function, third party integration, and eye candy is important right out the box... Joomla still has the advantage.

Learnig Curve - Joomla has relatively shallow learning curve. It is one of the very easiest CMS systems to learn and customize but you may find some mess at coding level. Drupal has a little steeper than Joomla, but still relatively easy to learn.

Reference:

http://www.alledia.com/blog/general-cms-issues/joomla-and-drupal-%11-which-one-is-right-for-you
http://cmsreport.com/node/543
http://kb.siteground.com/article/CMS_application_comparison_Joomla_vs_Drupal.html