Saturday, January 7, 2012

eclipse crash while starting tomcat server

While Just starting with eclipse stuck with one of the issue that is server --> Tomcat server is not starting up.

I found the solution here:
1. In Eclipse, Open the "Server" tab.
2. Double click on the "Tomcat6" entry to see the configuration.
3. Then click on the "Open launch configuration" link in the "General information" block.
4. In the dialog, select the "Classpath" tab.
5. Click the "Add external jar" button.
6. Select the file "/usr/share/tomcat6/bin/tomcat-juli.jar"
7. Close the dialog.
8. Start tomcat 6 from Eclipse.
Hopefully posting it here will help some poor soul.

Saturday, May 1, 2010

VIM commands


I wont to right some thing about VIM, VI Editor

There are so many editors but vi editor is the most used editor in linux.

Below is the link for all simple copy, paste open kind of commands for vi editors

That's OK,

But some times question arise,

If I want to copy some line something from one file and paste it into another file then?

Cause if I close one file and open another it will flush the buffer generated for first file.

There is one more command in editor to do this.

:1,50w >> ../../fileName.txt

This will copy lines 1 to 50 from current file and paste it to the file located in given place.

for copying single line and paste (append) it to another file use

:25w >> ../../fileName.txt


Hi friends,

If you find Mysqldump on google you will find lots of website to create dump file, backup file from existing one or more databases of mysql and restore it.

Best link is,

I want to just write a little bit thing that I searched lot.

That when we generate dump - sql - backup file from mysql, uses command

shell>> mysqldump -u uname -p dbname > dbfile.sql

That will back complete database to dbfile.sql

When on reverse, if I tried to restore that database from dbfile.sql

on Windows it works using same mysqldump

c://MySql//bin> mysqldump dbname < dbfile.sql

Just difference of < and >

while the same thing in linux not works
It will purform and shows output as below

-- MySQL dump 10.11
-- Host: localhost Database: royaleducation
-- ------------------------------------------------------
-- Server version 5.0.51a-3ubuntu5.5

/*!40101 SET NAMES utf8 */;
/*!40103 SET TIME_ZONE='+00:00' */;


-- Dump completed on 2010-05-01 13:02:48

It says Dump completed but when we goto that perticular database and show tables
It will give 0 tables there in database.
for linux we have to use mysql command

shell>> mysql -u root -p dbname < dffile.sql

That will works well.

but for that required to create database first in mysql.

Monday, September 8, 2008

JSP page back and forward on Same Page

Hi, Friends

Today I have been faced problem for forwarding from JSP page to servlet and from servlet to the Page (Jsp) from which it is called.

I think you are not understanding...

Let's understand by one example...

Let say, I have three consecutive lists one is for country, second is for state and 3rd one is for city..

And I want to get one by one information. One depends on another one. If I select Country = "india" I will get all the state inside India. And the same way Once I select state I will get city information regarding it.

Now that is very easy using AJAX but consider I don't know AJAX (And right I don't know AJAX. Will learn shortly). Now we have 2 options first one is to on change event of first list data I will send request to server. Server get related information from database. send back to the same page. (dispacher(request, response). All Content I will get as ArrayList at jsp. I will loop this arraylist and get back all related content and put it in list. And the same way change on second list data I will send request to database and get back information.

That is main logic behind it...

Another way is Java Script..(I have not even try for that)

In this one there will be structure of java script such that each elements are connected each other.That is fastes rather then previous one. No server side callings need every time. (that's why)

will right code for that in few time..

Thanks to read my blog.

Sunday, September 7, 2008

Sending Mail Through GMail Account Using Java Code

import javax.mail.*;
import javax.mail.internet.*;
import java.util.*;

public class Main {
String d_email = "", 
                  d_password = "your_password",
                  d_host = "", 
                  d_port = "465", 
                  m_to = "email_to@any.any",
                  m_subject = "Testing", 
                  m_text = 
                     Hey, this is the testing email.
                   <a href=""> 
                     Check this Link for development solution 

public Main() {
  Properties props = new Properties();
  props.put("mail.smtp.user", d_email);
  props.put("", d_host);
  props.put("mail.smtp.port", d_port);
  props.put("mail.smtp.starttls.enable", "true");
  props.put("mail.smtp.auth", "true");
  props.put("mail.smtp.debug", "true");
  props.put("mail.smtp.socketFactory.port", d_port);
  props.put("mail.smtp.socketFactory.fallback", "false");

  SecurityManager security = System.getSecurityManager();

  try {
      Authenticator auth = new SMTPAuthenticator();
      Session session = Session.getInstance(props, auth);
      // session.setDebug(true);

      MimeMessage msg = new MimeMessage(session);
      msg.setContent(m_text, "text/html");

      msg.setFrom(new InternetAddress(d_email));
              new InternetAddress(m_to));
      System.out.println("Message send successfully");
  } catch (Exception mex) {

public static void main(String[] args) {
  Main blah = new Main();

private class SMTPAuthenticator extends javax.mail.Authenticator {
  public PasswordAuthentication getPasswordAuthentication() {
      return new PasswordAuthentication(d_email, d_password);

  • You can also send multiple message by chenging few
    things from this code.

  • You need to download some jar files also for this one.

  • mail.jar

  • activation.jar

  • search for that and download it.

download your code from here

The day of beginning

Hi, Friends,

The word written here friends is not just a simple word. Strength of this word is very high. I want to make new friends who are in the field of software. I am software engineer from India and currently working as software developer. So it's final I am gone through so many problems. I decided to make one blog that will help all my developer friends to solve problems that I face. As well as I can put up my problems also that they can come to know and answer me. Any one can mail me also regarding their development problem I will try my best to give them answer.