5 Replies Latest reply on May 19, 2017 10:25 AM by cfang

    Job operator is called then job exits with no log messages

    richardmoore

      I have had this issue before with things getting included in jars that cause issues but reordering the classpath entries for the new ones to the bottom has worked. Not this time. I have spent some time trying to figure it out but to no avail. I have included the java api JRecord which has the jars: cb2xml.jar, Cobol2Colbol.jar, Cobol2Xml.jar, JRecord.jar, and Xml2Cobol.jar

       

      There has to be some sort of conflict between these jars and those of the framework. If I create an executable jar out of the framework and my utility batchlets and then in another Eclipse workspace order the executable jar with the framework jars as the first in the classpath and then the above JRecord jars it works. Any help would be greatly appreciated.

       

      Where it is stopping -

      log.log(Level.INFO, "Creating job operator.");

      operator = BatchRuntime.getJobOperator();

      log.log(Level.INFO, "Job operator created.");

       

      All I get in my log is "Creating job operator." and then the job ends having done nothing.

        • 1. Re: Job operator is called then job exits with no log messages
          cfang

          Do you have a reproducible test app?  Can you create a JIRA issue and attach the test app, including these jars that caused the problem?

           

          This is the similar issue you reported on Sep 26, 2016:

          BatchRuntime.getJobOperator() call is prematurely terminating the program

          • 2. Re: Job operator is called then job exits with no log messages
            cfang

            I ran a job manually with these 4 jars in teh front of the classpath and JBeret 1.3.0.Beta6-SNAPSHOT, but didn't see your problem:

             

            /Users/cfang/jberet/lib >

             

            java -cp /Users/cfang/Downloads/cb2xml/JRecord_Version_0.81.4/lib/JRecord.jar:/Users/cfang/Downloads/cb2xml/JRecord_Version_0.81.4/lib/Cobol2Cobol.jar:/Users/cfang/Downloads/cb2xml/JRecord_Version_0.81.4/lib/cb2xml.jar:/Users/cfang/Downloads/cb2xml/JRecord_Version_0.81.4/lib/Cobol2Xml.jar:/Users/cfang/Downloads/cb2xml/JRecord_Version_0.81.4/lib/Xml2Cobol.jar:jboss-batch-api_1.0_spec-1.0.0.Final.jar:jberet-core-1.3.0.Beta6-SNAPSHOT.jar:jberet-se-1.3.0.Beta6-SNAPSHOT.jar:jboss-transaction-api_1.2_spec-1.0.0.Final.jar:wildfly-security-manager-1.1.2.Final.jar:jboss-logging-3.3.0.Final.jar:jboss-marshalling-1.4.10.Final.jar:jberet-vertx-shell-1.3.0.Beta6-SNAPSHOT.jar:cdi-api-1.2.jar:weld-core-2.3.4.Final.jar:weld-se-2.3.4.Final.jar:weld-spi-2.3.SP2.jar:jberet-support-1.3.0.Beta6-SNAPSHOT.jar:validation-api-1.1.0.Final.jar:/Users/cfang/jberet/lib/jackson-core-2.5.4.jar:/Users/cfang/jberet/lib/jackson-databind-2.5.4.jar:/Users/cfang/jberet/lib/jackson-annotations-2.5.4.jar:/Users/cfang/dev/jsr352/test-apps/simple/target/simple-1.3.0.Beta6-SNAPSHOT.jar org.jberet.se.Main simple

            • 3. Re: Job operator is called then job exits with no log messages
              richardmoore

              I hope to get the jira done today, dealing with production issues.

              • 4. Re: Job operator is called then job exits with no log messages
                richardmoore

                I stripped my code down for testing and here is what I am getting -

                 

                package com.awginc.batch;

                import java.util.Properties;

                import javax.batch.operations.JobOperator;

                import javax.batch.runtime.BatchRuntime;

                import javax.batch.runtime.JobExecution;

                import com.awginc.batch.system.JavaBatchExecutionMonitor;

                public class JobOperatorTest {

                  public static void main(String[] args) {

                  System.out.println("Getting operator");

                  JobOperator operator = BatchRuntime.getJobOperator();

                  System.out.println("Starting operator");

                  Properties jobParameters = new Properties();

                  long jobExecutionId = operator.start("Jberet_Adhoc_SqlTest", jobParameters);

                  System.out.println(jobExecutionId);

                  JobExecution execution = operator.getJobExecution(jobExecutionId);

                  JavaBatchExecutionMonitor.getInstance().monitorToCompletion(execution);

                  System.out.println("Done");

                  }

                }

                 

                I was not getting these messages because I have the org.jboss.weld messages blocked in my log4j so I don't get all of those messages.

                 

                Exception in thread "main" java.util.ServiceConfigurationError: javax.batch.operations.JobOperator: Provider org.jberet.operations.JobOperatorImpl could not be instantiated

                  at java.util.ServiceLoader.fail(ServiceLoader.java:232)

                  at java.util.ServiceLoader.access$100(ServiceLoader.java:185)

                  at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)

                  at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)

                  at java.util.ServiceLoader$1.next(ServiceLoader.java:480)

                  at javax.batch.runtime.BatchRuntime.getJobOperator(BatchRuntime.java:57)

                  at JobOperatorTest.main(JobOperatorTest.java:13)

                Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Class<CobolToBeanMapperIface> with qualifiers @BatchProperty

                  at injection point [BackedAnnotatedField] @Inject @BatchProperty private com.awginc.batch.system.batchlet.cobol.CobolToBeanConverterBatchlet.mapper

                  at com.awginc.batch.system.batchlet.cobol.CobolToBeanConverterBatchlet.mapper(CobolToBeanConverterBatchlet.java:0)

                  at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:359)

                  at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:281)

                  at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)

                  at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:155)

                  at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:518)

                  at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)

                  at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)

                  at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)

                  at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)

                  at java.util.concurrent.FutureTask.run(FutureTask.java:266)

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

                  at java.lang.Thread.run(Thread.java:745)

                • 5. Re: Job operator is called then job exits with no log messages
                  cfang

                  @BatchProperty

                  Class<CobolToBeanMapperIface> mapperClass;

                   

                  You may have the above batch property injection.  If so, change that to:

                   

                  @BatchProperty

                  Class mapperClass;

                   

                  For batch property injection examples, see jsr352/PropertyInjectionBatchlet.java at master · jberet/jsr352 · GitHub