[jboss-jira] [JBoss JIRA] (AS7-4468) Cannot remove and re-add socket-binding group
Michael Voegele (JIRA)
jira-events at lists.jboss.org
Fri Jun 8 08:14:20 EDT 2012
[ https://issues.jboss.org/browse/AS7-4468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700115#comment-12700115 ]
Michael Voegele commented on AS7-4468:
--------------------------------------
To achieve the same (changing ports for servers), instead of removing the whole socket-binding-group, readding it again and then readding all the socket-bindings, it is possible to just use write-attribute in the following way:
{code:xml}
<dmr-operation-template id="template_socket-binding-group">
<dmr-operation-set id="socket-binding-group">
<dmr-operation name="write-attribute">
<address-element key="socket-binding-group" value="${socket-binding-group}" />
<address-element key="socket-binding" value="http" />
<json>
<![CDATA[
{
"name":"port",
"value":${socket-binding.port.http}
}
]]>
</json>
</dmr-operation>
<dmr-operation name="write-attribute">
<address-element key="socket-binding-group" value="${socket-binding-group}" />
<address-element key="socket-binding" value="https" />
<json>
<![CDATA[
{
"name":"port",
"value":${socket-binding.port.https}
}
]]>
</json>
</dmr-operation>
<dmr-operation name="write-attribute">
<address-element key="socket-binding-group" value="${socket-binding-group}" />
<address-element key="socket-binding" value="osgi-http" />
<json>
<![CDATA[
{
"name":"port",
"value":${socket-binding.port.osgi-http}
}
]]>
</json>
</dmr-operation>
<dmr-operation name="write-attribute">
<address-element key="socket-binding-group" value="${socket-binding-group}" />
<address-element key="socket-binding" value="remoting" />
<json>
<![CDATA[
{
"name":"port",
"value":${socket-binding.port.remoting}
}
]]>
</json>
</dmr-operation>
<dmr-operation name="write-attribute">
<address-element key="socket-binding-group" value="${socket-binding-group}" />
<address-element key="socket-binding" value="txn-recovery-environment" />
<json>
<![CDATA[
{
"name":"port",
"value":${socket-binding.port.txn-recovery-environment}
}
]]>
</json>
</dmr-operation>
<dmr-operation name="write-attribute">
<address-element key="socket-binding-group" value="${socket-binding-group}" />
<address-element key="socket-binding" value="txn-status-manager" />
<json>
<![CDATA[
{
"name":"port",
"value":${socket-binding.port.txn-status-manager}
}
]]>
</json>
</dmr-operation>
<dmr-operation name="write-attribute">
<address-element key="socket-binding-group" value="${socket-binding-group}" />
<address-element key="remote-destination-outbound-socket-binding" value="mail-smtp" />
<json>
<![CDATA[
{
"name":"host",
"value":"${socket-binding.host.mail-smtp}"
}
]]>
</json>
</dmr-operation>
<dmr-operation name="write-attribute">
<address-element key="socket-binding-group" value="${socket-binding-group}" />
<address-element key="remote-destination-outbound-socket-binding" value="mail-smtp" />
<json>
<![CDATA[
{
"name":"port",
"value":${socket-binding.port.mail-smtp}
}
]]>
</json>
</dmr-operation>
</dmr-operation-set>
</dmr-operation-template>
{code}
The following would just have been more elegant:
{code:xml}
<dmr-operation-template id="template_socket-binding-group">
<dmr-operation-set id="socket-binding-group">
<dmr-operation name="add" removeIfExisting="true">
<address-element key="socket-binding-group" value="${socket-binding.group}" />
<json>
<![CDATA[
{
"name":"${socket-binding.group}",
"default-interface":"public"
}
]]>
</json>
<dmr-operation name="add">
<address-element key="socket-binding" value="ajp" />
<json>{"port":${socket-binding.port.ajp}}</json>
</dmr-operation>
<dmr-operation name="add">
<address-element key="socket-binding" value="http" />
<json>{"port":${socket-binding.port.http}}</json>
</dmr-operation>
<dmr-operation name="add">
<address-element key="socket-binding" value="https" />
<json>{"port":${socket-binding.port.https}}</json>
</dmr-operation>
<dmr-operation name="add">
<address-element key="socket-binding" value="osgi-http" />
<json>{"interface":"management","port":${socket-binding.port.osgi-http}}</json>
</dmr-operation>
<dmr-operation name="add">
<address-element key="socket-binding" value="remoting" />
<json>{"port":${socket-binding.port.remoting}}</json>
</dmr-operation>
<dmr-operation name="add">
<address-element key="socket-binding" value="txn-recovery-environment" />
<json>{"port":${socket-binding.port.txn-recovery-environment}}</json>
</dmr-operation>
<dmr-operation name="add">
<address-element key="socket-binding" value="txn-status-manager" />
<json>{"port":${socket-binding.port.txn-status-manager}}</json>
</dmr-operation>
<dmr-operation name="add">
<address-element key="remote-destination-outbound-socket-binding" value="mail-smtp" />
<json>{"host":"${socket-binding.host.mail-smtp}","port":${socket-binding.port.mail-smtp}}</json>
</dmr-operation>
</dmr-operation>
</dmr-operation-set>
</dmr-operation-template>
{code}
With 'removeIfExisting="true"', the inverse operation of the defined operation is executed first. And this only has to be done on the parent (the socket-binding-group).
After writing the new ports, the server-group can be restarted...
> Cannot remove and re-add socket-binding group
> ---------------------------------------------
>
> Key: AS7-4468
> URL: https://issues.jboss.org/browse/AS7-4468
> Project: Application Server 7
> Issue Type: Bug
> Components: Domain Management
> Affects Versions: 7.1.1.Final
> Reporter: Michael Voegele
> Assignee: Kabir Khan
> Fix For: 7.1.3.Final (EAP), 7.2.0.Alpha1
>
>
> Error message when trying to (remove and) add a socket-binding-group in domain mode:
> First remove:
> { "operation" => "remove", "address" => [("socket-binding-group" => "standard-sockets")] }
> Result:
> {
> "outcome" : "success",
> "result" : null,
> "server-groups" : {"server-group-1" : {"server-1" : {
> "host" : "master",
> "response" : {"outcome" : "success"}
> }}}
> }
> Now add again:
> {
> "name" : "standard-sockets",
> "default-interface" : "public",
> "operation" : "add",
> "address" : [{ "socket-binding-group" : "standard-sockets" }]
> }
> Result:
> {
> "outcome" : "failed",
> "result" : null,
> "failure-description" : "JBAS010839: Operation failed or was rolled back on all servers.",
> "rolled-back" : true,
> "server-groups" : {"server-group-1" : {"server-1" : {
> "host" : "master",
> "response" : { "outcome" : "failed", "failure-description" : "JBAS014749: Operation handler failed: Service jboss.socket-binding-manager is already registered", "rolled-back" : true }
> }}}
> }
> For me, this seems a bit strange. If an error shall be produced, then it should be thrown when removing the socket-binding-group, as there is a server running referencing the socket-binding-group via server-group. But if the socket-binding-group can be removed, it should also be possible to add it again (possibly with new defined socket-bindings in the group, then trigger a restart of the server in order to take the newly configured ports into account).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list