Can I edit the xsd schema file in JBoss EAP 7?
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.x
Issue
- Can I edit the xsd schema file in JBoss EAP 7?
- Does editing the schema file makes any difference in JBoss EAP 7?
Resolution
Although not recommended, one could edit the schema file in JBoss EAP 7/Data Grid 7/RHSSO 7 adding or removing attributes.
However the change will be only minimal and wouldn't play much a difference since the subsystem underneath does not use the new attribute and it won't recognize it.
Example:
Go to $JBOSS_HOME/docs/schema/jboss-as-infinispan_12_0.xsd
used to validate the infinispan subsystem. Let's add an random attribute banana below the complex type state-transfer
called example:
<xs:attribute name="example" type="xs:long" default="240000">
<xs:annotation>
<xs:documentation>
example
</xs:documentation>
</xs:annotation>
</xs:attribute>
-
Adding the property
example
instate-transfer
element in thestandalone-ha.xml
for testing:<distributed-cache name="offlineSessions" owners="1"> <expiration lifespan="900000000000000000"/> <state-transfer example="0"/> </distributed-cache>
-
Let's start JBoss EAP with this property:
OPVDX001: Validation error in standalone-ha.xml | | 373: <distributed-cache name="offlineSessions" owners="1"> | 374: <expiration lifespan="900000000000000000"/> | 375: <state-transfer example="0"/> | ^^^^ 'example' isn't an allowed attribute for the 'state-transfer' element | | Attributes allowed here are: example, chunk-size, timeout | | 376: </distributed-cache> | 377: <distributed-cache name="clientSessions" owners="1"> | 378: <expiration lifespan="900000000000000000"/> | | 'example' is allowed on elements: | - server > profile > {urn:jboss:domain:infinispan:12.0}subsystem > cache-container > replicated-cache > state-transfer | - server > profile > {urn:jboss:domain:infinispan:12.0}subsystem > cache-container > distributed-cache > state-transfer | - server > profile > {urn:jboss:domain:infinispan:12.0}subsystem > cache-container > scattered-cache > state-transfer | | | The primary underlying error message was: | > ParseError at [row,col]:[375,21] | > Message: WFLYCTL0197: Unexpected attribute 'banana' encountered
So it is pointless changing the definition.
Also not the validation cannot be skipped and who is responsible the validation is ApplicationClientConfigurationPersister.java
, via the method load, which has a filepath.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments