If data is characterized as recorded facts, then information is the set of patterns, or expectations, that underlie the data. You could go on to define knowledge as the accumulation of your set of expectations and wisdom as the value attached to knowledge.
2/18/13
2/5/13
Building a Simple Web Service ? A Tutorial
Building
a Simple Web Service ? A Tutorial
|
|
By Jeevaraj Gnanaselvan Dhanaraj (jeevaraj_1970@yahoo.com)
(Jeeva has over 7 years of experience
in designing and developing enterprise class web applications using JAVA and
J2EE technologies.
He currently works for Itreya Technologies,
Bangalore, leading a team of over 10 programmers and designers, developing a
multi-user, distributed, web-based workflow application)
·
Introduction
In
this tutorial we will create a simple web service and a client web application
using eclipse IDE along with Lomboz
plug
in. We
will also deploy and test the web service on Tomcat 5.5.4 web application
server. This application, while simple, provides a good introduction to Web
service development and some of the Web development tools available.
·
Environment
J2SDK
1.4.2
http://java.sun.com/
http://java.sun.com/
Eclipse
3.1
Tomcat
5.5.4
Lomboz
3.1RC2
http://lomboz.objectweb.org/
http://lomboz.objectweb.org/
·
Installation
Install
JDK (in D:\j2sdk1.4.2_04)
Install
Tomcat (in E:\Tomcat5.5)
Install
Eclipse (in E:\Eclipse3.1)
Install
Lomboz (in E:\Eclipse3.1)
·
Setting up
- Set up the installed JRE in eclipse (Windows -> Preferences -> Java -> Installed JREs)
- Set up the installed runtime for server in eclipse (Windows -> Preferences -> Server -> Installed Runtimes)
- Set up the Server view in eclipse (Windows -> Show View -> Other)
- Set up the Tomcat Server by right clicking and selecting New -> Server option from the Server view in eclipse
·
Creating a Web service
- Create a new Dynamic Web Project in eclipse (File -> New -> Other)
- Enter name as ?WebServiceTutorial?, select project location as ?E:\Test? and select Apache Tomcat v5.5 as the Target server.
- Now create a new Java class from the Project Explorer (Dynamic Web Projects -> Java Source -> New -> Class)
- Enter name as ?Hello? and package as ?com.tutorial?.
- Add a simple method in the ?Hello? class as below.
public String sayHello(String name){
return "Hello " + name;
}
- Save and build the project.
- Create a new Web service in eclipse (File -> New -> Other)
- Select Generate a proxy.
- Select Test the Web service.
- Select Overwrite files without warning.
- Select or enter the Bean name as ?com.tutorial.Hello?. This is the java class that we just now created.
- Continue the wizard by clicking Next and finish.
- On Finish, the Tomcat server starts up and launches the Test client.
- Verify the generated contents. Look for Hello.class and the generated JSPs as below.
- Verify the Tomcat folder and ensure the newly created web applications ? WebServiceTutorial, WebServiceTutorialClient.
- We can also run the following url from the browser to access/test the Web service.
- If servlet error ?org.eclipse.jst.ws.util.JspUtils cannot be resolved or is not a type? is thrown on the browser, then copy the webserviceutils.jar file from the E:\Eclipse3.1\eclipse\plugins\org.eclipse.jst.ws.consumption_0.7.0 into the WEB-INF\lib folder of the WebServiceTutorialClient application and restart the Tomcat server.
- The browser displays the methods available in the web service.
- Click on the sayHello(..) method, enter your name (for e.g. ?Jeeva?) in the inputs section and click ?Invoke?.
- The browser greets using the web service.
- The WSDL for the Hello Web service can be found in E:\Test\WebServiceTutorial\WebContent\wsdl\Hello.wsdl. On double-click, the WSDL opens in a graphical editor.
- Right-click on the WSDL file and explore the options to test the web service / publish the WSDL file / generate client / etc.
·
Conclusion
In this
tutorial we learned how to create a simple web service and a client web
application using eclipse IDE along with Lomboz
plug
in. We
also deployed and tested the web service on Tomcat 5.5.4 web application server.
This application, while simple, provides a good introduction to Web service
development and some of the Web development tools available.1/11/13
The Phases of the KDD Process
The
Phases of the KDD Process
A
KDD process consists of several tasks. Indeed, the actual mining,
that is to say the application of a data mining algorithm to a
dataset, is only one of these steps. Following the CRISP-Data Mining
model [9,31] we distinguish the following tasks:
1. Business
Understanding
The very first step of a KDD project should be a close look from the
business point of view. The goal of this phase is to gain a deeper
understanding of the project objectives and further circumstances
strictly from the business perspective. Finally the insights from
this initial phase are to be turned into a data mining problem
definition.
2. Data
Understanding
Based on the results from the business point of view the second step
is to get familiar with the available data. The goal is to understand
the attributes and the corresponding attribute values and to find out
hidden semantics possibly in the data. Furthermore at this stage one
should figure out what exactly the available data offers. That is to
say, whether it has the potential to answer our mining questions or
not, and if possible to select promising subsets of the data.
3. Data Preparation
The next step is to construct the dataset where the mining algorithm
is to be run on. This phase covers both syntactic aspects – format
transformations for the employed mining algorithm – and semantic
aspects like table, record and attribute selection. Last but not
least this phase also includes deriving new attributes that contain
higher information only implicitly contained in the raw data (e.g.
deriving “day of the week” from “date”).
4. Modeling (or
Mining)
In the modeling phase the actual data mining takes place. Based on
the identified business goals and the assessment of the available
data an appropriatemining algorithm is chosen and run on the prepared
data.
5. Evaluation
Evaluating the results of the mining run mainly covers three aspects.
First of all, it is necessary to ensure whether everything went right
from the technical point of view. Was the mining algorithms finally
able to read and interpret the prepared dataset correctly? Were all
designated information actually given to the algorithm? Etc. Second,
one needs to investigate whether the mining results are sound from
the mining methods point of view. Some methods directly support this
decision by computing certain significance measures whereas others
leave this aspect completely to the analyst and his experience.
Third, a key objective of the evaluation phase is to determine if all
important business issues have been considered adequately.
6. Deployment
After mining the data and assessing the data mining results one needs
to transfer the results back into the business environment. This can
be rather straight forward like preparing the results in form of a
report that is understandable by business people (who of course
typically are non data mining experts). Or, as the other extreme, can
be quite complex like implementing a repeatable data mining process
across the enterprise.
1/10/13
UML Tools for Ubuntu
UML Tools for Ubuntu
Unified Modelling Language (UML) is basically a modelling languages that is typically used in the design phase of object oriented software development process, to express the thought in graphical representation, to visualize the system etc. UML, created by OMG (Object Management Group), has now become the standard approach to software modelling. In fact the UML diagrams makes coding part easier in complex systems, so the time you would spent in drawing will save you a lot of time (later, during development/implementation phase). UML diagrams represents – Static as well as Dynamic views of a system, so using UML tools you can draw – class diagrams, activity diagrams, sequence diagrams, use case diagrams etc.There are various tools available such as IBM Rational Rose, for drawing UML diagrams but in this post you are going to know about some open source modelling tools, that you can use on your Linux based Operating systems e.g Ubuntu 11.04 (Natty Narwhal) /11.10 (Oneiric Ocelot, the code name of upcoming version)/ or older versions such as 10.10/10.04 LTS…, Linux Mint, Fedora, OpenSuse etc.
UML Modelling Tools for Ubuntu (11.04/11.10/10.04/10.10..) or other Linux OS
Here are some of the most popular free and open source UML Modelling softwares that you can use with Ubuntu or other Linux distro, some of them are cross-platform i.e also available for Windows and Mac OS. Try some of them and choose the one which suits you best.Umbrello UML Modeller
Umbrello is a KDE based software for creating UML diagrams in standard format. It supports a lot of languages and code generation (advanced code generation is available for ruby) is also supported, it has all basic features – that you expect from a UML tool.sudo apt-get install umbrello
Gaphor
Gaphor is a cross-platform UML tool with simplicity, before installing it be sure to check for its dependencies such as Python (version 2.5 or later).Download Gaphor
ArgoUML
ArgoUML is one of the best open source – ‘software modelling tool’ with a lot of advanced features. It is a java based (and of course cross-platform) application.The supported diagrams are -
- class diagrams
- statechart diagrams
- use case diagrams
- activity diagrams
- sequence diagram
- deployment diagram
Dia
Dia is a GTK based drawing program that can be used for drawing UML diagrams, Flowcharts, Network diagrams etc.Download Dia
1/8/13
How to Turn Your Ubuntu Laptop into a Wireless Access Point
How to Turn Your Ubuntu Laptop into a Wireless Access Point
If you have a single wired Internet connection – say, in a hotel room – you can create an ad-hoc wireless network with Ubuntu and share the Internet connection among multiple devices. Ubuntu includes an easy, graphical setup tool.
Unfortunately, there are some limitations. Some devices may not support ad-hoc wireless networks and Ubuntu can only create wireless hotspots with weak WEP encryption, not strong WPA encryption.
Setup
To get started, click the gear icon on the panel and select System Settings.Select the Network control panel in Ubuntu’s System Settings window. You can also set up a wireless hotspot by clicking the network menu and selecting Edit Network Connections, but that setup process is more complicated.
If you want to share an Internet connection wirelessly, you’ll have to connect to it with a wired connection. You can’t share a Wi-Fi network – when you create a Wi-Fi hotspot, you’ll be disconnected from your current wireless network.
To create a hotspot, select the Wireless network option and click the Use as Hotspot button at the bottom of the window.
You’ll be disconnected from your existing network. You can disable the hotspot later by clicking the Stop Hotspot button in this window or by selecting another wireless network from the network menu on Ubuntu’s panel.
After you click Create Hotspot, you’ll see an notification pop up that indicates your laptop’s wireless radio is now being used as an ad-hoc access point. You should be able to connect from other devices using the default network name – “ubuntu” – and the security key displayed in the Network window. However, you can also click the Options button to customize your wireless hotspot.
From the wireless tab, you can set a custom name for your wireless network using the SSID field. You can also modify other wireless settings from here. The Connect Automatically check box should allow you to use the hotspot as your default wireless network – when you start your computer, Ubuntu will create the hotspot instead of connecting to an existing wireless network.
From the Wireless Security tab, you can change your security key and method. Unfortunately, WPA encryption does not appear to be an option here, so you’ll have to stick with the weaker WEP encryption.
The “Shared to other computers” option on the IPv4 Settings tab tells Ubuntu to share your Internet connection with other computers connected to the hotspot.
Even if you don’t have a wireless Internet connection available to share, you can network computers together and communicate between them – for example, to share files.
1/7/13
Install Java JDK 7 in Ubuntu 12.04
Install Java JDK 7 in Ubuntu 12.04
This package provides Oracle Java JDK 7 (which includes JRE and the Java browser plugin). However, you can’t only install Oracle JRE – the PPA only provides the full Oracle JDK7 package.
1. To add our PPA and install the latest Oracle Java (JDK) 7 in Ubuntu, use the commands below:
#sudo add-apt-repository ppa:webupd8team/java
#sudo apt-get update && sudo apt-get install oracle-jdk7-installer
2. After install you have enable the jdk:
#update-alternatives –display java
3. Check if Ubuntu uses Java JDK 7
#java -version
If all went right the answer should be:
java version “1.7.0_07″
Java(TM) SE Runtime Environment (build 1.7.0_07-b10)
Java HotSpot(TM) Server VM (build 23.3-b01, mixed mode)
4. Check what compiler is used:
#javac -version
The correct answer:
javac 1.7.0_07
5. Adding JAVA_HOME to environment
Edit /etc/environment and add JAVA_HOME=/usr/lib/jvm/java-7-oracle to the end of the file.
First open a Terminal (Applications → Accessories → Terminal), then enter:
#sudo gedit /etc/environment
Append to the end of the file:
JAVA_HOME=/usr/lib/jvm/java-7-oracle
6. Removing Oracle JDK 7
If you don’t want to use Oracle Java (JDK) 7 anymore and want to go back to OpenJDK, all you have to do is remove the Oracle JDK7 Installer and the previous Java (OpenJDK, etc.) version will be used:
#sudo apt-get remove oracle-jdk7-installer
12/7/12
Install Tomcat 7 on Ubuntu 12.04
Install Tomcat 7 on Ubuntu 12.04

