3 Replies Latest reply on Oct 22, 2015 10:34 AM by Wolf-Dieter Fink

    Info about SimpleSingletonElectionPolicy

    Leonardo Battagli Newbie

      Hi all,


      I have a problem using the SingletonElectionPolicy.


      First, I tried to modify the hasingleton service for including it in my application where I added the following dependencies.

      I moved the java files and renamed the package, I moved the meta-inf directory and updated the package inside the file org.jboss.msc.service.ServiceActivator.

      The 'example' has been moved inside an 'EJBModule' in an Enterprise application.


      org.jboss.msc, jboss-msc, 1.2.6.Final, provided


      org.jboss.spec.javax.annotation, jboss-annotations-api_1.1_spec,1.0.1.Final-redhat-3,provided


      org.jboss.as, jboss-as-logging,7.5.0.Final-redhat-21

      If I set 'provided' I get a LinkageError

      Caused by: java.lang.LinkageError: loader constraint violation:

      when resolving method "org.jboss.as.clustering.singleton.SingletonService.<init>






      the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class,




      and the class loader (instance of org/jboss/modules/ModuleClassLoader) for resolved class,


      have different Class objects for the type org/jboss/msc/service/Service used in the signature

      While if I DO NOT set 'provided' I instead get a ClassNotFound

      Caused by: java.lang.ClassNotFoundException: org.jboss.as.clustering.singleton.SingletonElectionPolicy from [Module "

      I am using EAP 6.4, any idea ?

      the jboss-as-clustering-singleton artifact ishould be provided or not ?

      thks in advance


      I answer by myself ... You need to add the modules to the jboss-deployment.xml          <module name="org.jboss.as.clustering.service" export="true" />          <module name="org.jboss.as.clustering.singleton" export="true" />          <module name="org.jboss.msc" export="true" />