I have a singleton class which is referred in a jar file.Now the jar file is included in multiple ear file.Let's take an example.
I have singleton class which is present in a singleton.jar and this jar file is copied in 4 different ear/war file.Now my requirement is
this class has to be singleton across multiple appliation.But when iam instatiating across application(.ear) file then it creates a different
singleton class.Is there any otherway other than making these ear files referring to single jar file.
This doesn't seem to be related to SCEA. Did you mean to post it in BEA/WebLogic? (just guessing based on some of your previous posts). I can move this if you provide a hint on where you would like it moved to.
1. Move the jar up the class loader hierarchy so that it is loaded once.
2. Use an app server that uses a unified classloader factory. This way the first instance of the class will be picked up and the rest will be discarded.
Any reason why this Singleton is creating a problem across multiple apps ?