Oh gosh, that's a large post! First, I don't think you require throws IOException in the constructor of ENTITY. Second, please use the Java convention for identifier names, it's your friend honest :icon_mrgreen: Instead of ENTITY it should be Entity.
At first glance, I think your error is because of: attribute[] attr=new attribute[no_of_attribute]; though I'm actually a bit in conflict about that. So try putting attr = new attribute[no_of_attribute]; within your constructor. And simply have attribute attr; declared as a field variable. I'm not sure how good your Java is but if you don't understand what I've said, please let me know. Moveover, I'm not sure if this will resolve your problem but it's easier to test that out than for me to look at all of your code. Oh and please use the DaniWeb tags when quoting programming code :icon_wink:
Oh and it should beAttribute and not attribute as per the Java naming convention :icon_biggrin:
One last thing, never iterate over an array like this: for(int i=0;j<no_of_attribute;j++)
If you change it to: for(int i=0;j<attr.length;j++) then you will stop getting thatException