Friday, April 30, 2010

How to configure eclipse and tomcat to run remote debugging:

Check this link: http://wiki.apache.org/tomcat/FAQ/Developing and this link
http://it.newinstance.it/2005/10/04/remote-debugging-tomcat-with-eclipse/

http://confluence.sakaiproject.org/display/BOOT/Setting+Up+Tomcat+For+Remote+Debugging


1)open catalina.bat and add the following lines :
set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=7945
Now stop tomcat from the services window if you have it installed as a service. Then run the following from a console:

[path to tomcat]\bin>catalina jpda start

In eclipse press Run->Debug Configurations..->Remote Java Application->press new button(on top)->
select the project : moodle-transfer -> enter as port : 7945 -> press Debug.
Now run the application in a browser after you have set a breakpoint in the source code,
then eclipse should propose you to turn to debug perspective, choose yes, then you should begin the debugging.
Note: if you get the following error: failed to connect to remote vm. connection refused. connection refused connect eclipse
then change the port number because it may be used by another application.

Monday, April 26, 2010

How to post XML code on blogspot

if you want to add XML code on a post in blogspot, then you have to follow this trick (unless the xml code will be hided) actually i have found two methods which achieves the same target:

  1. download notepad++, which can be downloaded from the following link:
    (remember to download the latest version because it contains a plugin manager.
    install notepad++, then go to Plugins-> Plugin Manager-> Show Plugin Manager.
    in tab Available choose XML Tools, check it out then press install. you will have to restart Notepad++ (i'm not sure)
    Now the most important part: paste the xml code in notepad++, select the xml code then go to Plugins->XML Tools->Convert selection XML to text(<> => <>)
    Now copy the converted XML text to a post in blogspot and it should work.

  2. Another method is to use this publicly available tool on the web:http://centricle.com/tools/html-entities/
    paste your code in the text box then press encode, and voila the xml code is converted to html entity, all you have to do is copy the encoded text and paste it in Compose in blogspot.

Friday, April 23, 2010

How to install tomcat as a service in windows 7 or windows vista

When installing tomcat 6 as a service in windows 7 or windows vista using the method we use in windows xp it fails, So what to do? The answer is:  
  • Press Windows+(Pause/Break), then press Advanced system settings, press Environment Variables, add a user variable with name : CATALINA_HOME, with value path to tomcat\tomcat6. Press Ok three times
  • Go to the desktop, right click, then New->shortcut, in Type the location of the item enter: path to tomcat\tomcat6\service.bat, click next then enter a name for the shortcut, press finish. In the desktop right click the shortcut then choose Properties, in the target add to it: install [name you want for tomcat], press Ok, then right click on it, and choose Run as administrator. 
  • go to services and tomcat will be added to the list, you can then set it to run automatically, and stop it or restart the service.