Logging in java Part-1

Logging is one of the most important part of an application development. A well logging enabled application not only keeps track of the application flow but it also helps in debugging. As application grows logging even becomes more important because it helps in finding a bug which seldom comes on production. There may be thousands of logging requests generated per second depending upon the application size in that case logging should not hamper application performance. Apart from performance there...
Read More

Install subversion 1.7.x in ubuntu and mint

Ubuntu official software repository doesn't have subversion 1.7.x which is required by subclipse 1.8.x.But you can download all relevant packages from debian repository and install it manually.Packages required for 64-bit machine are listed below, for 32-bit machine replace amd64 with i386.1. subversion_1.7.5-1_amd64.deb2. libsvn1_1.7.5-1_amd64.deb3. libsvn-java_1.7.5-1_amd64.deb4. libaprutil1_1.4.1-3_amd64.deb5. libserf1_1.1.0-2_amd64.debDownload Link: http://packages.debian.org/ko/sid/subversionYou...
Read More

Generate SSL Certificate and add it to JVM and Tomcat

# Steps to generate a certificate file in linux. # Keep a common password whenever asked during the process. Commonly used password is "changeit". # Minimum requirement - openssl and jdk must be installed.# In this example domain name used for demonstration is "localhost".# Run these commands in the same order as written.# Generate a key  openssl genrsa -des3 -out localhost.key 1024  # Generate a local certificate sigining request.# In this step some information related to company will be asked to enter, keep in mind that "common name" must be the domain name.  openssl req -new -key localhost.key -out localhost.csr  # Generate a certificate from csr file, it has validity of 365 days.   openssl x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt  #...
Read More

Remove grid lines completely from excel jasperreports

Jasperreports version - 4.5.0 Apache poi version - 3.7 Jasperreports uses apache poi for xls report generation but for xlsx report generation it uses its own ooxml implementation so you have to modify both of these libraries to remove excel grid lines completely. For XLS - Line 744, File location - poi-3.7-src/src/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java    HSSFSheet sheet = new HSSFSheet(this); + sheet.setDisplayGridlines(false); For XLSX - Line 97, File location - jasperreports-4.5.0/src/net/sf/jasperreports/engine/export/ooxml/XlsxSheetHelper.java - write("<sheetPr><outlinePr summaryBelow=\"0\"/></sheetPr><dimension ref=\"A1\"/><sheetViews><sheetView workbookViewId=\"0\""); + write("<sheetPr><outlinePr summaryBelow=\"0\"/></sheetPr><dimension...
Read More

Report design not valid

If content of a section doesn't fit in a page then following exception is thrown by jasperreports design validator. There are many ways to get rid of this exception. Increase your report's page height. But if you are not sure about subreport's height then this option might not work for you. If you are using dynamic reports (Wrapper around jasperreports) and suppose you are adding subreport in summary section then specifying summary split type to IMMEDIATE will solve the problem. JasperReportBuilder reportBuilder = report().setSummarySplitType(SplitType.IMMEDIATE); net.sf.dynamicreports.jasper.transformation.ComponentTransform$SubreportExpression evaluate SEVERE: Error encountered while creating subreport design net.sf.jasperreports.engine.design.JRValidationException: Report design not...
Read More