Lars,
I have corrected the problem: it was that I need to compile with Java
1.6and I was using Java
1.5.
Thanks a lot for your answers (and speed)
2008/1/23, Lars Heinemann <[EMAIL PROTECTED]>:
>
> Javier,
>
> please make sure your bean implements the MessageExchangeListener
> interface.
> "public class MyBean implements MessageExchangeListener" for example.
>
> Then make sure you define this in your bean class as well:
>
> @Resource
> private DeliveryChannel channel;
>
> @Resource
> private ComponentContext context; // if you need the component context
>
> I all of this is done without getting it to work then I am a little
> curious about that.
> Maybe it helps when you post both xbean.xml and your class (throw your
> private things out of the bean before doing this).
>
> Regards,
> Lars
>
>
>
> Javier Valdes schrieb:
> > Thanks for answering so fast!
> >
> > I believed that I was doing what you have said but I had a problem with
> my
> > project configuration.
> >
> > The problem that I have now is with:
> >
> > @Resource
> > private DeliveryChannel channel;
> >
> > public void onMessageExchange(MessageExchange exchange) throws
> > MessagingException {
> > System.out.println("Received exchange: " + exchange);
> > exchange.setStatus(ExchangeStatus.DONE);
> > channel.send(exchange);
> > }
> >
> >
> > Now I get a NullPointerException, when "channel.send(exchange)" is
> executed.
> > My problem is that the DeliveryChannel "channel" is not initialized. Am
> I
> > forgetting something (like something as "@Resource")?
> >
> > Thanks again.
> >
> >
> > 2008/1/22, Lars Heinemann <[EMAIL PROTECTED]>:
> >
> >> Hi,
> >>
> >> where to put the bean class is clearly defined.
> >> In your SU you can configure via xbean.xml:
> >>
> >> <bean id="listenerBean"
> >> class="org.apache.servicemix.bean.beans.ListenerBean"/>
> >>
> >> This means that you have to place this bean class in your bean SU in a
> >> package called:
> >> org.apache.servicemix.bean.beans
> >> and with the name:
> >> ListenerBean
> >>
> >> So if you use eclipse for developing the path should be this:
> >> <your project path>/src/org/apache/servicemix/bean/beans/
> >>
> >> Hopefully this will help you,
> >> Lars
> >>
> >>
> >>
> >>> Hi,
> >>>
> >>> I am trying an easy example with the bean component (the same that can
> >>>
> >> be
> >>
> >>> find in http://servicemix.apache.org/servicemix-bean.html) but I do
> not
> >>>
> >> know
> >>
> >>> where to put the bean class (in the example:
> >>> org.apache.servicemix.bean.beans.ListenerBean).
> >>> I have tried to put it directly in the classpath and in the service
> unit
> >>>
> >> but
> >>
> >>> I get:
> >>> ...
> >>> Configuration problem: Bean class [
> >>> org.apache.servicemix.bean.beans.ListenerBean] not found
> >>> ...
> >>>
> >>> I am developing using Eclipse, and I am launchin servicemix using
> >>> org.codehaus.classworlds.Launcher.
> >>>
> >>> Thanks
> >>>
> >>>
> >>>
> >
> >
>