Uploaded image for project: 'WINDUPRULE - Red Hat Application Migration Toolkit rules'
  1. WINDUPRULE - Red Hat Application Migration Toolkit rules
  2. WINDUPRULE-109

The rule for CMP entity EJBs doesn't catch ejb-jar.xml

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.5.0.Final
    • 2.5.0.CR1
    • EAP6 -> EAP7
    • None

      Running Windup 2.5.0.CR1 against the application attached in WINDUP-881, like this:

      ./windup-distribution-2.5.0.CR1/bin/windup --batchMode --input cmp-test.jar --output ./migration-report --source eap --target eap7
      

      The Migration Issues report contains two entries for CMP Entity EJB (BookLocalHome, BookEntityBean), but it doesn't contain an entry for the ejb-jar.xml. It should.

      I believe that the cause is the <xmlfile> condition in the rule eap6-xml-01000 in windup-distribution-2.5.0.CR1/rules/migration-core/eap7/eap6/eap6-xml.windup.xml. It reads

                      <xmlfile matches="/ejb-jar/enterprise-beans/entity[persistence-type = 'Container'] | /jee:ejb-jar/jee:enterprise-beans/jee:entity[jee:persistence-type = 'Container'] | /j2e:ejb-jar/j2e:enterprise-beans/j2e:entity[j2e:persistence-type = 'Container'] | /jcp:ejb-jar/jcp:enterprise-beans/jcp:entity[jcp:persistence-type = 'Container']" in="ejb-jar.xml">
                          <namespace prefix="j2e" uri="http://java.sun.com/xml/ns/j2ee"/>
                          <namespace prefix="jee" uri="http://java.sun.com/xml/ns/javaee"/>
                          <namespace prefix="jcp" uri="http://xmlns.jcp.org/xml/ns/javaee"/>
                      </xmlfile>
      

      I tried to change the condition to this:

                      <xmlfile matches="/jee:ejb-jar/jee:enterprise-beans/jee:entity[jee:persistence-type = 'Container']" in="ejb-jar.xml">
                          <namespace prefix="jee" uri="http://java.sun.com/xml/ns/javaee"/>
                      </xmlfile>
      

      And it works just fine. I don't really know what's wrong with the original, though; just that it's wrong. Note that what I did is not a proper fix; just a simplification to prove that there's an error.

              mbriskar_jira Matej Briskar (Inactive)
              lthon@redhat.com Ladislav Thon
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: