Bug 910282

Summary: Unable to change attributes of Mail session through cli
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Jakub Cechacek <jcechace>
Component: ServerAssignee: Tomaz Cerar <tcerar>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: brian.stansberry, jkudrnac, rhatlapa, rsvoboda, tcerar
Target Milestone: ER2   
Target Release: EAP 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:

Description Jakub Cechacek 2013-02-12 09:13:49 UTC
Description of problem:

Any attempt to change Mail session after it was created fails

Steps to Reproduce: In jboss-cli
1. Create new session 
/subsystem=mail/mail-session=mysession/:add(jndi-name="java:/musession")

result:
{"outcome" => "success"}

2. Check created resource
/subsystem=mail/mail-session=mysession/:read-resource

result:
{
    "outcome" => "success",
    "result" => {
        "custom" => undefined,
        "debug" => false,
        "from" => undefined,
        "jndi-name" => "java:/mysession",
        "server" => undefined
    }
}

3. Try to change some attribute (e.g. jndi)
/subsystem=mail/mail-session=mysession/:write-attribute(name=jndi-name,value="java:/mailsession")

result:
{
    "outcome" => "failed",
    "failure-description" => "JBAS014749: Operation handler failed: null",
    "rolled-back" => true
}

  
expected result:

{
    "outcome" => "success",
    "response-headers" => {
        "operation-requires-reload" => true,
        "process-state" => "reload-required"
    }
}

Additional:

The debug attribute can be changed exactly once and only to true. Once it is turned on it cannot be changed again like the rest.

Comment 1 Jakub Cechacek 2013-02-13 09:13:19 UTC
Adding Heiko to cc, as this is obviously affecting admin console too. So just to let him know.

Comment 2 Heiko Braun 2013-02-13 12:49:24 UTC
Thanks, I'll keep an eye on it

Comment 3 Heiko Braun 2013-02-13 13:09:18 UTC
confirmed, we get the same results in the web interface:

[Server:server-one] 14:08:18,506 ERROR [org.jboss.as.controller.management-operation] (host-controller-connection-threads - 1) JBAS014612: Operation ("write-attribute") failed - address: ([
[Server:server-one]     ("subsystem" => "mail"),
[Server:server-one]     ("mail-session" => "java:/testMail")
[Server:server-one] ]): java.lang.NullPointerException
[Server:server-one] 	at org.jboss.as.mail.extension.MailSessionDefinition$SessionAttributeWriteHandler.applyUpdateToRuntime(MailSessionDefinition.java:94)
[Server:server-one] 	at org.jboss.as.controller.AbstractWriteAttributeHandler$1.execute(AbstractWriteAttributeHandler.java:131) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
[Server:server-one] 	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:440) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
[Server:server-one] 	at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:322) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
[Server:server-one] 	at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:229) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
[Server:server-one] 	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:224) [jboss-as-controller-8.0.0.Alpha1-SNAPSHOT.jar:8.0.0.Alpha1-SNAPSHOT]
[Server:server-one] 	at org.jboss.as.controller.ModelControllerImpl.internalExecut

Comment 4 Tomaz Cerar 2013-02-26 11:30:03 UTC
Pull request to fix this was sent.

Comment 6 Tomaz Cerar 2013-03-05 10:01:48 UTC
*** Bug 915307 has been marked as a duplicate of this bug. ***

Comment 7 Jakub Cechacek 2013-03-05 11:02:53 UTC
Verified 6.1.ER1

Comment 8 Jakub Cechacek 2013-03-05 11:18:37 UTC
Sorry my mistake, this is still not verified. 

For 6.1.ER1 operation still results in 

 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 3) JBAS014612: Operation ("write-attribute") failed - address: ([
    ("subsystem" => "mail"),
    ("mail-session" => "mysession")
]): java.lang.NullPointerException  

http://pastebin.test.redhat.com/130820

Comment 9 Tomaz Cerar 2013-03-05 11:20:23 UTC
This looks like the patch was not applied.
in stacktrace there is SessionAttributeWriteHandler which was removed as part of the fix.

Comment 10 Brian Stansberry 2013-03-05 16:38:36 UTC
Looks like this was prematurely moved to ON_QA. The patch is merged to the jboss-eap repo on github, which makes it MODIFIED, not ON_QA. It's not in the ER1 build.

Comment 12 Radim Hatlapatka 2013-03-07 08:47:15 UTC
Verified against EAP 6.1.0 ER2