13 Replies Latest reply on Sep 13, 2012 5:21 PM by Paulo Merson

    How to write on standalone.xml permanently?

    nilabhra banerjee Newbie

      Before I started JBoss 7.1 for first time, I wrote two datasources and drivers in standalone-full.initial.xml and it worked well. The data was written to standalone-full.xml. But since then I am trying to add another datasource but cannot. Whatever I wrote in standalone-full.initial.xml is not getting copied to standalone-full.xml. I tried to write on all files, including standalone-full.xml, standalone-full.boot.xml, standalone-full.latest.xml, but all are getting reverted back to original configuration. I would like to know how to preserve my changes.

        • 1. Re: How to write on standalone.xml permanently?
          Wolf-Dieter Fink Master

          All files in *_history are not to be used in general, these are only saved snapshots of the configuration.

          If you want change the configuration i is recommended to use the management interface (CLI and web-console).

          You might change the standalone-full.xml by hand.

          • 2. Re: How to write on standalone.xml permanently?
            nilabhra banerjee Newbie

            "You might change the standalone-full.xml by hand."

             

            - That is what not happening ! Whatever new things I write in that file just vanishes as soon as I start the server.  I will be too glad if those changes remain.

             

            That is why started to write on all the standalone-full.xml versions I could lay hand on. Even when i did it, JBoss, it seems, has a hidden copy and replacing my new file with that one as soon as it starts.

            • 3. Re: How to write on standalone.xml permanently?
              Wolf-Dieter Fink Master

              I don't see that in my environment.

              What version do you use?

              Maybe start with a fresh Instance and change only one thing and check it.

              Also how do you start the JBoss?

              1 of 1 people found this helpful
              • 4. Re: How to write on standalone.xml permanently?
                nilabhra banerjee Newbie

                I am using JBoss AS 7.1.1 Brontes. I start it from eclipse.

                 

                 

                I am managing the situation now in a very strange way.

                Each time  I have to do a change, i rename the existing JBoss, then I unpack JBoss into existing path and copy all the modules I need from old location, use the intended standalone-full.xml with new changes and then it works. But it is really cumbersome !

                • 5. Re: How to write on standalone.xml permanently?
                  nilabhra banerjee Newbie

                  I think I have resolved my problem.

                   

                  *For those beginners who may be facing this problem like me, the solution is to delete everything under the directory standalone_xml_history.

                   

                  Thanks to Wolf-Dieter Fink for the assistance,

                  • 6. Re: How to write on standalone.xml permanently?
                    Paulo Merson Newbie

                    Removing history doesn't always work!

                    I'm having the same kind of problem: upon startup AS 7.1.0.Final removes a segment I added to standalone-full.xml. More specifically, the <jms-connection-factories>  definition inside the <subsystem xmlns="urn:jboss:domain:messaging:1.1">  definition is yanked out.

                     

                    I tried (in order):

                    1) Deleting contents under the standalone_xml_history directory.

                    2) Deleting the standalone_xml_history directory.

                    3) Deleting contents under the standalone-full_xml_history directory.

                    4) Deleting the standalone-full_xml_history directory.

                     

                    And no success. AS 7.1 is still silently "doctoring" my standalone-full.xml.  Interesting thing is that the connection factory I define in the section that is removed works. But then, if I bounce the server it won't be there anymore.

                    • 7. Re: How to write on standalone.xml permanently?
                      Wolf-Dieter Fink Master

                      This sounds like a bug.

                      Do you have checked the xsd of the subsystem that the config is correct (I suppose yes because you say it works)

                       

                      Could you try the latest AS7.2.x upstream from git or nightly builds to retest?

                      • 8. Re: How to write on standalone.xml permanently?
                        Paulo Merson Newbie

                        I found some related issues:

                         

                        But I also believe it's a new bug. My bad luck is that this bug hampers the workaround for another bug described here.

                         

                        I was testing with AS 7.1 on my local machine, but my organization has JBoss EAP on all server machines.

                        I installed EAP 6.0 locally and observed the exact same problem.

                         

                        What is the github URL for the latest AS 7.2.x upstream?

                        • 9. Re: How to write on standalone.xml permanently?
                          Paulo Merson Newbie

                          I downloaded and built the latest version (jboss-as-7.2.0.Alpha1-SNAPSHOT) from github.com/jbossas/jboss-as.git. The same problem is still there.

                           

                          The edits to standalone-full.xml that are erased by this automatic rewrite are needed for MDBs to consume messages from a remote HornetQ server. My next attempt is to go back to EAP 5.1.

                          • 10. Re: How to write on standalone.xml permanently?
                            Jeff Mesnil Master

                            Paulo Merson wrote:

                             

                            The edits to standalone-full.xml that are erased by this automatic rewrite are needed for MDBs to consume messages from a remote HornetQ server. My next attempt is to go back to EAP 5.1.

                            What's exactly the edits you're doing to standalone-full.xml? I am not able to reproduce this issue and don't see any automatic rewrites.

                            • 11. Re: How to write on standalone.xml permanently?
                              Paulo Merson Newbie

                              1) I changed the messaging subsystem definition to:

                               

                              {code:xml}

                                      <subsystem xmlns="urn:jboss:domain:messaging:1.1">

                                          <hornetq-server>

                                              <persistence-enabled>false</persistence-enabled>

                                              <connectors>

                                                  <netty-connector name="netty-remote" socket-binding="remote-messaging"/>

                                              </connectors>

                                              <jms-connection-factories>

                                                  <pooled-connection-factory name="myhornetq-ra">

                                                      <transaction mode="xa"/>

                                                      <connectors>

                                                          <connector-ref connector-name="netty-remote"/>

                                                      </connectors>

                                                      <entries>

                                                          <entry name="java:/JmsXA"/>

                                                      </entries>

                                                  </pooled-connection-factory>

                                              </jms-connection-factories>

                                          </hornetq-server>

                                      </subsystem>

                              {code}

                               

                               

                              2) I added the following socket binding:

                               

                              {code:xml}

                              <socket-binding name="remote-messaging" port="5446"/>

                              {code}

                               

                              3) I had also added datasource definitions that are unrelated to this problem and were working fine before.

                               

                               

                              The automatic rewrite changes the messaging subsystem definition to:

                               

                              {code:xml}

                                      <subsystem xmlns="urn:jboss:domain:messaging:1.1">

                                          <hornetq-server>

                                              <persistence-enabled>false</persistence-enabled>

                               

                                              <connectors>

                                                  <netty-connector name="netty-remote" socket-binding="remote-messaging"/>

                                              </connectors>

                              </hornetq-server>

                                      </subsystem>

                              {code}

                               

                               

                              I observed the same problem on AS 7.1.0 Final and 7.2.0.Alpha1-SNAPSHOT. The only difference is that AS 7.1.0  has messaging:1.1  and 7.2.0 has messaging:1.3.

                              • 12. Re: How to write on standalone.xml permanently?
                                Jeff Mesnil Master

                                thanks paulo, this was indeed a bug: https://issues.jboss.org/browse/AS7-5538

                                 

                                I have created patches for both AS7 7.1 and 7.2 branches. In the mean time, you can work around this issue by adding a *connection-factory* to the messaging subsystem to ensure that the *pooled-connection-factory* are correctly persisted:

                                 

                                        <subsystem xmlns="urn:jboss:domain:messaging:1.1">

                                            <hornetq-server>

                                                <persistence-enabled>false</persistence-enabled>

                                                <connectors>

                                                    <netty-connector name="netty-remote" socket-binding="remote-messaging"/>

                                                </connectors>

                                                <jms-connection-factories>

                                                    <connection-factory name="dummyCF">

                                                        <connectors>

                                                            <connector-ref connector-name="netty-remote"/>

                                                        </connectors>

                                                        <entries>

                                                            <entry name="java:jboss/exported/jms/dummyCF"/>

                                                        </entries>

                                                    </connection-factory>

                                                    <pooled-connection-factory name="myhornetq-ra">

                                                        <transaction mode="xa"/>

                                                        <connectors>

                                                            <connector-ref connector-name="netty-remote"/>

                                                        </connectors>

                                                        <entries>

                                                            <entry name="java:/JmsXA"/>

                                                        </entries>

                                                    </pooled-connection-factory>

                                                </jms-connection-factories>

                                            </hornetq-server>

                                        </subsystem>

                                 

                                I'll now work on making sure that remote MDB works without adding the whole messaging subsystem...

                                • 13. Re: How to write on standalone.xml permanently?
                                  Paulo Merson Newbie

                                  Just confirming that the addition of the dummy <connection-factory> prevented the rewrite on my AS 7 environment. Thank you Jeff.