| Summary: | Exception when de-serializing nested Common Base Event XML fragments/documents. | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Paul Slauenwhite <paulslau> | ||||||||||||||||
| Component: | TPTP | Assignee: | Rohit Shetty <rohit.shetty> | ||||||||||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||||||||||
| Severity: | critical | ||||||||||||||||||
| Priority: | P1 | CC: | apnan, danap, grothens, jkubasta, paulslau, rohit.shetty | ||||||||||||||||
| Version: | unspecified | Keywords: | plan | ||||||||||||||||
| Target Milestone: | --- | Flags: | paulslau:
review-
|
||||||||||||||||
| Hardware: | All | ||||||||||||||||||
| OS: | All | ||||||||||||||||||
| Whiteboard: | |||||||||||||||||||
| Attachments: |
|
||||||||||||||||||
Sicne 4.5 i1 development is closed, will complete in 4.5 i2. Reassign to Project Lead for triage. Correcting target. Can you please provide a sample CBE XML that I can use to reproduce this problem. Created attachment 83228 [details]
CBE XML Files.
These files are used by the code snippet in the defect description.
Created attachment 83306 [details] Patch for bug 207763 Attaching patch. Paul, please review the attached patch. This patch is fine except: -org.eclipse.osgi.baseadaptor.bundlefile.NestedDirBundleFile cannot be used since the Common Base Event implementation currently supports a stand-alone use case and OSGi is not currently required. -We should resolve this in the non-EMF Java implementation as well. -We need to handle the same scenario where the XML fragment is embedded in the OtherSituation element. -We also need test cases for nested XML fragment in none,both,either/or of the any and OtherSituation elements. Rohit please take a look at the fix, I don't have time to spend on this defect anymore. Some of the old CBE logging test cases are failing, which means the fix has affected existing function. It's the CommonBaseEvent any element which doesn't seem to be handled correctly, see test case testEventsFromCanonicalXMLDoc_String at step 2A, count ==11. Thanks. Created attachment 83712 [details]
Consolidated patch
Consolidated patch that fixes the problem described by Alex and has the fix for Bugzilla 207806.
Created attachment 83713 [details]
Updated test cases
Updated/Consolidated test cases which includes tests for 207806
Alex, Can you please have a look at this consolidated patch. Created attachment 84055 [details]
Updated tests - With CBE verification
(In reply to comment #8) > This patch is fine except: > > -org.eclipse.osgi.baseadaptor.bundlefile.NestedDirBundleFile cannot be used > since the Common Base Event implementation currently supports a stand-alone use > case and OSGi is not currently required. > > -We should resolve this in the non-EMF Java implementation as well. > > -We need to handle the same scenario where the XML fragment is embedded in the > OtherSituation element. > > -We also need test cases for nested XML fragment in none,both,either/or of the > any and OtherSituation elements. > Alex/Rohit, can you confirm if these have been addressed? Yes, they have been. We are still waiting from an answer from Websphere, I don't know yet if they need the fix in 4.4.1 or not. If I'm not getting an answer soon I will retarget the defect to 4.5. Alex, I have just spoken with the consuming product. They would like a patch provided for 4.2.1. So, would you please have a patch created for 4.2.x and 4.3.x and then request approval for this fix to be included in 4.4.1? The 4.2.1 patch is urgently needed (ie in the next day or two). We have a 4.4.1 patch which was tested. I need to port it to 4.2.1. Since the problem they have is on 4.2.1 I think a 4.2.1 patch would be sufficient. Not sure if I need to ask for 4.4.1 approval, I have asked last week and approval was denied. Created attachment 84635 [details]
4.2.1 patch for 207763 and 207806
Attaching consolidated patch for 207763 and 207806 ported to 4.2.1.
Please check patch for 4.5 into head and resolve this defect as fixed. PMC approval not granted for 4.4.1 Joanna, I am retargettting the defect to 4.5 i5 and checking in the fix in i5. This fix is not neccessarily needed in the M4 driver. Do you agree? Agree. Target updated. Fix checked in. Did this fix make it into I5? The enclosed test class using the attached CBE XML files is still throwing exceptions. Created attachment 89498 [details]
Bugzilla_207763_Test.java
It looks like I forgot to check in the patch. Patch checked in. WPS/WAS are seeing the problem under TPTP 4.2.1 Verified in TPTP-4.5.0-200806070100. Closing. |
Exception when de-serializing nested Common Base Event XML fragments/documents. When de-serializing nested Common Base Event XML fragments/documents from the any element, a NullPointerException is thrown: System.out.println("Reading the 1st CBE."); FileInputStream is1 = new FileInputStream(new File(OUTER_CBE)); CommonBaseEvent[] cbes1 = EventFormatter.eventsFromCanonicalXMLDoc(is1); System.out.println("Reading the 2nd CBE."); FileInputStream is2 = new FileInputStream(new File(OUTER_CBE)); CommonBaseEvent[] cbes2 = EventFormatter.eventsFromCanonicalXMLDoc(is2); CommonBaseEvent containing = cbes1[0]; String nestedElement = "<diag:diagnosticInformation xmlns:diag=\"http://www.ibm.com/xmlns/prod/websphere/monitoring/6.1.0/diagnosticInformation\">" + EventFormatter.toCanonicalXMLDocString(cbes2).substring(38) + // 38 characters removes the superfluous "<?xml version="1.0" encoding="UTF-8"?>" "\n</diag:diagnosticInformation>"; System.out.println("#####NESTED_ELEMENT\n" + nestedElement + "\n\n"); System.out.println("#####CONTAINING BEFORE NEST\n" + EventFormatter.toCanonicalXMLDocString(containing) + "\n\n"); containing.addAny(nestedElement); String containingAsString = EventFormatter.toCanonicalXMLDocString(containing); System.out.println("#####CONTAINING AFTER NEST\n" + EventFormatter.toCanonicalXMLDocString(containing) + "\n\n"); try { System.out.println("Reading the nested CBE using event formatter."); ByteArrayInputStream nestedStream = new ByteArrayInputStream(containingAsString.getBytes("UTF-8")); CommonBaseEvent[] nestedCBEs = EventFormatter.eventsFromCanonicalXMLDoc(nestedStream); System.out.println("#####CONTAINING CBE USING EVENT FORMATTER\n" + EventFormatter.toCanonicalXMLDocString(nestedCBEs) + "\n\n"); } catch (Exception e) { System.err.println("ERROR USING EVENT FORMATTER!!!!!! " + e.toString()); e.printStackTrace(); }