On 9/14/07, kumar k <[EMAIL PROTECTED]> wrote:
> Code
> ---------------------------
> public void sendMessages(Source sc) throws MessagingException {
> try{
>
> getClientFactory();
> ServiceMixClient clientNoRouting = (ServiceMixClient)
> context.getBean("clientWithRouting");
> Map properties = new HashMap();
> properties.put("name", "James");
>
> clientNoRouting.send(null, null, properties, "<hello>world</hello>");
>
> }catch(Throwable e){
> e.printStackTrace();
> }
> }
> protected void getClientFactory() throws Exception {
> context = createBeanFactory();
> client = getClient();
> SpringJBIContainer jbi = (SpringJBIContainer) getBean("jbi");
>
> }
> protected ServiceMixClient getClient() throws Exception {
> return (ServiceMixClient) getBean("client");
> }
>
> protected Object getBean(String name) {
> Object answer = context.getBean(name);
> return answer;
> }
>
> protected AbstractXmlApplicationContext createBeanFactory() {
> return new ClassPathXmlApplicationContext("resources/servicemix.xml");
> }
>
> -------------------------------------------------------------------------------------------------
> ServiceMix.xml
> ------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> Licensed to the Apache Software Foundation (ASF) under one or more
> contributor license agreements. See the NOTICE file distributed with
> this work for additional information regarding copyright ownership.
> The ASF licenses this file to You under the Apache License, Version 2.0
> (the "License"); you may not use this file except in compliance with
> the License. You may obtain a copy of the License at
> http://www.apache.org/licenses/LICENSE-2.0
> Unless required by applicable law or agreed to in writing, software
> distributed under the License is distributed on an "AS IS" BASIS,
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> See the License for the specific language governing permissions and
> limitations under the License.
> -->
> <beans xmlns:sm="http://servicemix.apache.org/config/1.0"
> xmlns:jms="http://servicemix.apache.org/jms/1.0"
> xmlns:amq="http://activemq.org/config/1.0"
> xmlns:test2="http://servicemix.apache.org/test2"
> xmlns:test5="http://servicemix.apache.org/test5"
> xmlns:sub2="http://subp" >
> <sm:container id="jbi" embedded="true">
> <sm:activationSpecs>
> <!-- JMS POLLER - CONSUMER -->
> <sm:activationSpec componentName="MyConsumer" service="sub2:MyConsumer">
> <sm:component>
> <jms:component>
> <jms:endpoints>
> <jms:endpoint service="sub2:MyConsumer"
> endpoint="MyConsumer"
> targetService="sub2:receiver"
> targetEndpoint="receiver"
> role="consumer"
> destinationStyle="topic"
> jmsProviderDestinationName="topic.sample"
> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> connectionFactory="#connectionFactory" />
> </jms:endpoints>
> </jms:component>
> </sm:component>
> </sm:activationSpec>
> <!-- JMS SENDER - PROVIDER -->
> <sm:activationSpec componentName="MyProvider" service="sub2:MyProvider">
> <sm:component>
> <jms:component>
> <jms:endpoints>
> <jms:endpoint service="sub2:MyProvider"
> endpoint="MyProvider"
> role="provider"
> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> destinationStyle="topic"
> jmsProviderDestinationName="sample.rebuplish.topic"
> connectionFactory="#connectionFactory" />
> </jms:endpoints>
> </jms:component>
> </sm:component>
> </sm:activationSpec>
> <sm:activationSpec componentName="MySecondConsumer"
> service="sub2:MySecondConsumer">
> <sm:component>
> <jms:component>
> <jms:endpoints>
> <jms:endpoint service="sub2:MySecondConsumer"
> endpoint="MySecondConsumer"
> targetService="sub2:receiver2"
> targetEndpoint="receiver2"
> role="consumer"
> destinationStyle="topic"
> jmsProviderDestinationName="sample.rebuplish.topic"
> defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> connectionFactory="#connectionFactory" />
> </jms:endpoints>
> </jms:component>
> </sm:component>
> </sm:activationSpec>
> <sm:activationSpec id="receiver" service="sub2:receiver">
> <sm:component><bean
> class="org.apache.servicemix.practice.poc.MyBean"/></sm:component>
> </sm:activationSpec>
> <sm:activationSpec id="receiver2" service="sub2:receiver2">
> <sm:component><bean
> class="org.apache.servicemix.practice.poc.MyBean2"/></sm:component>
> </sm:activationSpec>
> </sm:activationSpecs>
> </sm:container>
> <amq:connectionFactory id="connectionFactory"
> brokerURL="tcp://localhost:61616" />
> <bean id="client"
> class="org.apache.servicemix.client.DefaultServiceMixClient">
> <constructor-arg ref="jbi" />
> </bean>
> <bean id="clientWithRouting"
> class="org.apache.servicemix.client.DefaultServiceMixClient">
> <constructor-arg ref="jbi" />
> <constructor-arg>
> <sm:activationSpec destinationService="http://subp:MyProvider"/>
> </constructor-arg>
> </bean>
>
> </beans>
> ---------------------------------------------------------------------------------------------------
> Error
> --------------
> <msg-loc-info>
> <loc-token/>
> <loc-message>Could not deploy xbean service unit</loc-message>
Seeing the message above and the code above tells me that you're
probably trying to deploy a JBI compliant component to the
servicemix-lwcontainer and this is not possible. JBI compliant
components can only be deployed directly to ServiceMix.
Bruce
--
perl -e 'print unpack("u30","D0G)[EMAIL
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/
Castor - http://castor.org/