3 Replies Latest reply on Jun 20, 2016 5:17 PM by Divey Gupta

    Wildfly 10 singleton jar issue

    Divey Gupta Newbie

      I am trying to use wildfly 10 singleton.

      I updated my pom with the latest artifact from

      Maven Repository: org.wildfly » wildfly-clustering-singleton » 10.0.0.Final

      My manifest entry is


                           <Dependencies>org.jboss.msc,org.wildfly.clustering.singleton,org.jboss.as.server,org.infinispan export</Dependencies>


      It was working fine with 9.0.2.Final version.

      But I am getting the following error with 10.0.2.Final.

      Could not resolve dependencies for project com.viptela.vmanage.server:vmanage:war:2.0: Failure to find org.wildfly:wildfly-clustering-singleton:jar:10.0.0.Final

      I am not able to find the singleton jar online also.

      Can you please tell me what is the missing component.

        • 1. Re: Wildfly 10 singleton jar issue
          Tomaz Cerar Master

          you are probably looking for



          • 2. Re: Wildfly 10 singleton jar issue
            Paul Ferraro Master

            You shouldn't need to add *any* dependencies to your manifest. The singleton API module is added to the deployment classpath automatically.

            Can you post your code that creates your singleton service?

            • 3. Re: Wildfly 10 singleton jar issue
              Divey Gupta Newbie


              It worked for me.


              I am using the below code.

              public static final ServiceName SINGLETON_SERVICE_NAME =   ServiceName.JBOSS.append("ha", "singleton");

                  private static final String CONTAINER_NAME = "server";

                  private static final String CACHE_NAME = "default";



                  public void activate(ServiceActivatorContext context) throws ServiceRegistryException {

                      int quorum = 1;

                      InjectedValue<ServerEnvironment> env = new InjectedValue<>();

                      SingletonServiceClient srv = new SingletonServiceClient(env);

                      ServiceController<?> factoryService = context.getServiceRegistry().getRequiredService(SingletonServiceName.BUILDER.getServiceName(CONTAINER_NAME, CACHE_NAME));

                      SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) factoryService.getValue();


                      SingletonElectionPolicy policy = new SimpleSingletonElectionPolicy(0);

                      factory.createSingletonServiceBuilder(SINGLETON_SERVICE_NAME, srv)



                      .build(new DelegatingServiceContainer(context.getServiceTarget(), context.getServiceRegistry()))

                      .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, env)