Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-6252

mail subsystem cannot be created from scratch with the CLI

XMLWordPrintable

    • Hide

      using standard "standalone.xml"

      /subsystem=mail:remove
      => success

      /subsystem=mail:add
      => JBAS014677: Failed to persist configuration change: JBAS014675: Failed to marshal configuration

      The reason:

      mail/src/main/java/org/jboss/as/mail/extension/MailSubsystemParser.java

      public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {

      context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
      ModelNode model = context.getModelNode();
      List<Property> sessions = model.get(MAIL_SESSION).asPropertyList();

      => the code assumes there will always be (at least) one mail session.

      Correct code should test with: model.hasDefined(MAIL_SESSION)

      Show
      using standard "standalone.xml" /subsystem=mail:remove => success /subsystem=mail:add => JBAS014677: Failed to persist configuration change: JBAS014675: Failed to marshal configuration The reason: mail/src/main/java/org/jboss/as/mail/extension/MailSubsystemParser.java public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException { context.startSubsystemElement(Namespace.CURRENT.getUriString(), false); ModelNode model = context.getModelNode(); List<Property> sessions = model.get(MAIL_SESSION).asPropertyList(); => the code assumes there will always be (at least) one mail session. Correct code should test with: model.hasDefined(MAIL_SESSION)
    • Workaround Exists
    • Hide

      edit the xml manually

      Show
      edit the xml manually

      /subsystem=mail:add

      fails with:

      JBAS014677: Failed to persist configuration change: JBAS014675: Failed to marshal configuration

              tfonteyn Tom Fonteyne (Inactive)
              tfonteyn Tom Fonteyne (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: