-
Notifications
You must be signed in to change notification settings - Fork 76
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
WELD-001408: Unsatisfied dependencies for type X with qualifiers @Default #80
Comments
At what stage did you get this error? Is there already a job execution going on? If no, then there is no job context existing anywhere so will not be able to inject JobContext. Also is the injection target class (your stepup listener class) one of the standard batch artifact types, i.e., subtype of JobListener, StepListener, etc? |
Certainly after the creation of WAR, because the WAR file can be found on my PC. Maybe during the deployment of
Based on the first answer, I don't think there's a job execution going on. My logger prints the execution ID if the job execution is started, but it didn't print anything about it.
Isn't the job context created before the job execution ? I see the lifecycle in §11.3 Job Processing of JSR 352 1.0 Final Release (page 106) :
Are the job execution elements be created at step 4 ?
Yes, the job context setup listener extends the abstract job listener. @Named
public class JobContextSetupListener extends AbstractJobListener {
private final JobContext jobContext;
@Inject
public JobContextSetupListener(JobContext jobContext) {
this.jobContext = jobContext;
}
...
} Particularity of the situationWhen I deployed the batch job as part of the arquillian test, the job ran fine. When I deployed the batch job via a module added to WildFly at first, then ran the arquillian test, than I got the above error. |
Does the hibernate module have a dependency on the |
Yes, the hibernate module does have this dependency. |
Excellent. I found it right after I asked too on a different message :) I'll try to look through the project and give a try when I get a chance. The error is basically saying it can't find the One minor side note. The batch injections are only required to work on type |
Thanks @jamezp. You can download the project and checkout the branch issue-132. Then build it using command line
It is added via @Deployment
public static WebArchive createDeployment() {
WebArchive war = ShrinkWrap.create( WebArchive.class, PerformanceIT.class.getSimpleName() + ".war" )
.addAsWebInfResource( "jboss-deployment-structure.xml", "/jboss-deployment-structure.xml" )
.addAsResource( "META-INF/persistence.xml" )
.addAsWebInfResource( EmptyAsset.INSTANCE, "beans.xml" )
.addPackage( Company.class.getPackage() );
return war;
}
Thanks for notifying it! I'll fix it soon. 😎 |
if it failed at deployment time, it means probably no job has been started yet. So there is no job context available to inject. the CDI @produces method for handling JobContext, StepContext injection is in jberet-core.jar or module. I suspect the error from CDI merely means CDI, from static inspection, cannot detect anyone to @produces such an injection value, hence the failure. So it could be that your module needs to have access to jberet-core.jar /module for Weld to see @produces methods. See org.jberet.creation.BatchBeanProducer |
Thanks for your advice, @chengfang. The issue has been fixed by adding <module xmlns="urn:jboss:module:1.1" name="org.hibernate.search.jsr352" slot="${hibernate.search.version}">
<resources>
<resource-root path="hsearch-jsr352-core-${hibernate.search.version}.jar" />
</resources>
<dependencies>
<module name="org.jberet.jberet-core" />
...
</dependencies>
</module> |
I'm working on the Hibernate Search project which deploys a JSR 352 batch job via a module added to WildFly rather than through a deployed application. This batch job should then be usable from applications which declare a dependency to that module, e.g. my arquillian test
PerformanceIT.java
:When the WildFly-10.0.0.Final was launched, the job xml had been found. However, I got the below errors. I'm very new in this field and I don't how to fix it. Do these errors mean the producers of JobContext / StepContext / BatchProperty do not have bean defining annotations? Any help will be very appreciated, thx!
Mincong
The text was updated successfully, but these errors were encountered: