Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1135935

Summary: Audit View fails to open logs which include a ruleflow and multibyte chars
Product: [Retired] JBoss BRMS Platform 6 Reporter: Toshiya Kobayashi <tkobayas>
Component: Eclipse ToolingAssignee: Kris Verlaenen <kverlaen>
Status: CLOSED EOL QA Contact: Tomas David <tdavid>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.2CC: alazarot, tdavid, tkobayas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
JBDS 7.1.1 org.drools.eclipse.feature_6.0.3.201406040014 Windows 7 (Japanese: Default encoding is MS932)
Last Closed: 2020-03-27 20:02:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1117954    
Bug Blocks:    
Attachments:
Description Flags
ruleflow_2_utf8.log none

Description Toshiya Kobayashi 2014-09-01 08:44:25 UTC
Description of problem:

Audit View fails to open logs which include a ruleflow and multibyte chars in the XML (e.g. property of a fact). And it throws the Exception.

So far this is only reproducibe with the combination of UTF-8 log + ruleflow + JBDS on MS932 Windows. 

====
!ENTRY org.drools.eclipse 4 120 2014-09-01 15:42:43.313
!MESSAGE Internal error in Drools Plugin:
!STACK 0
com.thoughtworks.xstream.converters.ConversionException:  : end tag name </org.drools.core.audit.event.ActivationLogEvent> must match start tag name <rule> from line 118 (position: TEXT seen ...ctHandleIds>\n    </org.drools.core.audit.event.ActivationLogEvent>... @122:54)  :  : end tag name </org.drools.core.audit.event.ActivationLogEvent> must match start tag name <rule> from line 118 (posi\
tion: TEXT seen ...ctHandleIds>\n    </org.drools.core.audit.event.ActivationLogEvent>... @122:54)
---- Debugging information ----
message             :  : end tag name </org.drools.core.audit.event.ActivationLogEvent> must match start tag name <rule> from line 118 (position: TEXT seen ...ctHandleIds>\n    </org.drools.core.audit.event.ActivationLogEvent>... @122:54)
cause-exception     : com.thoughtworks.xstream.io.StreamException
cause-message       :  : end tag name </org.drools.core.audit.event.ActivationLogEvent> must match start tag name <rule> from line 118 (position: TEXT seen ...ctHandleIds>\n    </org.drools.core.audit.event.ActivationLogEvent>... @122:54)
class               : org.drools.core.audit.event.ActivationLogEvent
required-type       : org.drools.core.audit.event.ActivationLogEvent
converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
path                : /org.drools.core.audit.WorkingMemoryLog/events/org.drools.core.audit.event.ActivationLogEvent[4]/rule
line number         : 122
class[1]            : java.util.ArrayList
converter-type[1]   : com.thoughtworks.xstream.converters.collections.CollectionConverter
class[2]            : org.drools.core.audit.WorkingMemoryLog
version             : 1.4.7
-------------------------------
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
        at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
        at com.thoughtworks.xstream.converters.collections.CollectionConverter.addCurrentElementToCollection(CollectionConverter.java:98)
        at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:91)
        at com.thoughtworks.xstream.converters.collections.CollectionConverter.populateCollection(CollectionConverter.java:85)
        at com.thoughtworks.xstream.converters.collections.CollectionConverter.unmarshal(CollectionConverter.java:80)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshallField(AbstractReflectionConverter.java:474)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:406)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
        at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
        at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1185)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1157)
        at com.thoughtworks.xstream.XStream$4.readFromStream(XStream.java:1851)
        at com.thoughtworks.xstream.core.util.CustomObjectInputStream.readObjectOverride(CustomObjectInputStream.java:120)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:344)
        at org.drools.eclipse.debug.AuditView.refresh(AuditView.java:123)
        at org.drools.eclipse.debug.AuditView.setLogFile(AuditView.java:104)
        at org.drools.eclipse.debug.actions.FileAuditDropAdapter.performDrop(FileAuditDropAdapter.java:39)
        at org.eclipse.jface.viewers.ViewerDropAdapter.drop(ViewerDropAdapter.java:276)
        at org.eclipse.swt.dnd.DNDListener.handleEvent(DNDListener.java:90)
