How to run JBoss Application Server as a Windows Service?

December 31st, 2012 No comments

Recently I was helping a client to install an application on JBoss 4.2.2 server and the client wanted the start and stop operation to be setup as a windows service. The answer was not straight forward and I thought of documenting all the steps I followed.

1) Download JBoss Web Native Connectors (Windows binary)
http://www.jboss.org/jbossweb/downloads


2) Unzip the Native Connector download, and copy jbosssvc.exe and service.bat to JBOSS_HOME/bin folder.


3) Edit FOUR parts of service.bat. Only 3.a is required. Other steps are optional.
3.a
Default service configuration is for JBoss 5.0 (JBAS50SVC). Change this to appropriate version of your server. In my case the server version was 4.2.2 and I have the following overrides.

 
set SVCNAME=JBAS422SVC
set SVCDISP=JBoss Application Server 4.2.2.
set SVCDESC=JBoss Application Server 4.2.2 GA/Platform: Windows x86

3.b
Override start command. In my case, I was starting a specific server with appropriate JDK and allocating enough memory before calling the run.bat program.

 
#call run.bat < .r.lock >> run.log 2>&1
#### CUSTOM START SETTING #####
set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_22
set JAVA_OPTS=-Xms256m -Xmx512m -XX:MaxPermSize=1024m
call run.bat -c MyDefaultServer -b 0.0.0.0 < .r.lock >> run.log 2>&1
#########

3.c
Override shutdown command

 
#call shutdown -S < .s.lock >> shutdown.log 2>&1
#### CUSTOM SHUTDOWN SETTING #####
call shutdown -s jnp://localhost:11099 -S < .s.lock >> shutdown.log 2>&1
#########

3.b
Override restart

 
#call run.bat < .r.lock >> run.log 2>&1
#### CUSTOM START SETTING #####
set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_22
set JAVA_OPTS=-Xms256m -Xmx512m -XX:MaxPermSize=1024m
call run.bat -c MyDefaultServer -b 0.0.0.0 < .r.lock >> run.log 2>&1
#########





4) Now just go to JBOSS_HOME/bin folder and install service.bat. More instructions are included in README-service.txt which came with JBoss Web Native Connectors download.

C:\> service.bat install


5) Now if you access windows services you should see JBoss Application Server listed as a service. Default start type will be ‘Manual’. Change this to ‘Automatic’ if you want the JBoss server to be started with the machine.
JBoss_Service_Setting


Note that you can also use a wrapper service to achieve the same and I did not explore that path. Newer versions of JBoss might have this option built in and native connectors may not be required. I tested this only with Jboss versions 4.2.2 and 4.2.3.




Check the link below for more documentation
http://something-about-tech.blogspot.com/2009/01/running-jboss-as-windows-service.html

Share
Categories: Tech Tips Tags:

Upload Multiple Videos to Youtube – Free & Easy

January 12th, 2011 No comments

If you search for an option to upload multiple videos to youtube.com in a batch, you will find more suggestions than you ever want to see. You will also find both free and paid tools or software that claim to upload multiple videos to youtube.com.

Believe it or not, the easiest way to upload multiple videos at a time is to use the default interface provided by youtube.com.

Youtube-file-upload-screen

Here you could drag and drop multiple videos to the screen or you could click on the button “upload video” and select multiple videos in the popup window. In order to select multiple videos while using Windows, you should select the first video, then keep the “ctrl” key pressed and select additional files.

youtube-select-multiple-videos-to-upload

If you know an easier way to batch upload videos to youtube.com, please feel free to add a comment.

Share
Categories: Tech Tips Tags:

How to Add or Insert Pictures in Outlook Web Access?

January 12th, 2011 14 comments

My employer started rolling out Outlook Web Access to all employees and it was a much welcomed change from the old and aging Lotus Notes email system. All went well, except for the missing functionality of inserting a picture or screen print in an email. I believe in the saying that “a picture is worth more than a thousand words” and I tend to use screenshots and snagit on a regular basis.

I kept using the Outlook client anytime I want to copy and paste a picture, until a friend showed me how to enable Multipurpose Internet Mail Extensions (MIME) in Outlook Web Mail. Listed below are the steps I followed in Outlook Web Access to enable copy and paste. (version 2003 and above)

1) Access Outlook Web Access Email and click on “options” (top-right corner)
2) Click on Email Security. If you a see a screen like the one below, that means you are missing the MIME control that will enable you to insert pictures.

Outlook web access email security page showing MIME control not installed

