Bug 1008497 - CLI permits creation of mail-session with name different from JNDI name
Summary: CLI permits creation of mail-session with name different from JNDI name
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Mail
Version: 6.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: DR10
: EAP 6.4.0
Assignee: jboss-set
QA Contact: Michael Cada
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-16 13:33 UTC by Jan Blizňák
Modified: 2019-08-19 12:43 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Blizňák 2013-09-16 13:33:23 UTC
Description of problem:

CLI permits creating new mail-session with name different to jndi-name attribute's value. 
But because only jndi-name is saved in config xml, the name for mail-session cannot be restored and it is changed to the same value as jndi-name attribute after server reload/restart. This might be seen as unexpected behaviour.


Steps to Reproduce:

1. starting server with no mail-session defined gives this output:
[standalone@localhost:9999 /] /subsystem=mail:read-children-names(child-type=mail-session)
{
    "outcome" => "success",
    "result" => []
}

2. add new mail-session with name different from jndi-name value:
[standalone@localhost:9999 /] /subsystem=mail/mail-session=testMS:add(jndi-name=java:jboss/mail/testJNDI)
{"outcome" => "success"}

3. check result - name of created mail-session:
[standalone@localhost:9999 /] /subsystem=mail:read-children-names(child-type=mail-session)
{
    "outcome" => "success",
    "result" => ["testMS"]
}

4. check result - jndi-name value for created mail sesison:
[standalone@localhost:9999 /] /subsystem=mail/mail-session=testMS:read-attribute(name=jndi-name)
{
    "outcome" => "success",
    "result" => "java:jboss/mail/testJNDI"
}

5. reload/restart server
6. list created mail-sessions - different name shows up:

[standalone@localhost:9999 /] /subsystem=mail:read-children-names(child-type=mail-session)
{
    "outcome" => "success",
    "result" => ["java:jboss/mail/testJNDI"]
}

7. check if it is the mail session I want - print its jndi-name value:
[standalone@localhost:9999 /] /subsystem=mail/mail-session=java\:jboss\/mail\/testJNDI:read-attribute(name=jndi-name) 
{
    "outcome" => "success",
    "result" => "java:jboss/mail/testJNDI"
}


Actual results:
The name of mail-session node in CLI configuation is changed to jndi-name attribute's value after server reload/restart.


Expected results:

a) prohibit creating mail-session with different names for mail-session itself and for jndi-name. Then step 2 should fail.
or
b) the actual node name is also saved into config xml so that it can be restored after reload/restart


Additional info:
This can also lead to error in web management console. After step 2 try to edit any paramater of this mail-session through web console and you get error since it uses jndi-name as mail-session name in configuration address.

Comment 2 Martin Velas 2014-08-11 10:05:13 UTC
Issue is still valid for EAP 6.3.0.ER10.

The only difference came up in step 1. - starting server with no mail-session defined gives actually this output:
[standalone@localhost:9999 /] /subsystem=mail:read-children-names(child-type=mail-session)
{
    "outcome" => "success",
    "result" => ["java:jboss/mail/Default"]
}

But the invalid name changing still persists.

Comment 4 Tomaz Cerar 2014-11-06 14:04:41 UTC
This is bug that was fixed in upstream long time ago. Just needs backporting.

Comment 6 Radim Hatlapatka 2014-11-19 11:49:34 UTC
Verified with EAP 6.4.0.DR10


Note You need to log in before you can comment on or make changes to this bug.