...
Caused by: com.thoughtworks.xstream.io.StreamException:  : end tag name </org.drools.core.audit.event.ActivationLogEvent> must match start tag name <rule> from line 118 (position: TEXT seen ...ctHandleIds>\n    </org.drools.core.audit.event.ActivationLogEvent>... @122:54)
        at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
        at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
        at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:141)
        at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:118)
        at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveUp(AbstractPullReader.java:113)
        at com.thoughtworks.xstream.io.ReaderWrapper.moveUp(ReaderWrapper.java:40)
        at com.thoughtworks.xstream.io.path.PathTrackingReader.moveUp(PathTrackingReader.java:42)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:454)
        at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:257)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
        ... 68 more
Caused by: org.xmlpull.v1.XmlPullParserException: end tag name </org.drools.core.audit.event.ActivationLogEvent> must match start tag name <rule> from line 118 (position: TEXT seen ...ctHandleIds>\n    </org.drools.core.audit.event.ActivationLogEvent>... @122:54)
        at org.xmlpull.mxp1.MXParser.parseEndTag(MXParser.java:1689)
        at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1131)
        at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
        at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
        ... 77 more
====

Steps to Reproduce:

1. Open "Audit" View
2. Copy the attached ruleflow_2_utf8.log to your JBDS project
3. Drag&Drop ruleflow_1_ascii.log to the "Audit" View (Openning the log via "Open Log" button has the same result)

Actual results:

"Audit" View has no effect.

java.util.EmptyStackException is logged in ${WORKSPACE}/.metadata/.log 

Expected results:

"Audit" View opens the log.


Additional info:

It can be worked around this issue by setting -Dfile.encoding=UTF-8 for JBDS (jbdevstudio.ini). Consecutively you will hit BZ1135925 but it is out of scope of this BZ.

Comment 1 Toshiya Kobayashi 2014-09-01 08:48:57 UTC
Sorry, above "Steps to Reproduce" is wrong. The correct one is:

=================
Steps to Reproduce:

1. Open "Audit" View
2. Copy the attached ruleflow_2_utf8.log to your JBDS project
3. Drag&Drop ruleflow_2_utf8.log to the "Audit" View (Openning the log via "Open Log" button has the same result)

Actual results:

"Audit" View displays "The selected audit log is empty."

com.thoughtworks.xstream.converters.ConversionException is logged in ${WORKSPACE}/.metadata/.log 

Expected results:

"Audit" View opens the log.
=================

Comment 2 Toshiya Kobayashi 2014-09-01 08:49:39 UTC
Created attachment 933280 [details]
ruleflow_2_utf8.log

Comment 3 Tomas David 2014-10-03 13:32:59 UTC
Cannot get ConversionException probably because I do not test on MS932 Windows, but I get EmptyStackException on 6.1.0.Final release.

Comment 4 Toshiya Kobayashi 2014-10-05 13:02:28 UTC
(In reply to Tomas David from comment #3)
> Cannot get ConversionException probably because I do not test on MS932
> Windows, but I get EmptyStackException on 6.1.0.Final release.

Yes, this BZ is only targeting MS932 environment.

I filed BZ1135925 for EmptyStackException case.

Comment 6 Kris Verlaenen 2015-01-21 17:09:47 UTC
The EmptyStackException is now fixed on master.  Unable to reproduce the XML parsing issue however (using Windows7).  Please advice on how to reproduce.  Since there seems to be a workaround, using -Dfile.encoding=UTF-8, wouldn't it be expected that the utf version of the log works, and using a different encoding might fail (however that file doesn't seem to be attached to the BZ)?

Comment 7 Toshiya Kobayashi 2015-01-23 05:41:50 UTC
Hi Kris,

As you know, users can configure encoding at multiple levels in JBDS.

1. JBDS itself (Boot with -Dfile.encoding)
2. Workspace
3. Project
4. File

This issue is raised when 1 is MS932 even if you configure UTF-8 for 2, 3 and 4. It means Audit View depends on platform encoding. I think it is usually considered as a bug (for example, text editor in JBDS has no issue).

But as it has a workaround (-Dfile.encoding=UTF-8), I lower the severiy to medium.

> Please advice on how to reproduce.  

You can reproduce the issue by booting JBDS with -Dfile.encoding=MS932. I confirmed that the issue is reproducible even with JBDS on Fedora.

Comment 8 Alessandro Lazarotti 2015-02-09 12:28:53 UTC
Kris, you said that "The EmptyStackException is now fixed on master", however is it also fixed for 6.2 community (6.1 product) ?