Saturday, May 31, 2014

Why Moving Legacy Applications to cloud is important

Cloud Computing is emerging as a dominant approach changing the IT platforms architecture and verifying the increasing business requirements. In addition to being a Service-Oriented, it is also a business model. Accordingly, Cloud Computing compasses a broad spectrum of business, marketing and technical opportunities and issues.

Since the spectacular Dot-com bubble in 2000, companies from all over the world have continued to develop and implement more scalable e-business strategies. They tried to rethink or refine their business models and what they offered to customers. Many newer companies decided to offer services considering internet as a base part of the service. Cloud computing was the right environment to take off as multi-tenant architectures highly prevalent.

Regardless of the long-debate in the recent years about cloud computing efficiency, several companies and government institutions have switched to it. Indeed, cloud computing came with very huge model composed by many layers which made it very flexible. It can be fully or partially adopted by enterprises. Similar to electricity grid, use sharing resource over a network and Pay as you consume model have offered the best way for enterprises to reduce costs related to the IT infrastructures’ supports and enhancements , as well as, an opportunity to minimize risks.

Both business and technical people admitted that cloud computing is a must. Today, cloud services are used everywhere due to the cloud elasticity which helped cloud vendors to parametrize different packs that verify expectations from all kind of business, major accounts and small companies.  According to analysts, Cloud computing market is expected to grow from $37.8 billion in 2010 to $121.1 billion in 2015 at a CAGR of 26.2 per cent from 2010 to 2015. By 2020, the cloud computing market is forecast to exceed $241 billion, announces Salesforce.com. The researchers posed several cost-related questions about software-as-a-service (SaaS) to companies that had already migrated to the cloud, but the findings are also relevant to the needs of midsize firms that could be served by the cloud. Smaller firms seek the same benefits that enterprise seeks, including cost savings.

The key issue for enterprises was to find the optimized way to migrate their existing platforms and applications to a cloud-based infrastructure. Obviously, many organization tried to follow an incremental approach to cloud migration. Indeed, migrate to cloud is a big project that goes beyond technical tasks to redefine relationship between business and IT and to re-organise procedures and rules

On the other hand, cloud computing came with multiple advantages for software vendors. The cloud patterns are the main issues that help vendors to maintain and monitor their cloud by respecting standards.

The popularity of SaaS is steadily increasing because it simplifies deployment and reduces customer acquisition costs.In addition, developers can take control easily of the support by managing no more than one version of a product. This approach, called multitenancy, allows companies to scale as fast and as much as needed without replacing costly infrastructure or adding IT staff.
Besides, the subscription-based SaaS pricing model can keep IT budget costs consistent or lower than packaged or homegrown software.

Moving existing business applications to cloud is an important thing to follow up the evolution trend and take profit of technical and functional benefits. This migration can be done by rewriting the application to exploit the cloud features or replacing the application with an equivalent  software as a service (SaaS)  or relocating the application to the cloud environment.

Wednesday, January 22, 2014

Parse HTML Table with Jsoup

Hi All,

Let me share with you the java code that helps me to extract data from html table. The code is based on the Jsoup library that you can add it to your project through Maven repository

<dependency>
 <groupId>org.jsoup</groupId>
 <artifactId>jsoup</artifactId>
 <version>1.7.1</version>
  </dependency>





or you add the Jsoup jar into the project build path (JAR available here : http://jsoup.org/download )

package org.tunindex.parser;

import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;

public class MainClass {

 public static void main(String[] args) {
  Document doc = null;
  try {
   doc = Jsoup.connect("http://www.bvmt.com.tn/quotes/resume-data.jsp").get();
   
  } catch (IOException e) {
   
   e.printStackTrace();
  }

     for (Element table : doc.select("table")) {
         for (Element row : table.select("tr")) {
             Elements tds = row.select("td");
             if (tds.size() > 6) {
                 System.out.println(tds.get(0).text() + ":" + tds.get(1).text());
             }
         }
     }

 }

} 
 Hope it helps you

Good night :-)

Monday, January 13, 2014

Server Tomcat v7.0 Server at localhost failed to start



Hi All,

Hope you are doing good.

A weak error, I faced today with eclipse when I was trying to deploy a java web application on Tomcat, occurred during Tomcat Startup. Following the error message shown in Eclipse:
Server Tomcat v7.0 Server at localhost failed to start

To resolve this problem, follow the instructions:

  1. Delete tmp0 folder inside
    <workspace-directory>\.metadata\.plugins\org.eclipse.core.resources
  2. Do the Eclipse Magic Steps: Clean the workspace and restart Eclipse
Let me know if you have more efficient solution

Good Bye :-)





Friday, November 30, 2012

How to redirect incoming TCP connections to other ports (Example : 80 to 8080)


 Hello Everybody,

Today, I will show you how I solved a problem which occurred when I started setting a java web application in a production server.
We all now that Apache Tomcat Server uses the 8080 port by default. So we have to add ":8080" every time to reach the application.

The solution is to replace the 8080 port by 80. There are two ways: 

  1. Configuring Apache Tomcat
  2. Redirect incoming TCP connections from 80 port to the 8080 one.
Below the command to redirect the incoming tcp connections :

iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

I have no idea which is the best way to resolve such problem ( I think the first option is the cleanest). However, this method is the quickest because it saves you some minutes.

Good bye :-)

Friday, November 23, 2012

