Created attachment 701010 [details] Test mvn project with a deployable RAR Description of problem: ManagedConnectionFactory#setLogWriter() passes a PrintWriter object for logging use of the connector. It is supposed to output log messages to stdout but none of the messages are observed. Steps to Reproduce: 1. Extract the attachment 'logwritertest.zip' which is a maven project with a deployable RAR file. 2. Deploy './target/logwritertest-0.1.rar'. 3. While the deployment, EAP sets a PrintWriter wrapping System.out via ManagedConnectionFactory#setLogWriter(). And the test connection factory should output message "*** Logging via PrintWriter ***" through it, as the code written like this. ./src/main/java/com/redhat/gss/logwritertest/AcmeManagedConnectionFactory.java -- public void setLogWriter(PrintWriter out) throws ResourceException { out.println("*** Logging via PrintWriter ***"); ... } -- Actual results: The message doesn't observed. -- 17:36:15,668 INFO [org.jboss.as.osgi] (MSC service thread 1-1) JBAS011907: Register module: Module "deployment.logwritertest-0.1.rar:main" from Service Module Loader 17:36:15,695 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-4) JBAS010406: Registered connection factory java:/eis/AcmeConnectionFactory 1 -- Expected results: The message has been observed. -- 17:39:01,726 INFO [org.jboss.as.osgi] (MSC service thread 1-3) JBAS011907: Register module: Module "deployment.logwritertest-0.1.rar:main" from Service Module Loader 17:39:01,750 INFO [stdout] (MSC service thread 1-1) *** Logging via PrintWriter *** 17:39:01,751 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-1) JBAS010406: Registered connection factory java:/eis/AcmeConnectionFactory -- Additional info: AS7-6587 [1] is going to revise the JCA logging system. And there is a proposed fix of AbstractResourceAdapterDeploymentService.java, which enables auto-flushing of the PrintWriter. I confirmed with a custom build with this change fixes the problem. [1] https://issues.jboss.org/browse/AS7-6587
Sent a pull request to the upstream/master. https://github.com/wildfly/wildfly/pull/4729
Sent pull requests to the EAP repository. 6.x: https://github.com/jbossas/jboss-eap/pull/219 6.1.x: https://github.com/jbossas/jboss-eap/pull/220
jaikiran pai <jpai> made a comment on jira WFLY-1630 Marking as resolved since the PR has been merged upstream.
Verified on EAP 6.1.1.ER3
Slightly modified the Doc Text.