Outlook web access email security page showing MIME control not installed


3) Click “Download the Outlook Web Access S/MIME control” and install the client.
4) After installing the MIME control, check the Email Security page to ensure that the components were installed correctly.
Outlook web access email security page showing MIME control installed

Outlook web access email security page showing MIME control installed

Now start writing a new email and “copy paste pictures” at will….

Outlook web access new email with picture inserted

Outlook web access new email with picture inserted

If you know a better way to enable copy and paste option for Outlook Web Access, feel free to make an entry in the comments.


Share
Categories: Tech Tips Tags:

Enable boxing errors in Eclipse

September 16th, 2010 No comments

Java 1.5 (5.0) and above support autoboxing conversions for primitives and wrapper objects. This will unclutter the code and give more flexibility to programmers, however this can have a negative impact on performance and can cause some unexpected behaviors. (Use boxing with care).

Eclipse by default will throw a warning if there are boxing and unboxing conversions in the code. If you want eclipse to throw an error during these conversions, follow the steps below –

Eclipse –> Window –> Preferences –> Java –> Compiler –> Errors/Warnings

scrn_enable_eclipse_autoboxing_error

If you want to learn more autoboxing in Java click here


Share
Categories: Tech Tips Tags: ,

How to find ports that are used in a windows machine?

September 10th, 2010 No comments

From time to time you might need to find all the ports that are used by other applications in your machine. Recently, I was installing a web server and I saw that the default port was already taken by some other application. There are many tools in market that will allow you to monitor and scan ports, but if you are simply looking to find available ports in a windows desktop or laptop you can can take advantage of the “netstat” tool provided with the windows OS.

Open command prompt and type
netstat -an
This will display all connections and listening ports in numerical form. If you have many ports open this will be a rather long list.



If you looking for a specific port, you can search inside the results provided by netstat. In the example below I am looking for all ports starting with port 80.
netstat -an | find “80″
scrn_netstat_findport_techthinking



If you want to be a little more specific, you can search search inside the results provided by the previous command. In the example below I am looking for all ports starting with port 80 and in listening status.
netstat -an |find /i “listening” | find “80″
scrn_netstat_findport_listening_techthinking

Share
Categories: Tech Tips Tags: ,

How to get Gmail Groups in iPhone Contacts?

August 25th, 2010 1 comment



I am glad that I can access gmail in my iPhone, however I miss the group contacts that I have in my gmail account. Groups are a big help when I email pictures to my family and friends, and I do not want to run the risk of missing anyone while sending pictures.

I saw many solutions online. Link below is the one that worked. This is not an ideal solution, but better than nothing.


http://red66.com/2009/07/how-to-send-group-emails-from-your-iphone/

I hope soon there will be a better solution from apple.

Share
Categories: Tech Tips Tags: ,

Download JDK 1.5 (direct link)

August 25th, 2010 1 comment


Here is a direct link to download Java 1.5.0.22 or Java 5.0 update 22. Going directly to this link will save time registering at oracle.com and waiting for an email with download link.


http://java.sun.com/javase/downloads/5u22/jdk

Alternate option is to download from CNET.

Share
Categories: Tech Tips Tags:

How to add websites to Google Custom Search Engine?

April 30th, 2010 No comments

Have you ever wondered how to add sites to Google custom search engine or CSE. Answer is to use Google Marker… a javascript which you can add to your browser tool bar or favorites.

Using the Google Marker (from the Marker documentation)
The Google Marker allows you to add and label sites in your Custom Search Engine. Please note that you must already have created or signed up to collaborate on a Custom Search Engine to use the Google Marker with a Custom Search Engine.

