Saturday, July 6, 2013

JBO-26001: NoXMLFileException

This exception comes in ADF BC projects. In my case <project>.jpx file was not part of deployment.
Run time BC needs the .jpx, As it is not able to find it throw JBO-26001: NoXMLFileException exception.
To make sure .jpx is part of deployment. Right click on project under deployment section check whether its included or not. If its not included add it.
Hope it solve the issue.

Saturday, April 13, 2013

Hashcode and Equals Method


It’s a common topic In  java interviews. And these two methods are always common to any class you write in Java. So let’s know them in and out.
boolean equals(Object  obj) and int hashCode() are two methods implemented in Object class with several other methods.  In Java every class implicitly inherit Object class so every class has these methods.  Equals method check the reference is holding same object or not.
MyClass obj1 = new MyClass();
MyClass obj2 = 0bj1;
Then obj1.equals(obj2) returns true.
MyClass obj3 = new MyClass();
In this case obj1.equals(obj3) will return false.
It means original equals method check whether two reference contain same object or not. If two object are logically similar, for ex like wrapper class Integer, Boolean etc we need to override equals method.
Boolean b1 = true;
Boolean b2 = true;
b1.equals(b2)  will return true. 
To overload equals method programmer may chose to compare field by filed.
Public class Employee
{
Integer employeeId;
String name;
public  boolean equals(Object obj)
{
 if (obj != null && obj instanceof Employee)
{
 Employee obj2 = (Employee) obj;
 return (obj2.getEmployeeId() == null ? this.employeeID == null : 
 obj2.getEmployeeId().equals(this.employeeID))
&& (obj2.getEmployeeName() == null ? this.employeeName == null : 
 obj2.getEmployeeName().equals(this.employeeName));  
}
return false;
}

Hascode method always return integer. Any two object equals return true always return same hashcode.  But its not necessary if two object produce same hashcode need to be equal.
Now here is the million dollar question if we override equals method do we need to override hashcode method. The answer is yes. We need to override hashcode method. It should satisfy two condition every distinct object produce different hashcode consistently and equals object will produce same hashcode.
Hashcode is important when we use HashTable, HashSet or HashMap in collections api. If we don’t construct the object in the above way, these collections may not work properly, performance can deteriorate.
So bottom line is always override hashcode when you override equals. J

Monday, November 26, 2012

What is the Big Deal about Big Data


Like every sector in our computer world we always have some new trends.  In fact the dynamics of changing trend in Computer industry is very evident. Few years back all want to adopt tablet and different form of post pc devices. And recent time Cloud was the big word. All most all companies have launched lots of cloud specific services or platform. Every blogger including me has written about cloud. And now the recent buzz is Big Data, Hadoop, Data Analytics etc.. 
There is a say Pen is mightier than Sword.  It means Knowledge, information is the key. If a student knows the right answer of the question in exam he will succeed. If the doctor knows more information about the disease he can diagnose and treat better. Similarly if a business knows has right information about its customer needs it can succeed well. So it’s important to get right information in time. And if we think most of the time that “information” is the only difference between success and failure.
So people invest huge to store data and retrieve/derive the useful information out of it in real time.  The whole process is divided in two steps first part is to store related data. And most of the time these are unstructured data. And the second thing is to analysis or processes those data to get right information in real-time. These unstructured data can come from or around your business.  For example any ecommerce portal will like to store and analysis its visitor browsing pattern. This will help them to arrange or present their products efficiently. Similarly an bank should like to know what its customers like, dislike or spending habit. So that it can customize its product as per it. More or less all big corporate houses are started spending in BigData and Analytics.
Well Data and Analytics not only help big organization. It can be useful  to stream line personal finance too. Money manager from Intuit is an example in this direction. It tracks all spending, and categorize them. So that one can easily track income and spending.  Its early days, In coming days we will see more product or services around Analytics and BIgData.