SDN Featured Content

Do you Think Hibernate is better technology that EJB

Java/J2EE blogs

Welcome to my java /J2EE blogs.


Thursday, October 18, 2012

Apache installation issue with port 80

Sometimes it happens that when you try to install the apache server on your machine then it doesn’t get installed properly so you cannot see the option to view the service to be started or stopped. The reason could be because when you install you get an error stating that port 80 is already been used. So it better to quit or uninstall the corrupt application and run the following command in your system :
netstat -o -n -a | findstr 0.0:80


 If it returns any program then we need to find and close it. So need to go to the window task and kill the program those are been run by that PID’s. Make sure if you cannot view the PID in the Windows Task then you need to view ->select column. Once you kill these application with PID’s then rerun the apache installation. Enjoy

Friday, July 9, 2010

Example extending an existing java.util.Date class to add custom function

I have created a simple example where one can get the last month first day of month by creating a class by extending a simple java class and then creating own function.

 

package com.date.extension;
/**
*
* @author Ajay
* This example shows how we can create the extension of the existing java API classes to
* create our own custom class.
* These days all the new tools those are build using the java API are using these concepts
*
*/
public class DateExtension extends java.util.Date{

    /**
     *
     */
    private static final long serialVersionUID = -6611137942020737569L;
    public DateExtension(){
    }
    @Deprecated
    public java.util.Date getPriorMonth() {
            this.setDate(1);
            this.setMonth(this.getMonth()-1);
            return this;
         }
}