You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by martymusk <ma...@email.it> on 2007/12/06 14:18:55 UTC

Servicemix in eclipse

Hy, I'm imported servicemix in eclipse, but some red x appears on project.
When I start ws-notification example, it runs exactly, but if I want to
modify something (for example, message of log.info) it doesn't bring about
change. Why this? 
Can somebody help me, please?
Thank you!

Martina
-- 
View this message in context: http://www.nabble.com/Servicemix-in-eclipse-tf4955962s12049.html#a14192014
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix in eclipse

Posted by martymusk <ma...@email.it>.
Thus,
I've included the following XML snippet code in instance2 and instance3
respectively

INSTANCE2:

<sm:activationSpec>
  <sm:component>
   <bean class="org.apache.servicemix.wsn.spring.WSNSpringComponent">
    <property name="connectionFactory" ref="connectionFactory"/>
   </bean>
  </sm:component>
</sm:activationSpec>


<sm:activationSpec service="test:publisher" endpoint="endpoint">
  <sm:component>
   <bean class="org.apache.servicemix.wsn.spring.PublisherComponent">
    <property name="topic" value="receiveTopic"/>
   </bean>
  </sm:component>
</sm:activationSpec>

  

INSTANCE3

<sm:activationSpec>   
    <sm:component>
     <bean class="org.apache.servicemix.wsn.spring.WSNSpringComponent">
      <property name="requests">
       <list>
        <bean class="org.apache.servicemix.wsn.spring.SubscribeFactoryBean">
            <property name="consumer"
value="http://servicemix.apache.org/demo/trace/endpoint"/>
            <property name="topic" value="receiveTopic"/>
        </bean>
       </list>
      </property>
      <property name="connectionFactory" ref="connectionFactory"/>
     </bean>
  
    </sm:component>
   </sm:activationSpec> 

   <sm:activationSpec componentName="trace" service="my:trace"
endpoint="endpoint">
     <sm:component>
      <bean class="org.apache.servicemix.components.util.TraceComponent" />
     </sm:component>
    </sm:activationSpec>

But the same following error occurs:

Caught: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'jbi' defined in file
[/home/martina/SERVICEMIX/apache-servicemix-3.1.2/examples/ws-notification/instance2/servicemix2.xml]:
Invocation of init method failed; nested exception is
javax.jbi.JBIException: Error calling init
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'jbi' defined in file
[/home/martina/SERVICEMIX/apache-servicemix-3.1.2/examples/ws-notification/instance2/servicemix2.xml]:
Invocation of init method failed; nested exception is
javax.jbi.JBIException: Error calling init
Caused by: javax.jbi.JBIException: Error calling init
	at
org.apache.servicemix.common.AsyncBaseLifeCycle.init(AsyncBaseLifeCycle.java:149)
	at
org.apache.servicemix.jbi.framework.ComponentMBeanImpl.init(ComponentMBeanImpl.java:201)
	at
org.apache.servicemix.jbi.container.JBIContainer.activateComponent(JBIContainer.java:1114)
	at
org.apache.servicemix.jbi.container.JBIContainer.activateComponent(JBIContainer.java:1074)
	at
org.apache.servicemix.jbi.container.JBIContainer.activateComponent(JBIContainer.java:1031)
	at
org.apache.servicemix.jbi.container.JBIContainer.activateComponent(JBIContainer.java:979)
	at
org.apache.servicemix.jbi.container.SpringJBIContainer.afterPropertiesSet(SpringJBIContainer.java:65)
........

