Open tcesenthil opened 7 years ago
Are you using a java.uitl.logging.Logger
in your reader/writer/processor?
@jamezp yes
i have also tried using System.out.println() within my Reader/Writer/Processor/Listeners. Even those messages are not getting printed.
There shouldn't be anything consuming stdout or reconfiguring logging in JBeret itself. The JBeret test suite itself uses logging and writes to stdout with no issues.
What does your logging.properties look like? What kind of other dependencies do you have in your project?
my logging.properties has the following content
.level=INFO
handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=%4$s: %3$s %5$s%n
my pom.xml dependencies are as follows
<dependencies>
<dependency>
<groupId>com.ibm</groupId>
<artifactId>jzos</artifactId>
<version>1</version>
<!-- <scope>runtime</scope> -->
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.188</version>
</dependency>
<dependency>
<groupId>javax.batch</groupId>
<artifactId>javax.batch-api</artifactId>
<version>1.0.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.transaction</groupId>
<artifactId>jta</artifactId>
<version>1.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jberet</groupId>
<artifactId>jberet-se</artifactId>
<version>${jberet.version}</version>
</dependency>
<dependency>
<groupId>org.jberet</groupId>
<artifactId>jberet-support</artifactId>
<version>${jberet.version}</version>
</dependency>
<dependency>
<groupId>org.jboss.marshalling</groupId>
<artifactId>jboss-marshalling</artifactId>
<version>2.0.0.Beta2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss.weld.se</groupId>
<artifactId>weld-se</artifactId>
<version>2.2.15.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.wildfly.security</groupId>
<artifactId>wildfly-security-manager</artifactId>
<version>1.1.2.Final</version>
<scope>runtime</scope>
</dependency>
</dependencies>
I don't see anything obviously wrong here. I'm working on a reproducer so hopefully soonish I'll be able to have a look.
It looks like maybe you're running this on zO/S. Do you see the same issue on other OS's too?
Sorry for the delay. I finally was able to get a working sample together that shows logging does seem to be working for me, https://github.com/jamezp/issue-reproducer/tree/jberet-test. If you just build the issue-reproducer/generic
and run mvn clean package && java -jar target//generic-issue-reproducer.jar
it should show the logging and some System.out
messages too.
Just as a follow up I did test this with a J9 JVM and it seemed to work for me. Below is the output.
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 8.0.5.0 - pxa6480sr5-20170905_01(SR5))
IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64 Compressed References 20170901_363591 (JIT enabled, AOT enabled)
J9VM - d56eb84
JIT - tr.open_20170901_140853_d56eb84
OMR - b033a01)
JCL - 20170823_01 based on Oracle jdk8u144-b01
jperkins@localhost ~/projects/jboss/issue-reproducer/generic (jberet-test) $ java -jar ./target/generic-issue-reproducer.jar
INFO: org.jboss.weld.Version WELD-000900: 2.4.1 (Final)
INFO: org.jboss.weld.Bootstrap WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.
INFO: org.jboss.weld.Bootstrap WELD-ENV-002003: Weld SE container STATIC_INSTANCE initialized
INFO: org.wildfly.reproducer.CountingItemReader Opened item reader
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 0
Logged from org.wildfly.reproducer.LoggingItemWriter with item 0
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 1
Logged from org.wildfly.reproducer.LoggingItemWriter with item 1
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 2
Logged from org.wildfly.reproducer.LoggingItemWriter with item 2
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 3
Logged from org.wildfly.reproducer.LoggingItemWriter with item 3
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 4
Logged from org.wildfly.reproducer.LoggingItemWriter with item 4
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 5
Logged from org.wildfly.reproducer.LoggingItemWriter with item 5
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 6
Logged from org.wildfly.reproducer.LoggingItemWriter with item 6
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 7
Logged from org.wildfly.reproducer.LoggingItemWriter with item 7
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 8
Logged from org.wildfly.reproducer.LoggingItemWriter with item 8
INFO: org.wildfly.reproducer.LoggingItemWriter Logged from org.wildfly.reproducer.LoggingItemWriter with item 9
Logged from org.wildfly.reproducer.LoggingItemWriter with item 9
INFO: org.wildfly.reproducer.CountingItemReader Closed item reader
Weld SE container STATIC_INSTANCE shut down by shutdown hook
I am trying to run a JSR352 java batch program in Java SE mode using JBERET implementation. I can see my main() method getting executed. It is in this main() method i get handle of a job operator and starting the job.
but, I do not see any log statements inside my reader, processor, writer or listeners getting printed.
I have a logging.properties defined and loaded from my projects
src/main/resources/META-INF
folder. The log statements in my main() method is getting printed according to it but, the log statements in my reader/writer/processor and listeners aren't printing at all.Why isn't my log statements (java log library) in my java batch program to be printed ?
I have also tried giving the following VM Arguments while running my java program , yet no changes
-Dorg.jboss.logging.provider=jdk -Djava.util.logging.config.file=C:\pilotJBeret\src\main\resources\META-INF\logging.properties
Here are the logs from the main() method. I can clearly see that a job has been started but, not sure why the log statements of the batch program isn't getting printed.