Skip to main content

Posts

Tomcat Clustering Series Part 2 : Session Affinity Load Balancer

Hi this second part of the  Tomcat Clustering Series . In my first part we discuss about how to setup simple load balancer. and we seen how load balancer distribute the request to tomcat instance in round robin fashion. [Check the video below for better understanding] In this post we discuss about what is the problem is occur in simple load balancer when we introduce sessions in our web application. and we will see how to resolve this issue. Its continuation of my first part of this series. so kindly go read my first part then continue here. How Session works in Servlet/Tomcat?        Before going into problem, let see the session management in Tomcat . If any if the page/servlet create the session then Tomcat create the Session Object and attached into group of session (HashMap kind structure) and that session can identify using session-id, its just random number generated through any one of the hash algorithm. then respond to client with cookie header field. That cookie

Tomcat Clustering Series Part 1 : Simple Load Balancer

I am going to start new series of posts about Tomcat clustering . In this first post we will see what is problem in normal deployment in only single machine, what is clustering and why is necessary and how to setup the simple load balancer with Apache httpd web server + Tomcat server cluster. [Check the video for better understanding] Why need Clustering? (Tomcat Clustering)            In normal production servers are running in single machine. If that's machine may be failed due to crashed or hardware defects or OutOfMemory exception then  our site can't access by anybody. so how to solve this problem? . to add more tomcat machine to collectively (group/cluster) run as a production server. (oppose of single machine). Each tomcat has deployed the same web application. so any tomcat can process the client request. If one tomcat is failed, then other tomcat in the cluster to proceeds the request. Here one big problem is arrive. each tomcat instances are running in de

Integrate Chart Image into Jasper Report Part - 2

In my previous post we discussed how to Integrate the Charts into Jasper Reports  using JFreeChart API in Jasper Report. In this post there is another way to embeds the charts into Jasper Reports. This method, we need to generate/create the chart using any 3rd party Java Lib and convert into Image Object or stored into File-system, then just insert the Image into Jasper Report. here no need to use chart functionality in Jasper Report. because these chart are limited functionality. Steps: Create the chart using any Java libraries Convert the Chart into BufferedImage or Stored into files pass the Image into Jasper Report. 1. Create the chart using any Java libraries      In this step we going to create the chart. here i m using jopenchart Java library to create the chart. In their website tutorial section contain some sample codes. so i used these codes. and download the jopenchart lib from here . 2. Convert the chart into BufferedImage or Stored into files     In jop

Integrate Charts in Jasper Reports +JSF 2.0

In this post we will walk through how to integrate Charts (JFreeChart) into Jasper Report framework. JasperReports is the world's most popular open source reporting engine. It is entirely written in Java and it is able to use data coming from any kind of data source and produce pixel-perfect documents that can be viewed, printed or exported in a variety of document formats including HTML, PDF, Xlsx, Docx, Pptx, Odf Check my  Introduction to Jasper Reports and  Sub-report with jasper Report posts. 2-ways to Integrate the Charts/Graphs into Jasper Reports Use JFreeChart API inside Jasper Report to generate the Charts while generating reports Use any 3rd party Java Libraries to create the chart and stored in In-memory Image object (or) stored in file. then pass the Image/file to Jasper Report. then embed the Image into Report. (check here ) In this post we going to use 1st option. In Jasper Report use JFreeChart Components to make charts. In my next post we will see the

Deploy the Java Web Application to Jelastic Paas Cloud

Jelastic is Java Paas (Platform as a Service) cloud for Java Server hosting. we can easily create the server  instances (Tomcat, Glassfish ) and SQL Instances (MySQL, PostgreSQL)  and deploy the Java Web applications. Jelastic  website make its easy to use. when we logged in  one of the server then one window popped up, to create the environment here we select servers (Tomcat, GlassFish), Database Servers (MySQL,PostgreSQL) and give the unique name of ur environment. then click create button. Jelastic create the tomcat and MySQL instances. these instance are not shared to others. so we can start/stop these instance at any time. we can change the config files like Tomcat (server.xml, catalina.properties), MySQL(mysql.ini) files. When we create the instances they send mail contain the user name and password for accessing the Database server. In this screen-cast (below) i deploy the  previous post Jasper Report +JSF+JPA Web Application into Jelastic paas cloud. Screen Ca

JSF + JPA + JasperReports (iReport) Part 2

In this post  is  a continuation of Jasper Report Part 1 . here we will discuss about some advanced jasper report concepts like passing complex object like List, Date object and how to create and use local variable in jasper report, Add the sub-report and background image to report. Check my latest post about  Integrate Charts into Jasper Reports . here i am using JPA (Java Persistence API) for accessing the Database. so i create the two entity ShoppingCart and Item. here ShoppingCart entity contain list of Item entities. then i am going to pass these objects to Jasper Report. (Check the video in below) ShoppingCart.java Item.java Create Report           now i am going create report. we can use iReport standalone or iReport Netbeans Plugin to create the report. first we need to create some fields in report. these fields are matched with ShoppingCart Bean property names and Data types also. and set the data types of these fields correctly. firstName  ==>

How to do SSH Tunneling (Port Forwarding) - Screen-cast

In this post we will see how ssh works?, what is SSH tunneling? what is important of ssh tunnels and how to setup the ssh tunnel. When SSH server is installed in machine then by default its allowed ssh tunneling. SSH Tunneling (Port Forwarding) Tunneling is the concept to encapsulate the network protocol to another protocol. here we put into SSH. so all network communication are encrypted. It also called Port Forwarding. because in ssh tunneling we are going to bind one local port. so what are the packet we are going to send that particular port, all packets are transparently encrypt and delivered to remote system. What is the need for SSH Tunneling?      SSH is enough to administrate the remote system. its not enough to access the all services which are available in remote system. let i describe in the following scenario, now lets consider the scenario, System (192.168.56.101) is my system its connected to internet and server its called PrivateServer (192.1

How to compile kernel step by step

Recently I compiled the latest kernel by manually for just fun. so i logged my experience here. I show the step by step to the compilation process. I followed the this reference for compile the kernel. Why Need to compile the Kernel? Some time some software or modules expected that some kernel flags needed to set while compile (build) the kernel. This kind of scenario we need to rebuild the kernel with specified configuration flags are set. When new kernel is released,  compile the new kernel and install in our system. But this is not recommend way to install the system. so use our distribution(Ubuntu, red-hat release )  kernel update. Check your Linux kernel version         In Linux system use uname -r or cat /proc/version to find the current kernel version Linux Kernel Version here 2.6.35.22  is current system kernel version Step 1 : Download the latest kernel  Goto  http://kernel.org/  website and get the latest version of the kernel source. i will get 3.3.3