Apache has officially launched version 7.0 of the servlet container for Java applications, Tomcat. Major changes in this version, you can highlight support for Servlet 3.0 and JavaServer Pages 2.2.
Install JDK
See this post: Install JDK 6 update 23 in Ubuntu 10.10 Installation
The first thing to do is download the package "apache-tomcat-7.0.6.tar.gz" from the NEXT link
http://tomcat.apache.org/download-70.cgi [tar.gz]Now unpack it with the following command:
tar xvzf apache-tomcat-7.0.8.tar.gz
Then we let in a more appropriate directory, in our case in / usr/share/tomcat7, but can be in any directory. We do this with the command:
sudo mv apache-tomcat-7.0.8/ /usr/share/tomcat7
Now we define the environment variables JAVA_HOME and JRE_HOME. This file is in the "environment" in / etc. Command to edit the file:
sudo gedit /etc/environment
Here we record the routes where we have installed Java in my case this is as follows:
( or we can configure it directly in /etc/environment )
JAVA_HOME="/usr/local/jdk1.6.0_23"JRE_HOME="/usr/local/jdk1.6.0_23/jre"PATH="...(other path):$JAVA_HOME:$JRE_HOME"
IMPORTANT: Verify the routes where they have installed Java.
I have had some problems in defining these environment variables, as sometimes tomcat does not recognize, but a surefire way of recognizing that tomcat is to define the file paths inside "catalina.sh"located in tomcat7/bin. To modify this file use the command:
sudo gedit /usr/share/tomcat7/bin/catalina.sh
Now just insert the JAVA_HOME and JRE_HOME after the first line, so the file is as follows:
#!/bin/sh
JAVA_HOME="/usr/local/jdk1.6.0_23"
JRE_HOME="/usr/local/jdk1.6.0_23/jre"
# Licensed to the Apache Software Foundation (ASF)...
#...
#...
....
Now let's configure Tomcat users, this is done in the file "tomcat-users.xml"directory tomcat7/conf. Command to edit the file:
sudo gedit /usr/share/tomcat7/conf/tomcat-users.xml
Unlike previous versions where the administrator should own role "manager" now it should be "manager-gui"to operate on the web administration tomcat7. The file would be as follows:

