You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by servicemix user <fr...@gmail.com> on 2014/02/03 13:47:17 UTC

CamelBlueprintTestSupport fails when I use SoapJaxbDataFormat

(sorry, resending due to mailing list subscription problems)

My route unit tests fail when my routes contain SoapJaxbDataFormat elements.


Unit tests complete successfully if I comment out the couple of steps where
SoapJaxbDataFormat is used.

My route uses jaxb data format like such:

        from(someRouteName)
                .routeId(someId)
                .log(LoggingLevel.INFO, "klhkljh")
                .process(fooProcessor)
                .marshal(soapJaxbDataFormat) // (1)
                .log(LoggingLevel.DEBUG, "contents: ${body}")

and soapJaxbDataFormat is defined in test-camel-context.xml like:

    <bean id="soapJaxbDataFormat"
class="org.apache.camel.model.dataformat.SoapJaxbDataFormat">
        <property name="contextPath" value="mypackage.xsd._1" />
    </bean>

mypackage.xsd._1 is package which has JAXB beans generated from
schema/wsdl. It is in folder target/generated-sources/cxf/mypackage/...

Depending on whether line (1) is commented out or not, test either works or
fails.

When my test fails, it first tries to wait for some jaxb-related
dependencies:

[         Blueprint Extender: 3] BlueprintContainerImpl         INFO
 Bundle FooRoutesTest is waiting for dependencies
[(&(dataformat=soapjaxb)(objectClass=org.apache.camel.spi.DataFormatResolver))]


and after timeout, it fails with

java.lang.RuntimeException: Gave up waiting for service
(objectClass=org.apache.camel.CamelContext)
        at
org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:209)

        at
org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:171)

        at
org.apache.camel.test.blueprint.CamelBlueprintTestSupport.createCamelContext(CamelBlueprintTestSupport.java:221)

        at
org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:248)

        at
org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:218)

        at
org.apache.camel.test.blueprint.CamelBlueprintTestSupport.setUp(CamelBlueprintTestSupport.java:123)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


What is the problem? What is the container waiting for?