Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-6594

CustomHandler support for property arrays

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Logging
    • None

      The CustomHandler doesn't seem to understand properties that are arrays or var-args.  I'm testing with the MailHandler included with AngusMail:

      Overloaded method setAuthenticator(Authenticator) and setAuthenticator(char[]) results in:

      21:55:35,845 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("write-attribute") failed - address: ([ ("subsystem" => "logging"), ("custom-handler" => "MAIL") ]): java.lang.IllegalArgumentException: Unknown parameter type for property authenticator on class org.eclipse.angus.mail.util.logging.MailHandler at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.getValue(LogContextConfigurationImpl.java:465)  at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$1.lambda$validate$0(AbstractPropertyConfiguration.java:213)  at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.WrappedAction.execute(WrappedAction.java:47)  at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$1.validate(AbstractPropertyConfiguration.java:208)  at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$1.validate(AbstractPropertyConfiguration.java:203)  at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:336)  at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:289)  at org.jboss.as.logging@21.1.1.Final//org.jboss.as.logging.logmanager.ConfigurationPersistence.prepare(ConfigurationPersistence.java:299)  at org.jboss.as.logging@21.1.1.Final//org.jboss.as.logging.LoggingOperations$CommitOperationStepHandler.lambda$execute$0(LoggingOperations.java:131)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:1064)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:785)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:476)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1455)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:449)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.lambda$executeForResponse$0(ModelControllerImpl.java:259)  at org.wildfly.security.elytron-base@2.2.1.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:304)  at org.wildfly.security.elytron-base@2.2.1.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:270)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.executeForResponse(ModelControllerImpl.java:259)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.executeOperation(ModelControllerImpl.java:253)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:236)  at org.jboss.as.domain-http-interface@21.1.1.Final//org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:213)  at io.undertow.core@2.3.7.Final//io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)  at org.jboss.as.domain-http-interface@21.1.1.Final//org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:91)  at org.jboss.as.domain-http-interface@21.1.1.Final//org.jboss.as.domain.http.server.security.ElytronIdentityHandler.lambda$handleRequest$0(ElytronIdentityHandler.java:62)  at org.wildfly.security.elytron-base@2.2.1.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:328)  at org.wildfly.security.elytron-base@2.2.1.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:285)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)  at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)  at org.jboss.as.domain-http-interface@21.1.1.Final//org.jboss.as.domain.http.server.security.ElytronIdentityHandler.handleRequest(ElytronIdentityHandler.java:61)  at io.undertow.core@2.3.7.Final//io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)  at io.undertow.core@2.3.7.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)  at io.undertow.core@2.3.7.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)  at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)  at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)  at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)  at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1348)  at java.base/java.lang.Thread.run(Thread.java:833) at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)  

      I would expect this to bind to the setAuthenticator(char[]) and convert the string to a char[].

       

      Testing overloaded method setAttachmentNames(String[]) and setAttachmentNames(Formatter[])

      20:42:39,658 ERROR [org.jboss.as.controller.management-operation] (External Management Request Threads -- 1) WFLYCTL0013: Operation ("write-attribute") failed - address: ([
          ("subsystem" => "logging"),
          ("custom-handler" => "MAIL")
      ]): java.lang.IllegalArgumentException: Unknown parameter type for property attachmentNames on class org.eclipse.angus.mail.util.logging.MailHandler
      	at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.getValue(LogContextConfigurationImpl.java:465)
      	at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$1.lambda$validate$0(AbstractPropertyConfiguration.java:213)
      	at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.WrappedAction.execute(WrappedAction.java:47)
      	at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$1.validate(AbstractPropertyConfiguration.java:208)
      	at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.AbstractPropertyConfiguration$1.validate(AbstractPropertyConfiguration.java:203)
      	at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.doPrepare(LogContextConfigurationImpl.java:336)
      	at org.jboss.logmanager@2.1.19.Final//org.jboss.logmanager.config.LogContextConfigurationImpl.prepare(LogContextConfigurationImpl.java:289)
      	at org.jboss.as.logging@21.1.1.Final//org.jboss.as.logging.logmanager.ConfigurationPersistence.prepare(ConfigurationPersistence.java:299)
      	at org.jboss.as.logging@21.1.1.Final//org.jboss.as.logging.LoggingOperations$CommitOperationStepHandler.lambda$execute$0(LoggingOperations.java:131)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:1064)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:785)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:476)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1455)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:449)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.lambda$executeForResponse$0(ModelControllerImpl.java:259)
      	at org.wildfly.security.elytron-base@2.2.1.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:304)
      	at org.wildfly.security.elytron-base@2.2.1.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:270)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.executeForResponse(ModelControllerImpl.java:259)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.executeOperation(ModelControllerImpl.java:253)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:236)
      	at org.jboss.as.domain-http-interface@21.1.1.Final//org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:213)
      	at io.undertow.core@2.3.7.Final//io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
      	at org.jboss.as.domain-http-interface@21.1.1.Final//org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:91)
      	at org.jboss.as.domain-http-interface@21.1.1.Final//org.jboss.as.domain.http.server.security.ElytronIdentityHandler.lambda$handleRequest$0(ElytronIdentityHandler.java:62)
      	at org.wildfly.security.elytron-base@2.2.1.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:328)
      	at org.wildfly.security.elytron-base@2.2.1.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:285)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)
      	at org.jboss.as.controller@21.1.1.Final//org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)
      	at org.jboss.as.domain-http-interface@21.1.1.Final//org.jboss.as.domain.http.server.security.ElytronIdentityHandler.handleRequest(ElytronIdentityHandler.java:61)
      	at io.undertow.core@2.3.7.Final//io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)
      	at io.undertow.core@2.3.7.Final//io.undertow.server.Connectors.executeRootHandler(Connectors.java:393)
      	at io.undertow.core@2.3.7.Final//io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:859)
      	at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
      	at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at java.base/java.lang.Thread.run(Thread.java:833)
      	at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513) 

      I would expect CustomFormatter to call Formatter[] version if any token matched a custom formatter otherwise call the String[] version.

       

      The current MailHandler uses char[], Formatter[], String[]. and Filter[].

              jperkins-rhn James Perkins
              jason.mehrens Jason Mehrens (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: