SIngletonService creation through jboss eap 7.4

Posted on

I have upgrade jboss from 6.2 to 7.4 , after upgradation, I am not able to deploy my application .
My code for creating SingletonService is :
SingletonServiceBuilderFactory factory = (SingletonServiceBuilderFactory) context.getServiceRegistry()
.getRequiredService(SingletonServiceName.BUILDER.getServiceName(CONTAINER_NAME)).awaitValue();

                factory.createSingletonServiceBuilder(BatchJobBootStrapper.SINGLETON_SERVICE_NAME, service)
                .build(context.getServiceTarget()).setInitialMode(ServiceController.Mode.ACTIVE)
                .addDependency(ServerEnvironmentService.SERVICE_NAME, ServerEnvironment.class, service.env)
                .install();

I am getting below ERROR while deploying my application :

2022-12-22 13:54:35,438 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."fdpNotifications-ear.ear"."com.fdp-fdpNotifications-1.0.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."fdpNotifications-ear.ear"."com.fdp-fdpNotifications-1.0.jar".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "com.fdp-fdpNotifications-1.0.jar" of deployment "fdpNotifications-ear.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoSuchMethodError: org.jboss.as.server.Services.addServerExecutorDependency(Lorg/jboss/msc/service/ServiceBuilder;Lorg/jboss/msc/inject/Injector;Z)Lorg/jboss/msc/service/ServiceBuilder;
at org.jboss.as.clustering.msc.AsynchronousService.addService(AsynchronousService.java:59)
at org.jboss.as.clustering.msc.AsynchronousService.addService(AsynchronousService.java:53)
at org.jboss.as.clustering.singleton.SingletonService.build(SingletonService.java:101)
at org.jboss.as.clustering.singleton.SingletonService.build(SingletonService.java:86)
at com.fdp.notifications.service.batch.impl.BatchJobBootStrapperActivator.activate(BatchJobBootStrapperActivator.java:60)
at org.jboss.as.server.deployment.service.ServiceActivatorProcessor.deploy(ServiceActivatorProcessor.java:91)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
... 8 more

Responses