Skip to main content

[jsr352-public] Re: Injection into a Batchlet

  • From: Scott Kurz < >
  • To:
  • Subject: [jsr352-public] Re: Injection into a Batchlet
  • Date: Mon, 6 May 2013 10:50:11 -0400

That's the correct location...hmmm..not sure what the problem could be.

The stack trace you showed is only the error on our fallback loading, which means the CDI load must have failed.


We're less noisy about a CDI load failure since fallback to batch.xml, etc. may be the preference.

The code around the CDI load looks like this... perhaps you could enable logging or debugging to get a clue what the problem might be.

------------------------------------------------------------------------------

package com.ibm.jbatch.container.services.impl;

  public class CDIBatchArtifactFactoryImpl implements IBatchArtifactFactory {
...
try {
InitialContext initialContext = new InitialContext();
BeanManager bm = (BeanManager) initialContext.lookup("java:comp/BeanManager");
Bean bean = bm.getBeans(id).iterator().next();
Class clazz = bean.getBeanClass();
artifactInstance = bm.getReference(bean, clazz, bm.createCreationalContext(bean));
} catch (Exception e) {
// Don't throw an exception but simply return null;
logger.fine("Tried but failed to load artifact with id: " + id + ", Exception = " + e);
}
------------------------------------------------------
Scott Kurz
WebSphere Batch / Compute Grid Development
T/L 295-5649;
External Phone 845-435-5649

--------------------------------------------------------


Inactive hide details for Vijay Nair ---05/06/2013 10:18:07 AM---Yes. It is under /WEB-INF/ On Mon, May 6, 2013 at 7:31 PM, ScoVijay Nair ---05/06/2013 10:18:07 AM---Yes. It is under /WEB-INF/ On Mon, May 6, 2013 at 7:31 PM, Scott Kurz < > wrote:

From: Vijay Nair < >
To: ,
Date: 05/06/2013 10:18 AM
Subject: [jsr352-public] Re: Injection into a Batchlet





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


    From:
    Vijay Nair < " target="_blank"> >
    To:
    " target="_blank"> ,
    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


GIF image



[jsr352-public] Injection into a Batchlet

fusionvj 05/04/2013

[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