Once you are ready, simply add the Google Marker link below to your browser toolbar.

  • Firefox users: Drag the marker into the Bookmarks Toolbar.
  • Chrome users: Drag the marker into the Bookmarks Toolbar.
  • Internet Explorer users: Right-click on the marker, then select “Add to Favorites” > “Links.”


  • http://www.google.com/coop/cse/marker

    Share

    How to Sort Two Dimensional Data based on Multiple Parameters?

    April 26th, 2010 2 comments

    This is a follow up to my previous post How to Sort a Two Dimensional String Array using JAVA

    Here I am trying to sort an address table by Street Name, Street Number and City using java comparator. First I sort the table by Street Name (column A), then keeping street name as constant sort by Street Number (column B) and finally keeping street name and number as constant sort by City (column C)

    If you want to sort my more columns, you can easily add the rules to ORDER_BY_RULES – shown below.

    Address Table:

    Street Name Street Number City State Zip Code
    univ dr 101 Sunshine FL 33324
    break rd 102 Sunrise FL 33224
    univ dr 103 Cleveland OH 24785
    dykes rd 104 San Antonio TX 24785
    dykes rd 104 Boston MA 24785
    dykes rd 104 Orlando FL 24783
    import java.util.Arrays;
    import java.util.Comparator;
    
    public class Sort {
    
    static final Comparator<Address> ORDER_BY_STREETNAME = new Comparator<Address>() {
    	public int compare(Address a1, Address a2) {
    		return a1.streetName.compareTo(a2.streetName);
    	}
    };
    static final Comparator<Address> ORDER_BY_STREETNUMBER = new Comparator<Address>() {
    	public int compare(Address a1, Address a2) {
    		return a1.streetNumber.compareTo(a2.streetNumber);
    	}
    };
    static final Comparator<Address> ORDER_BY_CITY = new Comparator<Address>() {
    	public int compare(Address a1, Address a2) {
    		return a1.city.compareTo(a2.city);
    	}
    };
    
    static final Comparator<Address> ORDER_BY_RULES = new Comparator<Address>() {
    	public int compare(Address a1, Address a2) {
    		int i = ORDER_BY_STREETNAME.compare(a1,a2);
    		if(i == 0){
    			i = ORDER_BY_STREETNUMBER.compare(a1,a2);
    			if(i == 0){
    				i = ORDER_BY_CITY.compare(a1,a2);
    			}
    		}
    		return i;
    	}
    };
    
    public static void main(String args[]){
    	//Array with address to sort
    	Address[] addressArray = new Address[]{
    		new Address("univ dr","101", "Sunshine", "FL", "33324"),
    		new Address("break rd","102", "Sunrise", "FL", "33224"),
    		new Address("univ dr","103", "Cleveland", "OH", "24785"),
    		new Address("dykes rd","104", "San Antonio", "TX", "24785"),
    		new Address("dykes rd","104", "Boston", "MA", "24785"),
    		new Address("dykes rd","104", "Orlando", "FL", "24783"),
    	};
    	Arrays.sort(addressArray, ORDER_BY_RULES);
    	//Print the sorted array
    	for(int i=0; i<addressArray.length; i++){
    		System.out.println(addressArray[i].toString());
    	}
    	System.out.println();
    }
    }
    
    //Address Class
    class Address {
    	String streetName;
    	String streetNumber;
    	String city;
    	String state;
    	String zipCode;
    	@Override
    	public String toString() {
    		return "Address [" + streetName + " | " + streetNumber + " | " +
    			city + " | " + state + " | " + zipCode + "]";
    	}
    	public Address(String streetName, String streetNumber,
    				String city, String state, String zipCode) {
    		super();
    		this.streetName = streetName;
    		this.streetNumber = streetNumber;
    		this.city = city;
    		this.state = state;
    		this.zipCode = zipCode;
    	}
    }

    Results – sorted by street name, street number and city

    Address [break rd | 102 | Sunrise | FL | 33224]
    Address [dykes rd | 104 | Boston | MA | 24785]
    Address [dykes rd | 104 | Orlando | FL | 24783]
    Address [dykes rd | 104 | San Antonio | TX | 24785
    Address [univ dr | 101 | Sunshine | FL | 33324]
    Address [univ dr | 103 | Cleveland | OH | 24785]
    Share
    Categories: Tech Tips Tags:

    Compare financials of Two or More Stocks

    March 16th, 2010 No comments

    If you are looking to compare technical information or key metrics like Market Value, Revenue, Net Earnings, P/E, Profit Margin, Dividend etc of two or more stocks, then check the sites listed below. All the popular sites like finance.yahoo.com, finance.google.com and others will allow you to compare stock charts, but not the detailed financial information.

    Smarty Money – Stock Compare
    SmartMoney will allow you to compare and analyze any number stocks at a time. They also have an applet version of the analyzer will only allow you to compare three stocks. Included below is a screen print of the smartmoney website.

    SmartMoney_CompareStocks

    Nasdaq – Stock Comparison
    Nasdaq will allow you to compare up to a maximum of five stocks. The will even allow you to compare stocks that are not traded in their exchange.
    Included below is a screen print of the Nasdaq stock comparison website.
    Nasdaq_CompareStocks


    If you know any better websites for comparing technical information of stocks, feel free to comment.

    Share
    Categories: Cool Sites Tags: