4 Replies Latest reply on Jun 29, 2006 9:21 AM by pierodesalvia

    Spring deployer - splitting  conf files

    piergi

      Hi,

      We are deploying our spring beans in JBoss through the JBoss Spring deployer which requires that we use only one configuration file, jboss-service.xml .

      We previously had different files, applicationContext-persistence.xml, applicationContext-security.xml etc.

      How to make the deployer read the old multiple files form the single jboss-service.xml file? (we are also deploying the old config files)

      Thanks,

      piero

        • 1. Re: Spring deployer - splitting  conf files
          alesj

           


          We are deploying our spring beans in JBoss through the JBoss Spring deployer which requires that we use only one configuration file, jboss-service.xml.


          Configuration of your pojos is not in jboss-service.xml (file only contains deployer configuration), but it's in your [name]-spring.xml files. And there can be multiple such files or multiple .spring archive files with jboss-spring.xml in META-INF. They can even be in hierarchy (similar to Spring's bean factories or application contexts).

          Go through these helping resources:
          - it.sys-con.com/read/180386.htm
          - http://www.jbossworld.com/core_infrastructure/JUSTIN_ejb3_jbwv.pdf
          - http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossSpringIntegration
          - docs in distribution http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=161914

          • 2. Re: Spring deployer - splitting  conf files
            pierodesalvia

             

            "alesj" wrote:

            We are deploying our spring beans in JBoss through the JBoss Spring deployer which requires that we use only one configuration file, jboss-service.xml.


            Configuration of your pojos is not in jboss-service.xml (file only contains deployer configuration), but it's in your [name]-spring.xml files. And there can be multiple such files or multiple .spring archive files with jboss-spring.xml in META-INF. They can even be in hierarchy (similar to Spring's bean factories or application contexts).

            Go through these helping resources:
            - it.sys-con.com/read/180386.htm
            - http://www.jbossworld.com/core_infrastructure/JUSTIN_ejb3_jbwv.pdf
            - http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossSpringIntegration
            - docs in distribution http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=161914


            Thanks for your answer. I indeed meant jboss-spring.xml . so we have a .spring file that contains our pojos, and under META-INF, our *-spring.xml . I tried that and JBoss complained that it could not find jboss-spring.xml, so i added an empty one :

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
            "http://www.springframework.org/dtd/spring-beans.dtd">




            and then I added the rest of my xml files, with their names changed to -spring.xml (applicationContext-persistence-spring.xml etc) under META-inf, but JBoss did not read them. So are you saying that we need one .spring archive per configuration file (which must be jboss-spring.xml) ?

            • 3. Re: Spring deployer - splitting  conf files
              alesj

               


              Thanks for your answer. I indeed meant jboss-spring.xml . so we have a .spring file that contains our pojos, and under META-INF, our *-spring.xml . I tried that and JBoss complained that it could not find jboss-spring.xml, so i added an empty one :

              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
              "http://www.springframework.org/dtd/spring-beans.dtd">

              and then I added the rest of my xml files, with their names changed to -spring.xml (applicationContext-persistence-spring.xml etc) under META-inf, but JBoss did not read them. So are you saying that we need one .spring archive per configuration file (which must be jboss-spring.xml) ?


              When used as an archive (.spring), there must be a jboss-spring.xml in meta-inf and no other -spring.xml files are deployed from that archive.
              But you can have multiple -spring.xml files directly in your deploy directory or in your .ear archive at root level (but you have to reference them in application.xml). Make sure that the classes that you are configuring are accessible - in classpath of your deployment unit.
              On more thing you have to be careful - if you have hierarchy - is the order of deployment - see org.jboss.deployment.MainDeployer-xmbean.xml file in conf dir.

              • 4. Re: Spring deployer - splitting  conf files
                pierodesalvia

                Thank you very much !