Posts

How to create Spring MVC project using Maven and Eclipse

Image
This blog will show you how quickly you can  create a Spring MVC project and get it up and running, using the Maven archetype called spring-mvc-archetype . Note: First You should verify that the Maven Integration for FTP is already installed in your eclipse, If not first installed and then create a new project. Steps : In Eclipse IDE, Goto  File > New > Project Select  Maven > Maven Project and click  Next . Make sure you don’t check the option Create a simple project (skip archetype selection) , and click Next . In the next screen, Select Catalog as All Catalogs , Archetype as spring-mvc into the Filter   and select  maven-archetype-webapp in the artifact list as shown below :     In case, If you don't see the above artifact in your Archtype then Click on "Add Archetype" and Add : Archetype Group Id: co.ntier Archetype Artifact Id: spring-mvc-archetype Archetype Version: 1.0.2 Repository URL: http:...

How to do JVM Remote debugging via SSH

Image
Last week I was getting one issue which was difficult to debug as the product was on EC2 instance. We were wasting lot of time as It was difficult to test and check the actual cause of issue.  Later I decided to attach the Eclipse debugger to my target JVM which is running on some different(EC2 instance) machine with the help of PuTTy ( PuTTY is an SSH and telnet client). Lets start with the steps : 1. Make sure your target JVM is started with these args:         -agentlib:jdwp=transport=dt_socket,address=8001,server=y,suspend=n 2. Create an SSH session into your PuTTy.       Open Putty, Add :          -- IP Address : "YOUR_TARGET_JVM_ADDRESS"         -- PORT : 22         -- Saved Sessions : your session name         -- Choose 'SSH' radio button and Save it.               3. Aft...

How to enable convert extension into Mercurial ?

Image
Advanced users of Mercurial can be aided with the use of Mercurial extensions. Extensions allow the integration of powerful new features directly into the Mercurial core.    Built-in help on extensions is available with ' hg help extensions '. To get help about an enabled extension, run ' hg help <extension-name> '. Convert Extension The Convert extension converts repositories from other SCMs (or even Mercurial itself) into Mercurial repositories, with options for filtering and renaming. It can also be used to filter Mercurial repositories to get subsets of an existing one. The current release supports the following repository types as sources: CVS Subversion Git Darcs Monotone Bazaar GNU Arch Mercurial Perforce Convert extension comes up together with Mercurial. To enable convert extension, add following lines in your configuration file, Edit your $ HOME/.hgrc which look ...

Basic commands of Mercurial

These commands are very much to the subversion. 1. Creating a repository (hg init)   Create a mercurial repository in an empty directory by using the init command: [root@localhost ~]# mkdir Test [root@localhost ~]# cd Test [root@localhost Test]# hg init [root@localhost Test]# ls -lar total 12 drwxr-xr-x. 3 root root 4096 May 21 06:42 .hg dr-xr-x---. 36 root root 4096 May 21 06:40 .. drwxr-xr-x. 3 root root 4096 May 21 06:42 . Now there is an empty repository created, locally in your directory. The repository contains both a working copy, and the repository data (the history information). 2. Adding a file (hg add) Schedule a file for addition [root@localhost Test]# echo "Testing1" >>test.txt [root@localhost Test]# ls -lar total 16 -rw-r--r--. 1 root root 9 May 21 06:47 test.txt drwxr-xr-x. 3 root root 4096 May 21 06:42 .hg dr-xr-x---. 36 root root 4096 May 21 06:40 .. drwxr-xr-x. 3 root root ...