There is an intefrace MyIntefrace.
System has several EARs, each with own implementations of that intefrace. I need to find all implementations without their names (? extends MyInterface).
I decided to use java.util.ServiceLoader and created a jar with META-INF/services/com.example.MyInterface inside it, ant this jar can be deployed in any of EARs.
The jar has a servlet and following code inside int's init method:
ServiceLoader<MyInterface > loader = ServiceLoader.load(MyInterface .class);
Iterator<MyInterface > it = loader.iterator();
But iterator still empty..
I tryed to add services/com.example.MyInterface in EARs META-INF, but result is the same.
That approach works fine in jboss 6 and tomcat.