Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WildFly - Attempt to register the same ManagedExecutorDefinition fails #263

Closed
KyleAure opened this issue Aug 1, 2022 · 7 comments · Fixed by #264
Closed

WildFly - Attempt to register the same ManagedExecutorDefinition fails #263

KyleAure opened this issue Aug 1, 2022 · 7 comments · Fixed by #264
Assignees
Labels

Comments

@KyleAure
Copy link
Contributor

KyleAure commented Aug 1, 2022

This doesn't quite work, at least in WildFly. There are two tests, ManagedExecutorDefinitionWebTests and ManagedScheduledExecutorDefinitionWebTests, which attempt to register the same ManagedExecutorDefinition twice. It really seems they should be creating different resource names or the packages themselves cannot be added.

I will note it's not enough to just remove the package import as both the servlet and EJB context URL's are injected into the test via Arquillian.

One minor nit, the formatting is using a combo of tabs and spaces. It seems like ideally, it would be consistent.

Originally posted by @jamezp in #260 (review)

@KyleAure KyleAure added the TCK label Aug 1, 2022
@KyleAure
Copy link
Contributor Author

KyleAure commented Aug 1, 2022

@jamezp Let me know if this is something you'd like to put in a PR for, otherwise, I can take a crack at it.

@jamezp
Copy link
Contributor

jamezp commented Aug 1, 2022

@KyleAure I won't have time to look at it this week more than likely. It's definitely not my area of expertise, I just happened to run the TCK and noticed it. If you've got time this week please feel free to create something and I'm more than happy to test it. :)

@KyleAure
Copy link
Contributor Author

KyleAure commented Aug 2, 2022

Okay, I'll work on this tomorrow 👍🏼

@arjantijms
Copy link
Contributor

@KyleAure any update yet?

@KyleAure
Copy link
Contributor Author

KyleAure commented Aug 8, 2022

Sorry, got a bit behind last week. I'll get a pull put together for this today. :)

@jamezp
Copy link
Contributor

jamezp commented Aug 9, 2022

I would like this to be a TCK challenge. Could someone label it as such? I don't see how it could be valid to register 2 resources with the same JNDI name. In WildFly we see a stack trace like:

07:37:56,266 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."ManagedScheduledExecutorDefinitionTests_web.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."ManagedScheduledExecutorDefinitionTests_web.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "ManagedScheduledExecutorDefinitionTests_web.war"
	at [email protected]//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:189)
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
	at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
	at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: org.jboss.msc.service.DuplicateServiceException: Service org.wildfly.ee.concurrent.scheduled-executor.ManagedScheduledExecutorDefinitionTests_web_ManagedScheduledExecutorDefinitionTests_web_ManagedScheduledExecutorDefinitionTests_web_java:module/concurrent/ScheduledExecutorB is already registered
	at [email protected]//org.jboss.as.ee.concurrent.resource.definition.ManagedScheduledExecutorDefinitionInjectionSource.getResourceValue(ManagedScheduledExecutorDefinitionInjectionSource.java:122)
	at [email protected]//org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.addJndiBinding(ModuleJndiBindingProcessor.java:271)
	at [email protected]//org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor$1.handle(ModuleJndiBindingProcessor.java:242)
	at [email protected]//org.jboss.as.ee.component.ClassDescriptionTraversal.run(ClassDescriptionTraversal.java:54)
	at [email protected]//org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.processClassConfigurations(ModuleJndiBindingProcessor.java:246)
	at [email protected]//org.jboss.as.ee.component.deployers.ModuleJndiBindingProcessor.deploy(ModuleJndiBindingProcessor.java:160)
	at [email protected]//org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:182)
	... 8 more
Caused by: org.jboss.msc.service.DuplicateServiceException: Service org.wildfly.ee.concurrent.scheduled-executor.ManagedScheduledExecutorDefinitionTests_web_ManagedScheduledExecutorDefinitionTests_web_ManagedScheduledExecutorDefinitionTests_web_java:module/concurrent/ScheduledExecutorB is already registered
	at [email protected]//org.jboss.msc.service.ServiceRegistrationImpl.set(ServiceRegistrationImpl.java:135)
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:243)
	at [email protected]//org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:758)
	at [email protected]//org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:260)
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2065)
	at [email protected]//org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:260)
	at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2065)
	at [email protected]//org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:192)
	at [email protected]//org.jboss.as.ee.concurrent.resource.definition.ManagedScheduledExecutorDefinitionInjectionSource.getResourceValue(ManagedScheduledExecutorDefinitionInjectionSource.java:101)
	... 14 more