I do wrong something?
  :( 
Thanks
Martina 




martymusk wrote:
> 
> Hy Bruce,
> I've tried to do this, but it don't work exactly. 
> Can you post me an example?
> In particular, how instance2 publish "copia" and how instance3 receive
> "copia"?
> 
> Thank you for availability!!!
> 
> Martina
> 
> bsnyder wrote:
>> 
>> On Dec 7, 2007 7:22 AM, martymusk <ma...@email.it> wrote:
>>>
>>> Thanks Bruce,
>>> it's clear what you mean! But I want instance2 publish copy of received
>>> message, without trigger of QuartzComponent.
>>> In particular, the snippet code concern to message's copy is the
>>> following:
>>>
>>>              log.info("Copia del messaggio...");
>>>                 try{
>>>               NormalizedMessage copia =
>>> (NormalizedMessage)message.clone();
>>>                 log.info("Il messaggio è stato copiato!");
>>>                 log.info("Body is: " +
>>> sourceTransformer.toString(copia.getContent()));
>>>                 }catch (CloneNotSupportedException e ){
>>>                 e.printStackTrace();
>>>               }
>>>                  catch(TransformerException e){
>>>                   e.printStackTrace();
>>>                  }
>>>
>>> where method clone() is implemented in NormalizedMessageImpl and
>>> NormalizedMessage interface extends Cloneable.
>> 
>> I'm not sure what you mean by showing the code snippet above.
>> 
>>> Now, instance2 has to publish this "copia" to "receiveTopic". I've to
>>> employ
>>> Quartz Component?
>> 
>> No, the Quartz component is not required to do this. If you're
>> sticking with the lightweight components (the one's used in the
>> ws-notification example) then you could use the publisher to send the
>> message to the receiveTopic exactly the way that way it is done in the
>> instance3/servicemix3.xml.
>> 
>> Bruce
>> -- 
>> perl -e 'print
>> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>> );'
>> 
>> Apache ActiveMQ - http://activemq.org/
>> Apache Camel - http://activemq.org/camel/
>> Apache ServiceMix - http://servicemix.org/
>> Apache Geronimo - http://geronimo.apache.org/
>> 
>> Blog: http://bruceblog.org/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Servicemix-in-eclipse-tf4955962s12049.html#a14216434
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix in eclipse

Posted by martymusk <ma...@email.it>.
Hy Bruce,
I've tried to do this, but it don't work exactly. 
Can you post me an example?
In particular, how instance2 publish "copia" and how instance3 receive
"copia"?

Thank you for availability!!!

Martina

bsnyder wrote:
> 
> On Dec 7, 2007 7:22 AM, martymusk <ma...@email.it> wrote:
>>
>> Thanks Bruce,
>> it's clear what you mean! But I want instance2 publish copy of received
>> message, without trigger of QuartzComponent.
>> In particular, the snippet code concern to message's copy is the
>> following:
>>
>>              log.info("Copia del messaggio...");
>>                 try{
>>               NormalizedMessage copia =
>> (NormalizedMessage)message.clone();
>>                 log.info("Il messaggio è stato copiato!");
>>                 log.info("Body is: " +
>> sourceTransformer.toString(copia.getContent()));
>>                 }catch (CloneNotSupportedException e ){
>>                 e.printStackTrace();
>>               }
>>                  catch(TransformerException e){
>>                   e.printStackTrace();
>>                  }
>>
>> where method clone() is implemented in NormalizedMessageImpl and
>> NormalizedMessage interface extends Cloneable.
> 
> I'm not sure what you mean by showing the code snippet above.
> 
>> Now, instance2 has to publish this "copia" to "receiveTopic". I've to
>> employ
>> Quartz Component?
> 
> No, the Quartz component is not required to do this. If you're
> sticking with the lightweight components (the one's used in the
> ws-notification example) then you could use the publisher to send the
> message to the receiveTopic exactly the way that way it is done in the
> instance3/servicemix3.xml.
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Servicemix-in-eclipse-tf4955962s12049.html#a14215142
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix in eclipse

Posted by Bruce Snyder <br...@gmail.com>.
On Dec 7, 2007 7:22 AM, martymusk <ma...@email.it> wrote:
>
> Thanks Bruce,
> it's clear what you mean! But I want instance2 publish copy of received
> message, without trigger of QuartzComponent.
> In particular, the snippet code concern to message's copy is the following:
>
>              log.info("Copia del messaggio...");
>                 try{
>               NormalizedMessage copia = (NormalizedMessage)message.clone();
>                 log.info("Il messaggio è stato copiato!");
>                 log.info("Body is: " +
> sourceTransformer.toString(copia.getContent()));
>                 }catch (CloneNotSupportedException e ){
>                 e.printStackTrace();
>               }
>                  catch(TransformerException e){
>                   e.printStackTrace();
>                  }
>
> where method clone() is implemented in NormalizedMessageImpl and
> NormalizedMessage interface extends Cloneable.

I'm not sure what you mean by showing the code snippet above.

> Now, instance2 has to publish this "copia" to "receiveTopic". I've to employ
> Quartz Component?

No, the Quartz component is not required to do this. If you're
sticking with the lightweight components (the one's used in the
ws-notification example) then you could use the publisher to send the
message to the receiveTopic exactly the way that way it is done in the
instance3/servicemix3.xml.

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Servicemix in eclipse

