You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Peter Klotz <pe...@blue-elephant-systems.com> on 2006/08/15 18:49:37 UTC

jndi with and without deployed servicemix

Hi,

we have a component that runs in a web application which runs on a embedded
jetty in servicemix. In order for the component to get ahold of the ESB we
publish the jbi component vi jndi.xml into JNDI.

jndi.xml:
---
  <bean id="jndi"
        class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
        factory-method="makeInitialContext"
        singleton="true">
    <property name="entries">
      <map>
        <entry key="comp/env/jbi">
          <ref local="jbi"/>
        </entry>
...
---

The component that is far away from spring and servicemix gets the JBI component
from the JNDI and creates a DefaultServiceMixClient with it.

If servicemix is started the first time, this works fine.
If servicemix is started the second time (with existing work dir), then the JBI
component seems not to be published as defined in jndi.xml. At least the
component cannot find it in JNDI.

Why is that? This is a severe problem for us as we have no other way to get hold
of it otherwise?


Thanks, Peter

Re: jndi with and without deployed servicemix

Posted by Guillaume Nodet <gn...@gmail.com>.
In the latest snapshots, a ClientFactory is bound to JNDI.
You can use it to create new clients.
See
http://servicemix.goopen.org/site/client-api.html#ClientAPI-UsingClientFactory

I guess it could solve the problem, unless I missed something.

On 8/15/06, Peter Klotz <pe...@blue-elephant-systems.com> wrote:
>
> Hi,
>
> we have a component that runs in a web application which runs on a
> embedded
> jetty in servicemix. In order for the component to get ahold of the ESB we
> publish the jbi component vi jndi.xml into JNDI.
>
> jndi.xml:
> ---
>   <bean id="jndi"
>         class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
>         factory-method="makeInitialContext"
>         singleton="true">
>     <property name="entries">
>       <map>
>         <entry key="comp/env/jbi">
>           <ref local="jbi"/>
>         </entry>
> ...
> ---
>
> The component that is far away from spring and servicemix gets the JBI
> component
> from the JNDI and creates a DefaultServiceMixClient with it.
>
> If servicemix is started the first time, this works fine.
> If servicemix is started the second time (with existing work dir), then
> the JBI
> component seems not to be published as defined in jndi.xml. At least the
> component cannot find it in JNDI.
>
> Why is that? This is a severe problem for us as we have no other way to
> get hold
> of it otherwise?
>
>
> Thanks, Peter
>
>


-- 
Cheers,
Guillaume Nodet

Re: jndi with and without deployed servicemix

Posted by Ramon Buckland <no...@thebuckland.com>.
Hi Peter,

Not too sure on that one. perhaps you can log an issue in Jira (see the 
ServiceMix website). and it can be looked at.

Regards
Ramon

Peter Klotz wrote:
> Hi,
> 
> we have a component that runs in a web application which runs on a embedded
> jetty in servicemix. In order for the component to get ahold of the ESB we
> publish the jbi component vi jndi.xml into JNDI.
> 
> jndi.xml:
> ---
>   <bean id="jndi"
>         class="org.apache.xbean.spring.jndi.SpringInitialContextFactory"
>         factory-method="makeInitialContext"
>         singleton="true">
>     <property name="entries">
>       <map>
>         <entry key="comp/env/jbi">
>           <ref local="jbi"/>
>         </entry>
> ...
> ---
> 
> The component that is far away from spring and servicemix gets the JBI component
> from the JNDI and creates a DefaultServiceMixClient with it.
> 
> If servicemix is started the first time, this works fine.
> If servicemix is started the second time (with existing work dir), then the JBI
> component seems not to be published as defined in jndi.xml. At least the
> component cannot find it in JNDI.
> 
> Why is that? This is a severe problem for us as we have no other way to get hold
> of it otherwise?
> 
> 
> Thanks, Peter