-
1. Re: Deploying multiple XML files as a single SpringApplicati
alesj Dec 19, 2007 1:27 PM (in response to acricken)Currently there is no way of doing that. But you can declare a hierarchy - see article for more details (bottom of http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossSpringIntegration).
I just rewrote SpringDeployer for JBoss5.
Perhaps this feature can find place there.
btw: why would you like to have it in a single ApplicationContext instance? -
2. Re: Deploying multiple XML files as a single SpringApplicati
acricken Dec 19, 2007 3:27 PM (in response to acricken)It's often useful to break beans out into separate XML files for legibility, as well as making it easier to swap certain portions for different configurations or environments. While this may speak to an over-reliance on Spring for DI, I still find it useful. When doing this, it's desirable to avoid the individual XML files being aware of each other if possible.
I find it's a pretty common use case for Spring, eg (from their docs):ApplicationContext context = new ClassPathXmlApplicationContext( new String[] {"applicationContext.xml", "applicationContext-part2.xml"});
In my case, I'm working with an app based heavily on Apache Camel. I'd like to use the same Apache Camel route definitions but with varying component configurations. So, use routes-spring.xml, which refers to beans that could be in components-dev-spring.xml or in components-prod-spring.xml depending on the environment. Currently, if I want to deploy this app to JBoss, I have to resort to hardcoding an import or using JNDI to get at beans. Am I missing something obvious? -
3. Re: Deploying multiple XML files as a single SpringApplicati
alesj Dec 19, 2007 3:35 PM (in response to acricken)Use our Microcontainer, which is a full blown state machine, so it doesn't really matter in which order you deploy your beans.
And you can split the beans definitions in as fine grained files as you like.
http://labs.jboss.com/jbossmc
And you can already deploy existing Spring beans .xml files with Microcontainer, and not needing any Spring lib in the classpath:
http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/trunk/spring-int/ -
4. Re: Deploying multiple XML files as a single SpringApplicati
mayankk Feb 13, 2008 11:49 PM (in response to acricken)has this feature been incorporated in the spring deployer as yet?
thnx,
-mayank -
5. Re: Deploying multiple XML files as a single SpringApplicati
mayankk Feb 14, 2008 1:20 AM (in response to acricken)I found a way to make this work. Write your jboss-spring.xml as follows...
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd "> <description>BeanFactory=(spring-bean-factory)</description> <import resource="applicationContext-base.xml" /> <import resource="applicationContext-deployment.xml" /> </beans>
-
6. Re: Deploying multiple XML files as a single SpringApplicati
alesj Feb 14, 2008 10:20 AM (in response to acricken)"mayankk" wrote:
has this feature been incorporated in the spring deployer as yet?
The SpringDeployer has been updated to work with the new AS5/MC deployers, but this feature is out of the scope of what the deployer actually does.
And having Microcontainer makes no sense to implement this on top of Spring's ApplicationContext/BeanFactory. -
7. Re: Deploying multiple XML files as a single SpringApplicati
barifla May 15, 2008 3:46 AM (in response to acricken)"alesj" wrote:
Use our Microcontainer, which is a full blown state machine, so it doesn't really matter in which order you deploy your beans.
And you can split the beans definitions in as fine grained files as you like.
http://labs.jboss.com/jbossmc
Can you explain me how please? I'd like to use Spring DI in JBoss so I need some information about that."alesj" wrote:
And you can already deploy existing Spring beans .xml files with Microcontainer, and not needing any Spring lib in the classpath:
http://anonsvn.jboss.org/repos/jbossas/projects/microcontainer/trunk/spring-int/
Can you write me an example please? I'm a Java newbie so every thing is complicate for me.
TIA. -
8. Re: Deploying multiple XML files as a single SpringApplicati
alesj May 15, 2008 6:49 PM (in response to acricken)"barifla" wrote:
Can you explain me how please? I'd like to use Spring DI in JBoss so I need some information about that.
How exactly would you use Spring DI?"barifla" wrote:
Can you write me an example please? I'm a Java newbie so every thing is complicated for me.
Be more specific.
I'm not gonna go ahead an guess what you want, or write n examples that are possible. ;-)
Describe what you're trying to do.
Hopefully it's got something to do with the actual topic of this forum:
- http://www.jboss.com/index.html?module=bb&op=viewtopic&t=106598
If the answer to this is yes, then I'm very willing to help, otherwise we should look for more appropriate forum.
If what you're trying to do, can be solved by MC, even better:
- http://www.jboss.org/file-access/default/members/jbossmc/freezone/docs/2.0.x/userGuide/index.html
But then we should move the further posts to MC user forum.