-
Bug
-
Resolution: Done
-
Major
-
None
-
None
I haveĀ a long string value that I want to persist the XML configuration like:
<test> <x>Long string value that does not fit as attribute</x> <x>The element value should be more appropriate.</x> </test>
So I tried with
AttributeDefinition ad = SimpleAttributeDefinitionBuilder.create("x", ModelType.STRING).build(); SimpleListAttributeDefinition attributeDefinition = SimpleListAttributeDefinition.Builder.of("test", ad).build();
then I got:
java.lang.UnsupportedOperationException: WFLYCTL0284: Could not marshal attribute as attribute: test at org.jboss.as.controller.AttributeMarshaller.marshallAsAttribute(AttributeMarshaller.java:79) at org.jboss.as.controller.AttributeMarshaller.marshall(AttributeMarshaller.java:95)
Looking inside of the SimpleListAttributeDefinition, I see it uses AttributeMarshallers.SimpleListAttributeMarshaller internally which implements only marshallAsElement method, but leaving isMarshallableAsElement un-implemented which returns false by default.