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

Bug 915279

Summary: torquebox_eap_overlay.rb produces invalid standalone.xml files when run on Windows with JRuby 1.7.2
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Oliver Kišš <okiss>
Component: TorqueBoxAssignee: Ben Browning <bbrownin>
Status: CLOSED CURRENTRELEASE QA Contact: Karel Piwko <kpiwko>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 2.2.0CC: kpiwko, mnovotny, oskutka
Target Milestone: ER1   
Target Release: 2.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-28 14:02:02 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:
Attachments:
Description Flags
Resulting EAP standalone-full.xml file none

Description Oliver Kišš 2013-02-25 11:22:31 UTC
Description of problem:
torquebox_eap_overlay.rb produces invalid standalone.xml files when run on Windows with JRuby 1.7.2. This worked fine with JRuby 1.7.0.

REXML used in torquebox_eap_overlay.rb incorrectly processes lines ending on "<!--" (default EAP 6.0.1 configuration files contain lines like this). This causes that resulting standalone-*.xml files contain doubled comment opening tags.

The bug is probably related https://bugs.ruby-lang.org/issues/7764#change-35785

Version-Release number of selected component (if applicable):
Torquebox 2.3.0.redhat.1, WFK 2.2.0-DR2
JRuby 1.7.2
EAP 6.0.1

Steps to Reproduce:
1. Run torquebox_eap_overlay.rb on EAP whose standalone-*.xml files contain some lines ending on "<!--".

Expected results:
Resulting standalone-*.xml files are valid

Actual results
Resulting standalone-*.xml files contain doubled comment opening tags

Comment 1 Karel Piwko 2013-02-25 16:10:43 UTC
Marking as urgent.

Comment 2 Karel Piwko 2013-02-25 16:11:18 UTC
Oliver, is that still present with ER1?

Comment 3 Ben Browning 2013-02-25 17:06:29 UTC
It's possible this may get fixed by updating to JRuby 1.7.3. If not then we'll try to find a workaround - building the community version of TorqueBox on Windows is broken by this same issue.

Comment 4 Ben Browning 2013-02-25 23:37:56 UTC
I tested a very simplified version of what torquebox_eap_overlay.rb does against JRuby 1.7.3 on Windows and the issue appears fixed.

Administrator@IP-0A768BFA ~/tmp
$ jruby -v
jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) 64-Bit Server VM 1.6.0_24-b07 [Windows Server 2008 R2-amd64]
Administrator@IP-0A768BFA ~/tmp
$ jruby rexml_broken_comments.rb
Administrator@IP-0A768BFA ~/tmp
$ cat output.xml
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns='urn:jboss:domain:1.4'>
  <foo>
    <!--
    <!--default for -->
    <!--
    <!--
      ~ some comment
      ~ and another line of comm-->
    <bar/>
    <baz something='other'/>
  </foo>
  <!--
    <!--
      ~ some comment
      ~ and another line of comm-->
</server>


Administrator@IP-0A768BFA ~/tmp
$ jruby -v
jruby 1.7.3 (1.9.3p385) 2013-02-21 dac429b on Java HotSpot(TM) 64-Bit Server VM 1.6.0_24-b07 [Windows Server 2008 R2-amd64]
Administrator@IP-0A768BFA ~/tmp
$ jruby rexml_broken_comments.rb
Administrator@IP-0A768BFA ~/tmp
$ cat output.xml
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns='urn:jboss:domain:1.4'>
  <foo>
    <!--default for catch all-->
    <!--
      ~ some comment
      ~ and another line of comments
    -->
    <bar/>
    <baz something='other'/>
  </foo>
  <!--
      ~ some comment
      ~ and another line of comments
    -->
</server>


As you can see, under JRuby 1.7.3 the output does not get messed up by the comment characters in the test input I'm passing REXML.

Comment 5 Karel Piwko 2013-02-26 11:36:45 UTC
Ben, QE updated to 1.7.3. Let's see if that can still be reproducible.

Comment 6 Karel Piwko 2013-02-28 14:02:02 UTC
Verified with JRuby 1.7.3 on W2008. 
I'm closing the issue as CLOSED CURRENTRELEASE as nobody else had a chance to experience this behavior.

Comment 7 Karel Piwko 2013-02-28 14:03:49 UTC
Created attachment 703903 [details]
Resulting EAP standalone-full.xml file

Attaching result of standalone-full.xml.