developer learn999
developer learn999

Reputation: 395

intelij JBoss standalone.xml file changes are being overridden

I am working with Intelij 2018 and the project works with wildfly 8.1 final. I change header setting in the file, but once I run the project the file is changed back and all setting are lost.

    <!-- configuration to change -->
    <filters>
        <response-header name="Access-Control-Allow-Origin"
            header-name="Access-Control-Allow-Origin" header-value="*" />
        <response-header name="server-header" header-name="Server"
            header-value="WildFly/8" />
        <response-header name="x-powered-by-header"
            header-name="X-Powered-By" header-value="Undertow/1" />
        <response-header name="Access-Control-Allow-Headers"
            header-name="Access-Control-Allow-Headers"
            header-value="origin, content-type, accept, authorization, application" />
        <response-header name="Access-Control-Allow-Credentials"
            header-name="Access-Control-Allow-Credentials" header-value="true" />
        <response-header name="Access-Control-Allow-Methods"
            header-name="Access-Control-Allow-Methods" header-value="GET, POST, PUT, DELETE, OPTIONS, HEAD" />
        <response-header name="Access-Control-Max-Age"
            header-name="Access-Control-Max-Age" header-value="1209600" />
    </filters>

From which file the basic configuration is taken I will modify it.

Upvotes: 4

Views: 2128

Answers (1)

JGlass
JGlass

Reputation: 1467

I think I may have found a solution for you - it may revolve around a bug.

  1. Stop Wildfly through intelliJ.
  2. Close intelliJ.
  3. Make sure WildFly is not listening on 8080 in browser
  4. In standlone/configuration - make a backup of the standalone_xml_history folder either by creating a zip file of it or creating a folder copy and append _bak to it
  5. Delete everything in the folder especially the folders current and snapshot.
  6. Make your changes to the file.
  7. Open intelliJ.
  8. Start JBoss.
  9. Cross your fingers.
  10. If it worked - PROFIT!

If this works it was found via a hint from this JBoss forums page How to write on standalone.xml permanently?
Let me know if it worked!

Upvotes: 5

Related Questions