Test Output:

[ERROR] arquillianBeforeClass(ee.jakarta.tck.concurrent.spec.ManagedScheduledExecutorService.resourcedef.ManagedScheduledExecutorDefinitionWebTests)  Time elapsed: 4.002 s  <<< FAILURE!
org.jboss.arquillian.container.spi.client.container.DeploymentException: 
Cannot deploy ManagedScheduledExecutorDefinitionTests_web.war: {"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-1" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"ManagedScheduledExecutorDefinitionTests_web.war\".INSTALL" => "WFLYSRV0153: Failed to process phase INSTALL of deployment \"ManagedScheduledExecutorDefinitionTests_web.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: org.jboss.msc.service.DuplicateServiceException: Service org.wildfly.ee.concurrent.scheduled-executor.ManagedScheduledExecutorDefinitionTests_web_ManagedScheduledExecutorDefinitionTests_web_ManagedScheduledExecutorDefinitionTests_web_java:module/concurrent/ScheduledExecutorB is already registered
    Caused by: org.jboss.msc.service.DuplicateServiceException: Service org.wildfly.ee.concurrent.scheduled-executor.ManagedScheduledExecutorDefinitionTests_web_ManagedScheduledExecutorDefinitionTests_web_ManagedScheduledExecutorDefinitionTests_web_java:module/concurrent/ScheduledExecutorB is already registered"},"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"ManagedScheduledExecutorDefinitionTests_web.war\".beanmanager","jboss.deployment.unit.\"ManagedScheduledExecutorDefinitionTests_web.war\".WeldStartService"],"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"ManagedScheduledExecutorDefinitionTests_web.war\".weld.weldClassIntrospector is missing [jboss.deployment.unit.\"ManagedScheduledExecutorDefinitionTests_web.war\".beanmanager, jboss.deployment.unit.\"ManagedScheduledExecutorDefinitionTests_web.war\".WeldStartService]","jboss.deployment.unit.\"ManagedScheduledExecutorDefinitionTests_web.war\".batch.artifact.factory is missing [jboss.deployment.unit.\"ManagedScheduledExecutorDefinitionTests_web.war\".beanmanager]"]}}}
	at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:184)
	at org.jboss.as.arquillian.container.ArchiveDeployer.deployInternal(ArchiveDeployer.java:162)
	at org.jboss.as.arquillian.container.ArchiveDeployer.deploy(ArchiveDeployer.java:91)
	at org.jboss.as.arquillian.container.CommonDeployableContainer.deploy(CommonDeployableContainer.java:256)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:151)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:118)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:239)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:118)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:71)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:47)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:92)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:77)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:232)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:212)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:77)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:96)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:83)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:69)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:89)
	at org.jboss.arquillian.testng.Arquillian.arquillianBeforeClass(Arquillian.java:99)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
	at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
	at org.testng.TestRunner.privateRun(TestRunner.java:648)
	at org.testng.TestRunner.run(TestRunner.java:505)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
	at org.testng.SuiteRunner.run(SuiteRunner.java:364)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
	at org.testng.TestNG.runSuites(TestNG.java:1049)
	at org.testng.TestNG.run(TestNG.java:1017)
	at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:135)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.executeMulti(TestNGDirectoryTestSuite.java:193)
	at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:94)
	at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:146)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)

The cause being the duplicate resource name being registered.

@KyleAure
Copy link
Contributor Author

KyleAure commented Aug 9, 2022

@jamezp I do not agree. This issue was introduced because it was missed in a previous PR to introduce web profile testing to the TCK. But the PR was merged before I had time to fix it with the following comment: #260 (comment)

It seems unfair to merge a PR with known issues, and then request the test to be challenged because it fails.
I honestly think #260 should not have been merged before it passed on WildFly and Glassfish, but we were never given that change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants