A IOException is got when tracing the cimxml:
java.io.IOException: Stream Closed
at java.io.FileOutputStream.write(FileOutputStream.java:316)
at org.sblim.cimclient.internal.wbem.WBEMClientCIMXML.transmitRequestWorker(WBEMClientCIMXML.java:1909)
at org.sblim.cimclient.internal.wbem.WBEMClientCIMXML.transmitRequest(WBEMClientCIMXML.java:1814)
at org.sblim.cimclient.internal.wbem.WBEMClientCIMXML.getClass(WBEMClientCIMXML.java:1262)
The cause is that:the cimxml trace stream is closed by one client, but other clients still use this steam to trace.
Currently, WBEMClient.close() closes the iCimXmlTraceFile IF AND ONLY IF it opens the stream. This leaves LogAndTraceBroker.getXmlTraceStream() returning a non-null value to other clients because LogAndTraceBroker is a static instance, and exceptions then occur when other clients attempt to trace XML.
The close() method should at the very least LogAndTraceBroker.setXmlTraceStream(null) before closing iCimXmlTraceFile to avoid the exceptions.
I will endeavor to look for a better solution.
I am out of the office until 07/22/2013.
For CME-CIM technical issues contact Prashant Bhosale or Tom Phelan
Or contact my manager: Carmen Blackley
I will not have access to Notes during my absence
Note: This is an automated response to your message "[sblim:bugs] #2651
IOException when tracing the cimxml" sent on 07/18/2013 12:17:46.
This is the only notification you will receive while this person is away.
I have a few ideas that DON'T involve making LogAndTraceBroker non-static, but need to discuss how you are using XML tracing. Please contact me via Sametime.
Proposed patch keeps track of a trace file, if opened, and closes it when the last WBEMClient instance is closed
The underlying problem is that LogAndTraceBroker is static, so there is only one CIM-XML trace file allowed per JRE. So, no matter how many WBEMClients are tracing, when the first one exits, it will close the file which leads to an IOException the next time another WBEMClient attempts to log its trace.
The best solution would be to have each WBEMClient have its own LogAndTraceBroker, but that would be a very sizable change AND could lead to other issues ("Some platforms, in particular, allow a file to be opened for writing by only one FileOutputStream (or other file-writing object) at a time"). This solution just changes the WBEMClient.iCimXmlTraceFile field to static and closes it when the last WBEMClient instance is closed.
Patch sent for community review. During a 2 week period any exploiter may comment on the patch, request changes or turn it down completely (with good reason). For the time being the patch is part of the "Experimental" branch in CVS.
From Samuel:
I check the code again, i found that the synchronized is using the object as a lock
so this works well for multi-thread per WBEMClient object case
but i'm not sure whether it works for multi-thread of multi WBEMClient object case
moving the OutputStream to LogAndTraceBroker should work
Patch backed out, community review over
Second proposed patch moves logic into LogAndTraceBroker initialization
Third proposed patch doesn't do anything in LogAndTraceBroker unless sblim.wbem.cimxmlTracing=true
Fourth proposed patch is same as third except initXmlTraceFile logic is enclosed within try block to catch any exceptions during initialization, such as this
Patch sent for community review. During a 2 week period any exploiter may comment on the patch, request changes or turn it down completely (with good reason). For the time being the patch is part of the "Experimental" branch in CVS.
The community review is completed and we received no substantial criticism. Therefore the patch has been approved and merged into the "HEAD" branch. The next release will pick it up.
I will be out of the office starting 08/20/2013 and will not return until
08/26/2013.
Please contact below in my absence.
CIMP - Dinesh R Putchala
Any MCP defects for SFCB - Vipin Nair
Any CPS defects for CIMP - Dinesh R Putchala / Basabjit Sengupta
For any other urgent issues, contact my manager Ravindra S Rao
The patch was picked up by release 2.2.4 and will be closed.