Skip to main content

Posts

Showing posts from 2011

Code review with Sonar

Last week Sonar announced their new version 2.8 with a few new features and bug fixes. The main new feature is the support of custom code review. Crucible and Review board are another alternative code review system. Sonar come across with code coverage and review in one system, which is easy to maintain with small effort. As usual sonar administrator must create users to assign tasks and collaborations. Sonar provide LDAP plugin which enables the delegation of Sonar authentication to an external system. Currently LDAP plugin supports LDAP and Active directory. In our corporation we are using active directory and first of all i tried to configure the LADP plugin. LDAP plugin wiki fully describes the installation of the plugin with LDAP system but poorly with AD. With some effort with my boss we were able to configure the plugin with our AD system. Follows i am sharing the configuration: #------------------- # Sonar LDAP Plugin #------------------- # IMPORTANT : before activation,

Apache maven incremental build

Apache maven is one of the popular tool for building and managing java projects. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. However when you have projects with multiple modules, it follows some issue when you compiling your project. One of them is incremental building, which means when you updates your project from the version control, you have to build the entire system by command mvn clean install. Consider the following maven project structure: IncrementalBuild |_ _ test-api |_ _ test-api-impl |_ _ test-donothing where module test-api-impl dependent on module test-api. Whenever we will make some change on module test-api, we have to recompile and build the module test-api-impl. If we will enter the command mvn install module test-api-impl will not get the updated version from the module test-api. You have to run command mvn clean install which will rebuild the

Analyse with ANT - a sonar way

After the Javaone conference in Moscow, i have found some free hours to play with Sonar . Here is a quick steps to start analyzing with ANT projects. Sonar provides Analyze with ANT document to play around with ANT, i have just modify some parts. Here is it. 1) Download the Sonar Ant Task and put it in your ${ANT_HOME}/lib directory 2) Modify your ANT build.xml as follows: <?xml version = '1.0' encoding = 'windows-1251'?> <project name="abc" default="build" basedir="."> <!-- Define the Sonar task if this hasn't been done in a common script --> <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"> <classpath path="E:\java\ant\1.8\apache-ant-1.8.0\lib" /> </taskdef> <!-- Out-of-the-box those parameters are optional --> <property name="sonar.jdbc.url" value="jdbc:oracle:thin:@xyz/sirius.xyz" /> <property na

A quick fix of WS-I BP2703 assertion

A few days ago we have got WS-I conformance report from our third party client that says our web service is not compliant with WS-I guidelines. The report summary was failed with the following error: Assertion: BP2703 Our team member quick check the WS-I compliance in Jdeveloper and can't reproduce the bug, but with soapUI gave the result with the assertion failed. Here is the WSDL of the web service. &lt?xml version="1.0" encoding="utf-8" ?&gt <wsdl:definitions xmlns:tns="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/RetailerService.wsdl" targetNamespace="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/RetailerService.wsdl" xmlns:retailer="http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Retailer.wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns=&qu

Clearing Hazelcast data grid cache with Oracle Database change notification

UP1: if you are interested in in-memory computing, we recommended the book "High performance in-memory computing with Apache Ignite" . A few days ago we decided to use 2nd level cache for better java scalability in our legacy system. Everything goes fine with hazelcast as a 2nd level cache, whenever our a few 3rd party applications starts uploading data directly to the Oracle schema. Generally, a middle-tier data cache duplicates some data from the back-end database server. Its goal is to avoid redundant queries to the database. However, this is efficient only when the data rarely changes in the database. The data cache has to be updated or invalidated when the data changes in the database. If application operates DML operations through cache it's simply your life, but in our case some of our 3rd party can't use hazelcast data grid and we decided to get the proper way to update our caches or clear it whenever some entity on tables updates. In this post i will pr

J2EE application profiling with yourkit on Weblogic

One of our provider uses HP-UX on production machine, a few J2ee applications runs on that machine. After sometimes, we start getting complain from our clients that portal often goes out of memory and we decided to investigate the application with Yourkit . Yourkit is a industry leading java profiling software on present day, it can works with standalone java application as well as remote profiling. YourKit supports SQL,JNDI and run time memory profiling, see the following link for more information . 1) First download the version you need, in my cases i download Windows and HP-UX version and got the evaluation key. 2) Unzip the YJP-9.5.3*.zip and run the following command on HP-UX to set the agent for profiling on weblogic  cd yjp-9.5.3/lib & java -jar yjp.jar -integrate which will bring up you new command console to configure agent with the weblogic server. Go throws the command prompt and locate your weblogic startup script as follows: Now you will get a new startup scrip