Bug 1255404 - Cannot open persistence.xml if transaction-type attribute not present
Cannot open persistence.xml if transaction-type attribute not present
Status: VERIFIED
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Data Modeler (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity low
: ER4
: 6.2.0
Assigned To: Walter Medvedeo
Jiri Locker
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-20 09:41 EDT by Jiri Locker
Modified: 2015-10-22 05:54 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Exception stack trace from server.log (1.48 KB, text/plain)
2015-08-20 11:07 EDT, Jiri Locker
no flags Details

  None (edit)
Description Jiri Locker 2015-08-20 09:41:24 EDT
Description of problem:
The transaction-type attribute is optional so Persistence Descriptor editor shouldn't fail to open persistence.xml where persistence-unit element does not have that attribute.

Version-Release number of selected component (if applicable):
6.2.0.ER1
Comment 1 Jiri Locker 2015-08-20 11:07:17 EDT
Created attachment 1065297 [details]
Exception stack trace from server.log
Comment 2 Jiri Locker 2015-08-20 11:12:45 EDT
It is caused by the fact that element.getAttribute() on line 64 returns empty String, not null, if the attribute doesn't exists, and so the null check on line 65 doesn't avoid the attempt to convert the empty String to enum value.

https://github.com/droolsjbpm/kie-wb-common/blob/4b92a5b692c91f73e667a2adbeacb1d4ae325117/kie-wb-common-screens/kie-wb-common-data-modeller/kie-wb-common-data-modeller-api/src/main/java/org/kie/workbench/common/screens/datamodeller/util/DOM2PersistenceDescriptorVisitor.java#L64

Note You need to log in before you can comment on or make changes to this bug.