Now you should be all ready to try tomcat7.
First we must lift the server with the following command:
sudo /usr/share/tomcat7/bin/startup.sh
With this we get the following output on console:
Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using JRE_HOME: /usr/local/jdk1.6.0_20/jre
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar
Verify that the JRE_HOME is where we define.
Now open your web browser and type the following url:
http://127.0.0.1:8080/
So we get the following page:
If we enter the administration Tomcat Manager we click on the menu or directly at URL:
http://127.0.0.1:8080/manager/html
Here we ask the user data from previous record in mind tomcat-users.xml.
I recommend testing the sample to make sure everything works ok, they are in the section "Miscellaneous" from the side menu or at the URL:
http://127.0.0.1:8080/examples/
Commands
Start server:
sudo /usr/share/tomcat7/bin/startup.sh
Stop server:
sudo /usr/share/tomcat7/bin/shutdown.sh
Automatic Starting
To make tomcat automatically start when we boot up the computer, you can add a script to make it auto-start and shutdown.
sudo gedit /etc/init.d/tomcat7
Now paste in the following:
# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid
case $1 in
start)
sh /usr/share/tomcat7/bin/startup.sh
;;
stop)
sh /usr/share/tomcat7/bin/shutdown.sh
;;
restart)
sh /usr/share/tomcat7/bin/shutdown.sh
sh /usr/share/tomcat7/bin/startup.sh
;;
esac
exit 0
You’ll need to make the script executable by running the chmod command:
sudo chmod 755 /etc/init.d/tomcat7
The last step is actually linking this script to the startup folders with a symbolic link. Execute these two commands and we should be on our way.
sudo ln -s /etc/init.d/tomcat7 /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat7 /etc/rc2.d/S99tomcat
Tomcat should now be fully installed and operational. Enjoy!
sudo /etc/init.d/tomcat7 restart
Subscribe to:
Posts (Atom)