Skip to main content

[jsr352-public] Re: Injection into a Batchlet

  • From: Ricardo Cervera-Navarro < >
  • To:
  • Subject: [jsr352-public] Re: Injection into a Batchlet
  • Date: Mon, 06 May 2013 11:17:18 -0700
  • Organization: Oracle Corporation

Hi Vijay,

Do you have a no-args, empty, and public constructor for your batch artifact bean?

If CDI fails to instantiate your bean, the batch runtime won't find it. For example, the problem you describe can be caused by code like the following:

@Named("MyProcessorImpl")
public class MyProcessorImpl implements ItemProcessor {
    @Inject
    JobContext jobCtx;

    public MyProcessorImpl() { 
         jobCtx.(...) // don't access the job context here so that CDI can instantiate the bean
    }
}
At least I run into this problem before; hope this helps.

-Ricardo

On 5/6/2013 7:12 AM, Vijay Nair wrote:
" type="cite">
Yes. It is under /WEB-INF/


On Mon, May 6, 2013 at 7:31 PM, Scott Kurz < " target="_blank"> > wrote:

Vijay,

Do you have a beans.xml in your app?   It can be empty even...



------------------------------------------------------
Scott Kurz
WebSphere Batch / Compute Grid Development
T/L 295-5649;
External Phone 845-435-5649
" target="_blank">
--------------------------------------------------------


Inactive hide details for Vijay Nair ---05/06/2013
                09:59:50 AM---Hi Scott, I might have missed something
                fundamental as I have Vijay Nair ---05/06/2013 09:59:50 AM---Hi Scott, I might have missed something fundamental as I have been looking it far too Date: 05/06/2013 09:59 AM

Subject: [jsr352-public] Re: Injection into a Batchlet




Hi Scott,

I might have missed something fundamental as I have been looking it far too long....Here are the snippets

*********

Batchlet
*********

@Named("FCRetProcedureInvokerBatchlet")
public class FCRetProcedureInvokerBatchlet extends AbstractBatchlet{
}

************************

JSL XML (Snapshot)
************************
<flow id="FCBSRETEODFLOW" next="retFlowDecider">
            <step id="FCRETEODJOBSTEP1">
                <batchlet ref="FCRetProcedureInvokerBatchlet"/>

            </step>
</flow>

******

Error
******

WARNING:   Caught exception executing step: java.lang.RuntimeException: com.ibm.jbatch.container.exception.BatchContainerRuntimeException: Tried but failed to load artifact with id: FCRetProcedureInvokerBatchlet
    at com.ibm.jbatch.container.artifact.proxy.ProxyFactory.loadArtifact(ProxyFactory.java:54)
    at com.ibm.jbatch.container.artifact.proxy.ProxyFactory.createBatchletProxy(ProxyFactory.java:77)
    at com.ibm.jbatch.container.impl.BatchletStepControllerImpl.invokeBatchlet(BatchletStepControllerImpl.java:67)
    at com.ibm.jbatch.container.impl.BatchletStepControllerImpl.invokeCoreStep(BatchletStepControllerImpl.java:107)
    at com.ibm.jbatch.container.impl.BaseStepControllerImpl.execute(BaseStepControllerImpl.java:144)
    at com.ibm.jbatch.container.impl.ExecutionTransitioner.doExecutionLoop(ExecutionTransitioner.java:112)
    at com.ibm.jbatch.container.impl.FlowControllerImpl.execute(FlowControllerImpl.java:72)
    at com.ibm.jbatch.container.impl.ExecutionTransitioner.doExecutionLoop(ExecutionTransitioner.java:112)
    at com.ibm.jbatch.container.impl.JobThreadRootControllerImpl.originateExecutionOnThread(JobThreadRootControllerImpl.java:110)
    at com.ibm.jbatch.container.util.BatchWorkUnit.run(BatchWorkUnit.java:80)
Caused by: com.ibm.jbatch.container.exception.BatchContainerRuntimeException: Tried but failed to load artifact with id: FCRetProcedureInvokerBatchlet
    at com.ibm.jbatch.container.services.impl.DelegatingBatchArtifactFactoryImpl.load(DelegatingBatchArtifactFactoryImpl.java:101)
    at com.ibm.jbatch.container.artifact.proxy.ProxyFactory.loadArtifact(ProxyFactory.java:52)
    ... 17 more
Caused by: java.lang.ClassNotFoundException: FCRetProcedureInvokerBatchlet
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1761)
    at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)
    at com.ibm.jbatch.container.services.impl.DelegatingBatchArtifactFactoryImpl.load(DelegatingBatchArtifactFactoryImpl.java:96)
    ... 18 more







[jsr352-public] Re: Injection into a Batchlet

(continued)

[jsr352-public] Re: Injection into a Batchlet

05/04/2013

[jsr352-public] Re: Injection into a Batchlet

Vijay Nair 05/04/2013

[jsr352-public] Re: Injection into a Batchlet

Scott Kurz 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Scott Kurz 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Vijay Nair 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Scott Kurz 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Vijay Nair 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Scott Kurz 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Vijay Nair 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Scott Kurz 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Ricardo Cervera-Navarro 05/06/2013

[jsr352-public] Re: Injection into a Batchlet

Vijay Nair 05/07/2013
 
 
Close
loading
Please Confirm
Close