Check opened ports in Linux with nmap & netstat


Several times, I would know which are the opened ports in my Linux servers (yes I have many Linux servers :p ).

There are two good methods to check what ports are open in Linux :
  1. nmap : a port scanner
  2. netstat

nmap can be used to scan your machine to check opened ports.
Enter the following command to scan your computers machine:

nmap -sS -O 127.0.0.1

Once the scan has finished you will get the following ouput:

Starting nmap 3.70 ( http://www.insecure.org/nmap/ ) at 2005-01-16 05:48 GMT
Interesting ports on localhost.localdomain (127.0.0.1):
(The 1656 ports scanned but not shown below are in state: closed)
PORT     STATE SERVICE22/tcp   open  ssh80/tcp   open  http443/tcp  open  https1241/tcp open  nessusDevice type: general purposeRunning: Linux 2.4.X|2.5.X|2.6.X
OS details: Linux 2.5.25 - 2.6.3 or Gentoo 1.2 Linux 2.4.19 rc1-rc7)
Uptime 1.985 days (since Fri Jan 14 06:10:41 2005)
Nmap run completed -- 1 IP address (1 host up) scanned in 2.341 seconds

The second method consist in using netstat. netstat can show hidden ports and what programs using them. 

Type following command as root:

netstat -nap

It will show you the output of something similar to:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name
tcp        0      0 127.0.0.1:61931             0.0.0.0:*                   LISTEN      5277/wish
tcp        0      0 127.0.0.1:5335              0.0.0.0:*                   LISTEN      3920/mDNSResponder
tcp        0      0 0.0.0.0:1241                0.0.0.0:*                   LISTEN      31438/nessusd: wait
tcp        0      0 10.0.0.14:32776             194.109.129.220:6667        ESTABLISHED 5062/xchat
tcp        0      0 10.0.0.14:45731             207.46.107.146:1863         ESTABLISHED 5277/wish
tcp        0      0 10.0.0.14:33009             82.96.64.2:6667             ESTABLISHED 5062/xchat
tcp        0      0 :::80                       :::*                        LISTEN      4355/httpd
tcp        0      0 :::22                       :::*                        LISTEN      32372/sshd
tcp        0      0 :::443                      :::*                        LISTEN      4355/httpd
udp        0      0 0.0.0.0:68              0.0.0.0:*                           3614/dhclient
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           3920/mDNSResponder

A quick post certainly, but I hope it would be useful for you.

PS: for more details try google :p

Good Bye ;-)

Tuesday, January 17, 2012

Error Booting CentOs in VirtualBox - FATAL: INT18: BOOT FAILURE

Tonight, I tried to install CentOs in VirtualBox VM. I didn't find any problem with installation until the first reboot on which the system told me:

FATAL: INT18: BOOT FAILURE


If this happens to you, be sure to check if the installation media (the cd-rom or the dvd-rom) is still present in the CD/DVD player device. You have to remove it.
It appears to be a known issue with VirtualBox, since a bug #2680 opened 4 years ago and still unresolved.



Finally, have nice time with the GREAT CentOS 6

Good Bye :-) 

NB: this solution can be applied for the CentOs' brothers , Fedora, Redhat, Enterprise Linux, ... ;)

EDIT: An additional solution 

Hans de Raad

3 weeks ago  -  Shared publicly
 
You could also press F12 on booting and select booting directly from the virtual harddrive. Also works.

Friday, January 6, 2012

How To Install Tomcat 6 and AXIS2 on linux Mint in 3 steps

Today, I will share with you a good experience with linux Mint. Last Night, I tried to prepare Tomcat and Axis2 to create and test web services.
The implementation was easy and it only took some minutes.

Follow  the 3 steps below to install Tomcat 6 and Axis2 on linux Mint:
  1. Installation of Tomcat6 packages:
    With Linux Mint, you will find  
    java version 1.6.* installed. You have only to install tomcat6 packages with this command 

    sudo apt-get install tomcat6 tomcat6-admin tomcat6-docs tomcat6-examples

    Now, you can try accessing localhost:8080/ in your browser

  2. Tomcat's Configuration
    Tomcat6 default install hasn’t the admin user parameters in config file, you’ll have to edit tomcat-users.xml file


    sudo gedit /etc/tomcat6/tomcat-users.xml  

    you’ll have to add next lines:



    <?xml version='1.0' encoding='utf-8'?>

       <tomcat-users>
          <role rolename="manager"/>
          <role rolename="tomcat"/>
          <role rolename="admin"/>
          <user username="admin" password="password" roles="manager,tomcat,admin"/>
       </tomcat-users>


    Don't forget to change 
     “password” with your own  :-).Finally, you will need to restart tomcat6 with this command
     
    sudo service tomcat6 restart
     
  3. AXIS2 Deployment
    In this step, we will try to deploy axis2 on our installed tomcat6. First, download  the WAR archive from this link: 
    http://axis.apache.org/axis2/java/core/download.cgi
    Open Tomcat Web Application Manager with this URL: http://localhost:8080/manager/html and deploy the WAR archive on tomcat from the "WAR file to deploy" menu.If all works fine, you can access it through this link : http://localhost:8080/axis2/


Good Bye :-)

NB: May be you will have some permissions and access problems, try this  : 
sudo chmod -R 777  /var/lib/tomcat6/webapps/axis2/WEB-INF/