Friday, December 31, 2010

Tomcat remote debug

Windows:
under tomcatHome/bin create a file called startup-debug.bat or startup.bat and add below:

set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
catalina.bat jpda start

UNIX: 
export JPDA_ADDRESS=8000
export JPDA_TRANSPORT=dt_socket
catalina.sh jpda start

Run the bat/sh file you just modified. Connect at port 8000 for debug..


To configure remote debugging when windows as setup as a service you edit your tomcat configuration and add these startup parameters:

C:\tomcat\bin> tomcat5w //ES//Tomcat5

-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n




Friday, December 10, 2010

Online java IDE

Its a shame we don't have  a proper online java editor to build full scale web applications in java.

Most of them found only allow you to compile a small code snippet or dont allow you to execute java code for security reasons.

Cant imagine the amount of progress we can make if we have a full fledged online java editor. eg: Imagine we are able to do online development of existing java projects on sourceforge site. Imagine how much code you can produce if development is as simple as opening up a browser and keying in your ideas.. Imagine how many projects u can get involved in simultaneously.


JDK6 has the new in memory as well as runtime compiler API: search JavaCompiler. Not many have taken advantage of it i believe.

Some online ide like options:
compilr - can only compile, not run
ECCO: - looks like an interesting project on SF but abandoned 3 yrs back
ideOnea simple code  compile and run project



Wednesday, December 8, 2010

iBatis - simplify persistence

iBatis is in between hibernate and jdbc. A somewhat ORM. It is more about simplicity.

What is iBatis ?

  • A JDBC Framework
    • Developers write SQL, iBATIS executes it using JDBC.
    • No more try/catch/finally/try/catch.
  • An SQL Mapper
    • Automatically maps object properties to prepared statement parameters.
    • Automatically maps result sets to objects.
    • Support for getting rid of N+1 queries.
  • A Transaction Manager
    • iBATIS will provide transaction management for database operations if no other transaction manager is available.
    • iBATIS will use external transaction management (Spring, EJB CMT, etc.) if available.
  • Great integration with Spring, but can also be used without Spring (the Spring folks were early supporters of iBATIS).

What isn't iBATIS ?

  • An ORM
    • Does not generate SQL
    • Does not have a proprietary query language
    • Does not know about object identity
    • Does not transparently persist objects
    • Does not build an object cache

Useful links:
Spring 3 + ibatis + maven sample in git : link
ibatis tutorial: link