Announcement Announcement Module
No announcement yet.
Jboss and Spring Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jboss and Spring

    I'm sorry if I've posted to the wrong forum topic here. I did a search for topics containing jboss and didn't find the answer I wanted so here goes.

    I have written a spring application. I start that application by getting the ClassPathXmlApplicationContext in the main method, which loads the xml file.

    Now I have need to run this application inside Jboss. I have found the page on the jboss site ( which supplies jboss-spring.deployer, which I put into my jboss instance, which will invoke my xxx.spring package.

    Now what I want to know is, is this the best way to do it? If not what is?

    If it isn't, can some please supply a sample war or some such? I've had an aweful time of this, and really need to make some head way. I'm not new to jboss, but I am new to having to create war files from scratch.

    Personally, I would have thought a blank war, which some mbean creating the context would have been the way to go, but I don't know how to do it.

    Hope someone can help me.

  • #2

    Well I've now had a bit of a play with the jboss spring deployer. It is stuck in the age of Spring 1.2.5, which doesn't really suit me, as I really need 2.0.2, and it will need a rewrite to upgrade... So I'll left looking for a way to start a spring app from a war file.


    • #3
      Initialiaze Spring beans from war

      In the web.xml for your war file you can specify the following , which will initialize the spring beans at startup :
      <!-- above xml files are spring bean config files packed in your war/WEB-INF -->
      <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>


      • #4
        Thanks diippi, but in the meantime I'd figured it out. It was chance find, as I was reading the spring docs, as I didn't really know what I was looking for....