Bruce, thanks for reply, I figured out this yesterday. I was using
ClassPathXmlApplicationContext from spring, instead should be used that
class from xbean
(org.apache.xbean.spring.context.ClassPathXmlApplicationContext). I
don't know why did they name the class the same. This leads to stupid
misunderstandings like that.
Martin
Bruce Snyder wrote:
On 8/27/07, Martin Novák <[EMAIL PROTECTED]> wrote:
Hello, I have a problem running my servicemix unit test. I have a
servicemix spring configuration file which is something like that:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:sm="http://servicemix.apache.org/config/1.0"
xmlns:rest="http://www.browsersoft.com/mergence/rest/1.0"
xmlns:test="urn:test"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://servicemix.apache.org/config/1.0
http://people.apache.org/repo/m2-incubating-repository/org/apache/servicemix/servicemix-core/3.1-incubating/servicemix-core-3.1-incubating.xsd"
>
<sm:container id="jbi" embedded="true" createMBeanServer="false"
createJmxConnector="false">
<sm:activationSpecs>
<sm:activationSpec id="rest">
<sm:component>
<bean class="com.browsersoft.mergence.rest.RestEndpoint"></bean>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:container>
</beans>
It seems to be to be ok, but when I run my test derived from
SpringTestSupport class, it has a problem:
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 46 in XML document from class path resource [rest-test-context.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-complex-type.2.4.b: The content of element 'sm:activationSpec' is
not complete. One of
'{"http://servicemix.apache.org/config/1.0":destinationResolver,
"http://servicemix.apache.org/config/1.0":interfaceChooser,
"http://servicemix.apache.org/config/1.0":marshaler,
"http://servicemix.apache.org/config/1.0":persistent,
"http://servicemix.apache.org/config/1.0":serviceChooser,
"http://servicemix.apache.org/config/1.0":subscriptions,
WC[##other:"http://servicemix.apache.org/config/1.0"]}' is expected.
The error above says it all - the content of the activationSpec
element is incomplete. Try replacing the id attribute on the
activationSpec to componentName. See the basic example that comes with
ServiceMix for an example of a lightweight configuration.
Bruce