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

Injecting ManagedExectuorService by custom Quarlifier does not work #25048

Open
hantsy opened this issue Jul 15, 2024 · 2 comments
Open

Injecting ManagedExectuorService by custom Quarlifier does not work #25048

hantsy opened this issue Jul 15, 2024 · 2 comments

Comments

@hantsy
Copy link

hantsy commented Jul 15, 2024

Environment Details

  • GlassFish Version (and build number):v8.0.0-M6
  • JDK version: 21
  • OS: Windows 10
  • Database: built-in DB(not used in this example project)

Problem Description

Startup exceptions like this,

CDI deployment failure:WELD-001408: Unsatisfied dependencies for type ManagedExecutorService with qualifiers @MyQualifier
  at injection point [BackedAnnotatedField] @Inject @MyQualifier private com.example.GreetingService.executor
  at com.example.GreetingService.executor(GreetingService.java:0)
. Please see server.log for more details.

Steps to reproduce

Define a ExecutorService definition like this.

@ManagedExecutorDefinition(
        name = "java:comp/MyExecutor",
        maxAsync = 10,
        context = "java:comp/MyContextService",
        virtual = true,
        qualifiers = {MyQualifier.class}
)
....
@ApplicationScoped
class AsyncConfig{}
@ApplicationScoped
public class GreetingService {
    private final static Logger LOGGER = Logger.getLogger(GreetingService.class.getName());

    @Inject
    @MyQualifier
    private ManagedExecutorService executor;

It seems the concurrency is stable, according to the documentation of Concurrency, it should work.

@arjantijms
Copy link
Contributor

arjantijms commented Jul 15, 2024

If I'm not mistaken, this only works in the later builds. Would be great if you can give the following build a try:

https://ci.eclipse.org/glassfish/job/glassfish_build-and-test-using-jenkinsfile/job/PR-25036/7/artifact/bundles/glassfish.zip

@OndroMih
Copy link
Contributor

Hi @hantsy , can you check it this works in the latest build? So that we can close this issue if it does.

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

No branches or pull requests

3 participants