Posted by martymusk <ma...@email.it>.
Thanks Bruce, 
it's clear what you mean! But I want instance2 publish copy of received
message, without trigger of QuartzComponent.
In particular, the snippet code concern to message's copy is the following: 

             log.info("Copia del messaggio...");
	        try{
	      NormalizedMessage copia = (NormalizedMessage)message.clone();  
	        log.info("Il messaggio è stato copiato!");
	        log.info("Body is: " +
sourceTransformer.toString(copia.getContent()));
	        }catch (CloneNotSupportedException e ){
	    	e.printStackTrace();
	      }
	         catch(TransformerException e){
	          e.printStackTrace();	 
	         }
	        
where method clone() is implemented in NormalizedMessageImpl and
NormalizedMessage interface extends Cloneable.

Now, instance2 has to publish this "copia" to "receiveTopic". I've to employ
Quartz Component?
I hope you can help me!
Thank you!

Martina



bsnyder wrote:
> 
> On Dec 7, 2007 5:45 AM, martymusk <ma...@email.it> wrote:
>>
>> Hy Bruce, thanks for answer...
>> Yes, it's right! But I've resolved this problem. I had to update jars...
>>
>> Can I post another question to you?
>> After instance2 received message, I've added some code.
>> In particular, after instance2 received message, it makes copy of it.
>> The question is:
>> How instance2 can send this copy back to instance1?
>> Or rather, how instance2 can publish copy and instance1 receive it?
>> Some ideas?
> 
> If you're still referring to the ws-notification example, you'd have
> to create a publisher in instance2, a subscriber in instance1 and then
> pubisher a message to a topic. WS-Notification is very similar to JMS.
> There are some docs here:
> 
> http://servicemix.apache.org/ws-notification-clustered.html
> 
> There's also a good sequence diagram for WSN here:
> 
> http://servicemix.apache.org/example-scenario.html
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.org/
> Apache Camel - http://activemq.org/camel/
> Apache ServiceMix - http://servicemix.org/
> Apache Geronimo - http://geronimo.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Servicemix-in-eclipse-tf4955962s12049.html#a14213242
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix in eclipse

Posted by Bruce Snyder <br...@gmail.com>.
On Dec 7, 2007 5:45 AM, martymusk <ma...@email.it> wrote:
>
> Hy Bruce, thanks for answer...
> Yes, it's right! But I've resolved this problem. I had to update jars...
>
> Can I post another question to you?
> After instance2 received message, I've added some code.
> In particular, after instance2 received message, it makes copy of it.
> The question is:
> How instance2 can send this copy back to instance1?
> Or rather, how instance2 can publish copy and instance1 receive it?
> Some ideas?

If you're still referring to the ws-notification example, you'd have
to create a publisher in instance2, a subscriber in instance1 and then
pubisher a message to a topic. WS-Notification is very similar to JMS.
There are some docs here:

http://servicemix.apache.org/ws-notification-clustered.html

There's also a good sequence diagram for WSN here:

http://servicemix.apache.org/example-scenario.html

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache ActiveMQ - http://activemq.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/
Apache Geronimo - http://geronimo.apache.org/

Blog: http://bruceblog.org/

Re: Servicemix in eclipse

Posted by martymusk <ma...@email.it>.
Hy Bruce, thanks for answer...
Yes, it's right! But I've resolved this problem. I had to update jars...

Can I post another question to you?
After instance2 received message, I've added some code. 
In particular, after instance2 received message, it makes copy of it.
The question is:
How instance2 can send this copy back to instance1?
Or rather, how instance2 can publish copy and instance1 receive it?
Some ideas?
I hope it's clear!

Thanks in advance!!!

Martina



bsnyder wrote:
> 
> On Dec 6, 2007 6:18 AM, martymusk <ma...@email.it> wrote:
>>
>> Hy, I'm imported servicemix in eclipse, but some red x appears on
>> project.
>> When I start ws-notification example, it runs exactly, but if I want to
>> modify something (for example, message of log.info) it doesn't bring
>> about
>> change. Why this?
>> Can somebody help me, please?
> 
> I'm not following what you mean exactly. Are you saying that you have
> changed some code and re-run ServiceMix and the change isn't
> recognized?
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&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/
> 
> http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Servicemix-in-eclipse-tf4955962s12049.html#a14211903
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servicemix in eclipse

Posted by Bruce Snyder <br...@gmail.com>.
On Dec 6, 2007 6:18 AM, martymusk <ma...@email.it> wrote:
>
> Hy, I'm imported servicemix in eclipse, but some red x appears on project.
> When I start ws-notification example, it runs exactly, but if I want to
> modify something (for example, message of log.info) it doesn't bring about
> change. Why this?
> Can somebody help me, please?

I'm not following what you mean exactly. Are you saying that you have
changed some code and re-run ServiceMix and the change isn't
recognized?

Bruce
-- 
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&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/

http://bruceblog.org/