Skip to main content

Posts

Tomcat Clustering Series Part 4 : Session Replication using Backup Manager

Hi this is my fourth part of the  Tomcat Clustering Series . In this post we are going to discuss the how to setup session replication using Backup Manager in tomcat clustering environment. Session replication makes High availability and full fail-over capability to our clustering environment. [Check the video below for better understanding] Its continuation of the last post (session replication using Delta Manager) . In delta manager each tomcat instance need to replicate the session information to all other tomcat instances. Its take more time and replication if our cluster size is increased. so there is alternative manager is there. Its Backup Manager. Backup Manager is replicate the copy of session data to exactly one other tomcat instances. This big difference between both managers. here which tomcat creates that is primary copy of the session. and another tomcat whose hold the replicate session is backup copy . If any one of the tomcat is down. back up tomcat serve the ses

Tomcat Clustering Series Part 3 : Session Replication

Hi this is my third part of the  Tomcat Clustering Series . In this post we are going to discuss the how to setup session replication in tomcat clustering environment. Session replication makes High availability and full fail-over capability to our clustering environment. [Check the video below for better understanding] In my previous post we discussed about setup simple load balancer and how to make session affinity concepts. How to setup Session Replication in tomcat    before going to session replication we need to understand 2 important concepts Multicast Session Manager in Tomcat Multicast       Multicast is To transmit a single message to a select group of recipients. here multicast used by tomcat cluster to identify the instances those part of cluster.  There is 2 types of cluster Static Tomcat Cluster Dynamic Tomcat Cluster In static cluster there is no need multicast, because each tomcat we statically defined/configured the other instances. Bu

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  ==>