Announcement Announcement Module
Collapse
No announcement yet.
externalizing spring-context files Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • externalizing spring-context files

    Hi,

    Been a long time Spring user. Our app's been running for a while. Recently we've had a need to edit the spring context files while the jboss app server is running. Unfortunately where I work, I'm required to deploy a war file, and not a war directory of any kind, and hence I don't have ready command line access to the spring context files.

    Is there some way to move the xml files out of the war file and somewhere in jboss where it will still load them properly and allow the app the run right?

    I looked at the jboss-spring deployer, it didn't seem to do the trick, and documentation seems to be non existent on it.

    We're on jboss 4.0.5 (have to be not my call)
    Spring 2.5

    Any help in direction would be greatly appreciated.

    Thanks
    R

  • #2
    Wow nothing? Is the question that lame?

    Comment


    • #3
      XmlWebApplicationContext may be of use:
      Code:
      XmlWebApplicationContext ctx = new XmlWebApplication();
      ctx.setConfigLocations( "/full/classpath/to/xml/file/you/need" );
      ctx.refresh();
      After that, you should be able to get any beans that you may need.
      Code:
      MyThing mt = (MyThing) ctx.getBean( "myBean" );
      Hope that helps,

      Steve O

      Comment


      • #4
        I guess you would like to reload your context without restarting JBoss.

        Maybe the following blog can give you some ideas:

        http://jroller.com/Solomon/entry/rel...eb_application


        Cheers

        G

        Comment


        • #5
          Thanks to both of you for answers. Yes the first example is good, and I was aware of that one, but as mentioned in the second, I need to make a change without restarting jboss. I'll look at the blog, thanks very much for the clues.

          Comment


          • #6
            Interesting on the blog, but I just thought of something else... which is a bit like a duh moment. if I use the first post's suggestion and simply do a:

            touch mywar.war

            it will reload the war file along with the changes in the xml. problem solved.

            Thanks very much!

            R

            Comment

            Working...
            X