You should be able to use the spring import statement and then make
reference to beans.
<import resource="file:C:/datatrans/mathmos/TransferServices.xml"/>
<sm:container ..>
<sm:activationSpecs>
<ref bean="xxx" />
</sm:activationSpecs>
</sm:container>
Cheers,
Guillaume Nodet
On 6/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I did manage to decalre it as a Doctype Entity before the <beans> tag like
so:
<!DOCTYPE test[
<!ENTITY includeTransferServices SYSTEM
"C:\datatrans\mathmos\TransferServices.xml">
]>
And then inside the <sm:activationSpecs> tag I called it like so:
&includeTransferServices;
Which works, but in XML validators my XML is of course no longer well
formed :(
Any ideas?
Regards Rick
"Guillaume Nodet" <[EMAIL PROTECTED]>
21/06/2006 20:51
Please respond to servicemix-users
To: [email protected]
cc:
Subject: Re: <import resource=> tag unknown in
applicationContext.xml file error?
Imports can only be put as top level elements.
You may be able to use references, but i' m not
sure how to do that in xbean lists.
Cheers,
Guillaume Nodet
On 6/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi,
> I am trying to import another XML file into my applicationContext.xml
file
> using the import tag like so:
>
> <import resource="file:C:/datatrans/mathmos/TransferServices.xml"/>
>
> Which then imports the an activationSpec from the
TransferServices.xmlfile roughly like so:
>
> <sm:activationSpec componentName="XferOut" service="foo:XferOut"
> destinationService="foo:XSLRouter">
> <sm:component>
> <bean class="com.r.........................................
>
>
...................................................................................................................
>
>
...................................................................................................................
>
>
...................................................................................................................
>
>
...................................................................................................................
> </bean>
> </sm:component>
> </sm:activationSpec>
>
> When I do this I get the error:
>
> ERROR org.springframework.web.context.ContextLoader Context
initialization
> failed main
> org.springframework.beans.factory.BeanDefinitionStoreException: Error
> registering bean with name 'activationSpecs' defined in
> ServletContext resource [/WEB-INF/applicationContext.xml]: Unknown
> property sub-element: <import>
> at
>
>
org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parsePropertySubElement
> (DefaultXmlBeanDefinitionParser.java:789)
> at
>
>
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.parsePropertySubElement
> (XBeanXmlBeanDefinitionParser.java:726)
> at
>
>
org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.parseListElement
> (DefaultXmlBeanDefinitionParser.java:802)
> at
>
>
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.parseNestedPropertyViaIntrospection
> (XBeanXmlBeanDefinitionParser.java:456)
> at
>
>
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.tryParseNestedPropertyViaIntrospection
> (XBeanXmlBeanDefinitionParser.java:371)
> at
>
>
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.addNestedPropertyElements
> (XBeanXmlBeanDefinitionParser.java:340)
> at
>
>
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.parseBeanFromExtensionElement
> (XBeanXmlBeanDefinitionParser.java:138)
> at
>
>
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionParser.parseBeanDefinitions
> (XBeanXmlBeanDefinitionParser.java:677)
> at
>
>
org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions
> (DefaultXmlBeanDefinitionParser.java:191)
> at
>
>
org.apache.xbean.spring.context.impl.XBeanXmlBeanDefinitionReader.registerBeanDefinitions
> (XBeanXmlBeanDefinitionReader.java:78)
> at
>
>
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions
> (XmlBeanDefinitionReader.java:223)
> at
>
>
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
> (XmlBeanDefinitionReader.java:173)
> at
>
>
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
> (XmlBeanDefinitionReader.java:148)
> at
>
>
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
> (AbstractBeanDefinitionReader.java:126)
> at
>
>
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
> (AbstractBeanDefinitionReader.java:142)
> at
>
>
org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions
> (XmlWebApplicationContext.java:126)
> at
>
>
org.apache.xbean.spring.context.XmlWebApplicationContext.loadBeanDefinitions
> (XmlWebApplicationContext.java:63)
> at
>
>
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory
> (AbstractRefreshableApplicationContext.java:89)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(
> AbstractApplicationContext.java:269)
> at
>
>
org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh
> (AbstractRefreshableWebApplicationContext.java:134)
> at
>
org.springframework.web.context.ContextLoader.createWebApplicationContext(
> ContextLoader.java:246)
> at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(
> ContextLoader.java:184)
> at org.springframework.web.context.ContextLoaderServlet.init(
> ContextLoaderServlet.java:83)
> at javax.servlet.GenericServlet.init(GenericServlet.java:211)
> at org.apache.catalina.core.StandardWrapper.loadServlet(
> StandardWrapper.java:1105)
> at org.apache.catalina.core.StandardWrapper.load(
> StandardWrapper.java:932)
> at org.apache.catalina.core.StandardContext.loadOnStartup(
> StandardContext.java:3915)
> at org.apache.catalina.core.StandardContext.start(
> StandardContext.java:4176)
> at org.apache.catalina.core.ContainerBase.addChildInternal(
> ContainerBase.java:759)
> at org.apache.catalina.core.ContainerBase.addChild(
> ContainerBase.java:739)
> at org.apache.catalina.core.StandardHost.addChild(
> StandardHost.java:524)
> at org.apache.catalina.startup.HostConfig.deployDirectory(
> HostConfig.java:910)
> at org.apache.catalina.startup.HostConfig.deployDirectories(
> HostConfig.java:873)
> at org.apache.catalina.startup.HostConfig.deployApps(
> HostConfig.java:474)
> at org.apache.catalina.startup.HostConfig.start(HostConfig.java
> :1118)
> at org.apache.catalina.startup.HostConfig.lifecycleEvent(
> HostConfig.java:310)
> at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(
> LifecycleSupport.java:119)
> at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java
> :1020)
> at org.apache.catalina.core.StandardHost.start(StandardHost.java
> :718)
> at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java
> :1012)
> at org.apache.catalina.core.StandardEngine.start(
> StandardEngine.java:442)
> at org.apache.catalina.core.StandardService.start(
> StandardService.java:450)
> at org.apache.catalina.core.StandardServer.start(
> StandardServer.java:700)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275)
> at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
>
>
> Is it not possible to import external XML files there yet or what am I
> doing wrong?
>
>
> Regards Rick
>
>
> Direct Line Group Limited, registered in England
> with number 2811437, registered office 3 Edridge
> Road, Croydon, Surrey CR9 1AG. The following
> companies are members of the Direct Line Group:
> Direct Line Insurance plc, Direct Line Life
> Insurance Company Limited, Direct Line Unit
> Trusts Limited and Direct Line Financial Services
> Limited, all of which are authorised and regulated
> by the Financial Services Authority. All are
> members of The Royal Bank of Scotland Group.
>
> This email is intended for the addressee only and
> may contain confidential, proprietary or legally
> privileged information. If you are not the
> intended recipient of this email you should
> notify us immediately and delete it. You should
> not copy, print, distribute, disclose or use any
> part of it. We reserve the right to monitor and
> record all electronic communications through our
> networks. We cannot accept any liability for
> viruses transmitted via this e-mail once it has
> left our networks.
>
Direct Line Group Limited, registered in England
with number 2811437, registered office 3 Edridge
Road, Croydon, Surrey CR9 1AG. The following
companies are members of the Direct Line Group:
Direct Line Insurance plc, Direct Line Life
Insurance Company Limited, Direct Line Unit
Trusts Limited and Direct Line Financial Services
Limited, all of which are authorised and regulated
by the Financial Services Authority. All are
members of The Royal Bank of Scotland Group.
This email is intended for the addressee only and
may contain confidential, proprietary or legally
privileged information. If you are not the
intended recipient of this email you should
notify us immediately and delete it. You should
not copy, print, distribute, disclose or use any
part of it. We reserve the right to monitor and
record all electronic communications through our
networks. We cannot accept any liability for
viruses transmitted via this e-mail once it has
left our networks.