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

Unable to activate batch custom scopes #122

Closed
luca-bassoricci opened this issue May 12, 2022 · 1 comment · Fixed by #123
Closed

Unable to activate batch custom scopes #122

luca-bassoricci opened this issue May 12, 2022 · 1 comment · Fixed by #123

Comments

@luca-bassoricci
Copy link
Contributor

luca-bassoricci commented May 12, 2022

I'm trying to activate a bean annotated with @JobScoped but this annotation is ignored during deployment phase (bean is not registered at all)

@JobScoped
@Named
public class MyDTO {...}

@Dependent
@Named
public class MyBatchlet implement Batchlet {
  @Inject MyDTO jobScopedInstance;
}

results is a deployment error due to unresolvable injection point.
Using a @Produces will make compilation passing the deployment phase, but during runtime the jobScopedField is managed as a @Dependent scoped bean.

public class ObjectProducer
{
	@Produces
	@JobScoped
	@Named("jobscoped")
	MyDTO jobScopedField = new MyDTO();

JBeret registers its custom scopes using service loader via BatchCDIExtension; I suppose the same should be done during deployment.
I attached a reproducer; remove comments from ObjectProducer class to let the (failing) test run.

Best regards
Luca Basso Ricci
quarkus-jberet-scope-problem.zip

@luca-bassoricci luca-bassoricci changed the title Unable to active batch custome scopes Unable to active batch custom scopes May 12, 2022
@luca-bassoricci luca-bassoricci changed the title Unable to active batch custom scopes Unable to activate batch custom scopes May 12, 2022
@luca-bassoricci
Copy link
Contributor Author

Opened PR #123

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

Successfully merging a pull request may close this issue.

1 participant