[wildfly-dev] AddStepHandler can't add content to overlay

Stan Silvert ssilvert at redhat.com
Mon Oct 13 16:19:54 EDT 2014


On 10/13/2014 4:12 PM, Brian Stansberry wrote:
> There's no way now to make sure it runs after.
>
> But the fact it assumes that overlay is present in the first place 
> sounds fishy. How do you know it exists?
You don't know it exists.  But if it does, you get an error.

This wouldn't be a problem if I could have non-persistent overlays, but 
I guess I can't?
https://issues.jboss.org/browse/WFLY-3955

>
> On 10/13/14, 1:30 PM, Stan Silvert wrote:
>> I have an AddStepHandler that adds a keycloak server to the management
>> model using the "Mixed Approach"[1].  It also needs to add overlay
>> content if any new content is available.  The overlay itself already
>> exists in standalone.xml.
>>      <deployment-overlays>
>>          <deployment-overlay 
>> name="main-auth-server.war-keycloak-overlay">
>>              <deployment name="main-auth-server.war"/>
>>          </deployment-overlay>
>>      </deployment-overlays>
>>
>> I insert this operation in my AddStepHandler:
>> {
>>      "operation" => "add",
>>      "address" => [
>>          ("deployment-overlay" => 
>> "main-auth-server.war-keycloak-overlay"),
>>          ("content" => "/WEB-INF/classes/META-INF/keycloak-server.json")
>>      ],
>>      "content" => {"url" => "file:/mydir/keycloak-server.json"},
>>      "rollback-on-runtime-failure" => false
>> }
>>
>> But at this point in server startup, the overlay's add handler hasn't
>> bee called.  So I get
>> 14:09:20,729 ERROR [org.jboss.as.controller.management-operation]
>> (ServerService Thread Pool -- 26) JBAS014613: Operation ("add") failed -
>> address: ([
>>      ("deployment-overlay" => "main-auth-server.war-keycloak-overlay"),
>>      ("content" => "/WEB-INF/classes/META-INF/keycloak-server.json")
>> ]) - failure description: "JBAS014766: Resource [(\"deployment-overlay\"
>> => \"main-auth-server.war-keycloak-overlay\")] does not exist; a
>> resource at address [
>>      (\"deployment-overlay\" => 
>> \"main-auth-server.war-keycloak-overlay\"),
>>      (\"content\" => \"/WEB-INF/classes/META-INF/keycloak-server.json\")
>> ] cannot be created until all ancestor resources have been added"
>>
>> At startup, how can I make sure that my "add overlay content" operation
>> is executed after "add overlay" is done?
>>
>> [1] https://developer.jboss.org/wiki/ExtendingAS7
>
>



More information about the wildfly-dev mailing list