See comments inline
On 6/5/06, rbeeger <[EMAIL PROTECTED]> wrote:
I don't know why it seemingly worked with 2.0 and fails with xbeans,
either.
But since I had no success in calling the service with Spring 2.0, we
don't
need to ponder that question.
The kontoClient bean that contains the calling code is currently the root
bean fetched from the application context. Directly after getting the bean
the code is executed. Does ServiceMix need more time after the creation of
the jbi container bean to get ready. I made the client sleep 20 seconds
before executing the code. It didn't help. If the part of ServiceMix that
needed that time was also send to sleep with my client that would be quite
logical.
ServiceMix start is all synchronous, so sleeping while all the beans are
initialized won't solve the problem.
The only problem is that you can not send a JBI exchange until the spring
context is fully initialized (it will start the jbi container).
Have you tried adding a spring depend-on attribute
<bean id="kontoClient" class="de.c1wps.esb.client.Client" depends-on="jbi">
<property name="client" ref="client"/>
</bean>
So another question arises: Is ServiceMix meant to work embedded inside an
application?
Yes, it really depends on how you want to use it.
When I start the ServiceMix server separately, how to I connect to it and
use it from an application. Is there some kind of remote client API that I
can use or do I have to code the http request myself? If so, what protocol
is to be used?
You can use a binding component (mainly http or jms) or the remote client
See http://servicemix.goopen.org/site/client-api.html
but using org.apache.servicemix.client.RemoteServiceMixClient
It's not important to me to embed ServiceMix inside my application. In real
world scenarios you probably wouldn't do that. It just seemed the easiest
way to get started with it.
You can also initialize ServiceMix programmatically using xbean
JBIContainer jbi = new ClassPathXmlApplicationContext("servicemix.xml
").getBean("jbi")
or programmatically
JBIContainer jbi = new JBIContainer();
jbi.init();
jbi.start();
jbi.activateComponent(...)
Cheers,
Guillaume Nodet
Cheers,
Robert
--
View this message in context:
http://www.nabble.com/Trying-to-make-ServiceMix-run-embedded-inside-Spring-t1728207.html#a4716401
Sent from the ServiceMix - User forum at Nabble.com.