If you use the serializable interface to store your ConnectionFactory objects, the reference to your LogWriter is lost.
If you use a serializable interface to store your ConnectionFactory objects, when you deserialize the interface the ConnectionFactory does not contain a reference to the LogWriter. This is because LogWriters are not serializable.
DefaultConnectionManager.setLogWriter(new java.io.PrintWriter(System.err));
Connection Conn = (Connection)cxf.getConnection();
The setLogWriter method on the DefaultConnectionManager, which is supplied with the resource adapters, is a static method. The example defines that the log is set to output to the System.err. Managed environments are unaffected because the trace level applied to the ManagedConnectionFactory remains.