Hi there,
If anyone is still interested in it.
It turned out that standalone ServiceMix generates WS artefacts after
deployment where as embedded server does not.
Here's the solution. Add jaxws wsgen maven plugin to cxf-se su:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>wsgen</goal>
</goals>
<configuration>
<sei>org.xh.studies.servicemix.ws.HelloWorldImpl</sei>
<genWsdl>true</genWsdl>
<keep>true</keep>
</configuration>
</execution>
</executions>
</plugin>
and then, embedded tests work.
Cheers,
Łukasz
2009/11/24 Freeman Fang <[email protected]>:
> Hi,
>
> Could you please append whole exception stacktrace?
>
> Or if you can provide your whole maven project which I can take a quick
> look, it would be great.
>
> Freeman
> On 2009-11-24, at 下午9:13, Łukasz Budnik wrote:
>
>> Hi all,
>>
>> I have a SA which is composed of 2 su (cxf-se and cxf-bc) when I
>> deploy it on servicemix it works without any problems. I can access my
>> Web Service using Apache CXF or plain Java 6 JAX-WS.
>>
>> But when I use servicemix in embedded mode I get errors during
>> processing of SOAP request:
>>
>> Unmarshalling Error: unexpected element
>> (uri:"http://ws.servicemix.studies.xh.org/", local:"sayHi"). Expected
>> elements are (none)...
>>
>> I'm using ServiceMix 3.2.3. Components seem to be picked up by embedded
>> SM:
>>
>> 2009-11-24 14:02:50 org.apache.cxf.endpoint.ServerImpl initDestination
>> INFO: Setting the server's publish address to be
>> http://localhost:8080/HelloWorld
>> 2009-11-24 14:02:51 sun.reflect.NativeMethodAccessorImpl invoke0
>> INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log)
>> via org.mortbay.log.Slf4jLog
>> 2009-11-24 14:02:51 sun.reflect.NativeMethodAccessorImpl invoke0
>> INFO: jetty-6.1.12rc1
>>
>> If I add
>>
>> Thread.sleep(5000);
>>
>> in my test, I can access WSDL file: http://localhost:8080/HelloWorld?wsdl
>>
>> Here my servicemix.xml file:
>>
>> <sm:container id="jbi" rootDir="./target/servicemix/data/smx">
>> <sm:activationSpecs>
>> <sm:activationSpec>
>> <sm:component>
>> <cxfbc:component>
>> <cxfbc:endpoints>
>> <cxfbc:consumer
>> wsdl="classpath:service.wsdl"
>>
>> targetService="tns:HelloWorldImplService"
>> targetInterface="tns:HelloWorld">
>> </cxfbc:consumer>
>> </cxfbc:endpoints>
>> </cxfbc:component>
>> </sm:component>
>> </sm:activationSpec>
>> <sm:activationSpec>
>> <sm:component>
>> <cxfse:component>
>> <cxfse:endpoints>
>> <cxfse:endpoint>
>> <cxfse:pojo>
>> <bean
>> class="org.xh.studies.servicemix.ws.HelloWorldImpl" />
>> </cxfse:pojo>
>> </cxfse:endpoint>
>> </cxfse:endpoints>
>> </cxfse:component>
>> </sm:component>
>> </sm:activationSpec>
>> </sm:activationSpecs>
>> </sm:container>
>>
>> I use Maven and these are my dependencies:
>>
>> <dependency>
>> <groupId>org.apache.servicemix</groupId>
>> <artifactId>servicemix-core</artifactId>
>> <version>3.2.3</version>
>> <scope>test</scope>
>> </dependency>
>> <dependency>
>> <groupId>org.xh.studies.servicemix.my-first-servicemix.ws</groupId>
>> <artifactId>web-service-se-su</artifactId>
>> <version>0.0.1-SNAPSHOT</version>
>> <scope>test</scope>
>> </dependency>
>> <dependency>
>> <groupId>org.xh.studies.servicemix.my-first-servicemix.ws</groupId>
>> <artifactId>web-service-bc-su</artifactId>
>> <version>0.0.1-SNAPSHOT</version>
>> <scope>test</scope>
>> </dependency>
>> <dependency>
>> <groupId>junit</groupId>
>> <artifactId>junit</artifactId>
>> <version>4.7</version>
>> <scope>test</scope>
>> </dependency>
>>
>> I'm also curious why all directories inside target/servicemix/data/smx
>> are empty...
>>
>> your help is much appreciated
>>
>> thanks,
>> Łukasz
>
>
> --
> Freeman Fang
> ------------------------
> Open Source SOA: http://fusesource.com
>
>