Monday, August 3, 2009

JBoss still uses old .class files even after replacing them with new class files....

Was facing an issue with jboss when i tried to redeploy an ear by replacing few .class files with new compiled .class files (the class files are mostly interfaces containing constants defined in it). But the jboss failed to pickup the new .class files, rather it was referring to the old class files still.

I tried every possibility like redeploying the ear, clearing the cache of jboss, etc but it didn't helped out. But if updating the class which is 'implementing' the interface, it would then refer to new .class files.

The possible reasons could be
- Jboss compiler is possibly failing to recognize the changed interfaces as the implemented class is not been updated.
- The Jboss is not cleaning it weekly hashmapped reference of the classes.

But the point what i learned is that defining constants in an interface is a bad practice as you can end up in such trouble. Interfaces are meant to expose the method definitions.

1 comment:

RPidugu said...

Hi..Pavani..

This is exactly what I am searching for. I am going to add ur blog in my site... Its happy for me if u add my blog also in ur blog. My blog : http://javaj2eeplanet.blogspot.com

--ReDs