Several questions around SMX4

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Several questions around SMX4

Jean-Baptiste Onofré
Hi all,

I have several questions around SMX4.

1/ cxf-nmr and cxf-osgi example
Both example are quite the same except that the <jaxws:endpoint> tag address
attribute is not the same :
- in the case of the cxf-nmr, the address is set to nmr:HelloWorld
- in the case of the cxf-osgi, the address is set to /HelloWorld
Does it mean that to register the OSGi bundle in the NMR, I need to use the first
address format ?
I guess that registering the bundle in the NMR is the only manner to expose the
bean via another component (such as JMS, http, etc). Correct ?

2/ Using bean for jaxws implementor
In the cxf examples, Guillaume uses the <jaxws:endpoint> which looks like the
<cxfse:endpoint> previous component.
In my SMX3 services, I uses a SU with something like :
<bean id="myOtherBean" class="MyOtherBean">
  <property name="arg0" value="test"/>
</bean>
<cxfse:endpoint endpoint="MyService" service="GlobalService">
  <cxfse:pojo>
    <bean class="myBean">
      <property name="otherBean" ref="myOtherBean"/>
    </bean>
  </cxfse:pojo>
</cxfse:endpoint>
Using the <jaxws:endpoint>, I have seen only the implementor attribute taking a
classname. Is it possible to use bean ref as implementor ?

3/ My first bundle
I have wrote my first bundle to migrate one of my cxfse components.
In the META-INF/spring/beans.xml, I have define something like this :

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
       xmlns:fsb="http://fsb.fimasys.com"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
        http://servicemix.apache.org/cxfse/1.0
http://servicemix.apache.org/cxfse/1.0/servicemix-cxf-se.xsd">
  [...]
  <cxfse:endpoint endpoint="myService" service="Services">
    <cxfse:pojo>
        <bean class="myClassImpl">
            <property name="proxy" ref="ejbProxy"/>
        </bean>
    </cxfse:pojo>
  </cxfse:endpoint>
</beans>

myClassImpl contains the @WebService annotations and implements an interface with
@WebService annotation too.

In the pom.xml, I have :
[...]
<packaging>bundle</packaging>
[...]
         <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <configuration>
               <instructions>
                  <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                  <Import-Package>
                    javax.jws,
                    META-INF.cxf,
                    META-INF.cxf.osgi
                  </Import-Package>
                  <Private-Package>MyServicePackage.*</Private-Package>
                 
<Require-Bundle>org.apache.servicemix.bundles.woodstox-3.2.3</Require-Bundle>
               </instructions>
            </configuration>
         </plugin>
[...]

I have build my bundle using :
mvn org.apache.felix:maven-bundle-plugin:bundle

I have installed this bundle (using the shell) using :
osgi install file:/....
osgi start bundle_id

The bundle is installed and started correctly.

But, doing nmr list in the SMX shell, I can't see any endpoints defined.

Now, how can I expose this bundle using another bundle (or component) for example
in HTTP (SOAP), file or JMS ?

4/ Advice to migrate from SMX3 to SMX4
As I don't have a lot of services in my SMX3, I would like to fully migrate to
SMX4 to be ready for the future :).
In my mind, the best way is to reimplement all my old SUs/SUa using OSGi bundles.
Is it a good way ?
Freeman has said to me that it's possible to have a myServices.xml file in the
deploy directory containing all my services definition (endpoints, beans, etc).
In this kind of file, how can I refer OSGi bundles (that I have previously
installed and deploy) (it's quite the same question that in the point 3) ?
Is OSGi bundles is the good way to provide services in the NMR or should I use :
- basic jar files containing my beans
- a myServices.xml in the deploy directory containing services/endpoints
declaration using my beans

Thanks a lot for your feedback :)

Regards
JB
--
Jean-Baptiste Onofré
[hidden email]
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net




Reply | Threaded
Open this post in threaded view
|

Re: Several questions around SMX4

gertv
JB,

1/ Yes, if you register the service in the OSGi context, you can access it from that context (e.g. by importing it with Spring DM functionality) but it is not available as a service on the NMR.  If you do make it available on the NMR, you can e.g. expose it from a JBI BC endpoint on the same NMR.

2/ According to the information on http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html, you should be able to specify implementor="#myBean" to refer to a Spring bean to implement the service.

3/ You need additional imports (for the endpoint classes you're using), but basically this should work.  You also want to add <bean class="org.apache.servicemix.common.osgi.EndpointExporter"/> to export the endpoints you defined from your bundle.  There are a few examples waiting to be added to the distribution in https://issues.apache.org/activemq/browse/SMX4-83.  Especially the proxy example in the zip file attached to this issue might give you more information about how to do this.

4/ For migrating to SMX4, you can start by simply deploying your exisiting SA on the new container.  Next, you probably want to start leveraging the possibility of using OSGi packaging instead of JBI packaging.  You can also use the plain XML file approach as you mention.  The question about importing classes in the XML file's OSGi 'bundle' is a very fair one.  Could you raise a JIRA issue so we add an example on how to do this to the distribution?

Regards,

Gert

Jean-Baptiste Onofré wrote
Hi all,

I have several questions around SMX4.

1/ cxf-nmr and cxf-osgi example
Both example are quite the same except that the <jaxws:endpoint> tag address
attribute is not the same :
- in the case of the cxf-nmr, the address is set to nmr:HelloWorld
- in the case of the cxf-osgi, the address is set to /HelloWorld
Does it mean that to register the OSGi bundle in the NMR, I need to use the first
address format ?
I guess that registering the bundle in the NMR is the only manner to expose the
bean via another component (such as JMS, http, etc). Correct ?

2/ Using bean for jaxws implementor
In the cxf examples, Guillaume uses the <jaxws:endpoint> which looks like the
<cxfse:endpoint> previous component.
In my SMX3 services, I uses a SU with something like :
<bean id="myOtherBean" class="MyOtherBean">
  <property name="arg0" value="test"/>
</bean>
<cxfse:endpoint endpoint="MyService" service="GlobalService">
  <cxfse:pojo>
    <bean class="myBean">
      <property name="otherBean" ref="myOtherBean"/>
    </bean>
  </cxfse:pojo>
</cxfse:endpoint>
Using the <jaxws:endpoint>, I have seen only the implementor attribute taking a
classname. Is it possible to use bean ref as implementor ?

3/ My first bundle
I have wrote my first bundle to migrate one of my cxfse components.
In the META-INF/spring/beans.xml, I have define something like this :

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
       xmlns:fsb="http://fsb.fimasys.com"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
        http://servicemix.apache.org/cxfse/1.0
http://servicemix.apache.org/cxfse/1.0/servicemix-cxf-se.xsd">
  [...]
  <cxfse:endpoint endpoint="myService" service="Services">
    <cxfse:pojo>
        <bean class="myClassImpl">
            <property name="proxy" ref="ejbProxy"/>
        </bean>
    </cxfse:pojo>
  </cxfse:endpoint>
</beans>

myClassImpl contains the @WebService annotations and implements an interface with
@WebService annotation too.

In the pom.xml, I have :
[...]
<packaging>bundle</packaging>
[...]
         <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <configuration>
               <instructions>
                  <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
                  <Import-Package>
                    javax.jws,
                    META-INF.cxf,
                    META-INF.cxf.osgi
                  </Import-Package>
                  <Private-Package>MyServicePackage.*</Private-Package>
                 
<Require-Bundle>org.apache.servicemix.bundles.woodstox-3.2.3</Require-Bundle>
               </instructions>
            </configuration>
         </plugin>
[...]

I have build my bundle using :
mvn org.apache.felix:maven-bundle-plugin:bundle

I have installed this bundle (using the shell) using :
osgi install file:/....
osgi start bundle_id

The bundle is installed and started correctly.

But, doing nmr list in the SMX shell, I can't see any endpoints defined.

Now, how can I expose this bundle using another bundle (or component) for example
in HTTP (SOAP), file or JMS ?

4/ Advice to migrate from SMX3 to SMX4
As I don't have a lot of services in my SMX3, I would like to fully migrate to
SMX4 to be ready for the future :).
In my mind, the best way is to reimplement all my old SUs/SUa using OSGi bundles.
Is it a good way ?
Freeman has said to me that it's possible to have a myServices.xml file in the
deploy directory containing all my services definition (endpoints, beans, etc).
In this kind of file, how can I refer OSGi bundles (that I have previously
installed and deploy) (it's quite the same question that in the point 3) ?
Is OSGi bundles is the good way to provide services in the NMR or should I use :
- basic jar files containing my beans
- a myServices.xml in the deploy directory containing services/endpoints
declaration using my beans

Thanks a lot for your feedback :)

Regards
JB
--
Jean-Baptiste Onofré
jb@nanthrax.net
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net



Reply | Threaded
Open this post in threaded view
|

Re: Several questions around SMX4

Jean-Baptiste Onofré
In reply to this post by Jean-Baptiste Onofré
Thank you so much for your answer Gert.

Now things begin to be more clear :)

I resume my testing tomorrow morning and keep you posted.

I think that, for my needs, I will use (and test) :
- service implementations using OSGi bundles
- services mediations and BC using a "central" XML files in the deploy directory

Thanks again,
JB
--
Jean-Baptiste Onofré
[hidden email]
BuildProcess/AutoDeploy Project Leader
http://buildprocess.sourceforge.net

On Thu 30/10/08 22:55, "Gert Vanthienen" [hidden email] wrote:
>
> JB,
>
> 1/ Yes, if you register the service in the OSGi context, you can access
> it
from that context (e.g. by importing it with Spring DM functionality) but
> it
is not available as a service on the NMR.  If you do make it available
> on
the NMR, you can e.g. expose it from a JBI BC endpoint on the same
> NMR.
> 2/ According to the information on
> http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.
> html, you
should be able to specify implementor="#myBean" to refer to a Spring bean
> to
implement the service.
>
> 3/ You need additional imports (for the endpoint classes you're using),
> but
basically this should work.  You also want to add <bean
> class="org.apache.servicemix.common.osgi.EndpointExporter"/> to export
> the
endpoints you defined from your bundle.  There are a few examples waiting
> to
be added to the distribution in
> https://issues.apache.org/activemq/browse/SMX4-83.
> Especially the proxy
example in the zip file attached to this issue might give you more
> information about how to do this.
>
> 4/ For migrating to SMX4, you can start by simply deploying your
> exisiting
SA on the new container.  Next, you probably want to start leveraging
> the
possibility of using OSGi packaging instead of JBI packaging.  You can
> also
use the plain XML file approach as you mention.  The question about
> importing classes in the XML file's OSGi 'bundle' is a very fair one.
> Could
you raise a JIRA issue so we add an example on how to do this to the

> distribution?
>
> Regards,
>
> Gert
>
>
> Jean-Baptiste Onofré wrote:
> >
> > Hi all,
> >
> > I have several questions around SMX4.
> >
> > 1/ cxf-nmr and cxf-osgi example
> > Both example are quite the same except that the
> <jaxws:endpoint> tag
> address
> > attribute is not the same :
> > - in the case of the cxf-nmr, the address is set to
> nmr:HelloWorld
> - in the case of the cxf-osgi, the address is set to
> /HelloWorld
> Does it mean that to register the OSGi bundle in the
> NMR, I need to use
> the first
> > address format ?
> > I guess that registering the bundle in the NMR is
> the only manner to
> expose the
> > bean via another component (such as JMS, http, etc).
> Correct ?
>
> > 2/ Using bean for jaxws implementor
> > In the cxf examples, Guillaume uses the
> <jaxws:endpoint> which looks like
> the
> > <cxfse:endpoint> previous
> component.
> In my SMX3 services, I uses a SU with something like
> :
> <bean id="myOtherBean"
> class="MyOtherBean">
>   <property name="arg0"
> value="test"/>
> </bean>
> > <cxfse:endpoint endpoint="MyService"
> service="GlobalService">
>   <cxfse:pojo>
> >     <bean class="myBean">
> >       <property name="otherBean"
> ref="myOtherBean"/>
>     </bean>
> >   </cxfse:pojo>
> > </cxfse:endpoint>
> > Using the <jaxws:endpoint>, I have seen only
> the implementor attribute
> taking a
> > classname. Is it possible to use bean ref as
> implementor ?
>
> > 3/ My first bundle
> > I have wrote my first bundle to migrate one of my
> cxfse components.
> In the META-INF/spring/beans.xml, I have define
> something like this :
>
> > <beans xmlns="http://www.springframework.org/schema/beans"
>
> >        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>        xmlns:cxfse="http://servicemix.apache.org/cxfse/1.0"
>>        xmlns:fsb="http://fsb.fimasys.com"
>>        xsi:schemaLocation="
> >         http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans.xsd
>>         http://servicemix.apache.org/cxfse/1.0
>> http://servicemix.apache.org/cxfse/1.0/servicemix-cxf-se.xsd"&g
> t;
>>   [...]
> >   <cxfse:endpoint endpoint="myService"
> service="Services">
>     <cxfse:pojo>
> >         <bean class="myClassImpl">
> >             <property name="proxy"
> ref="ejbProxy"/>
>         </bean>
> >     </cxfse:pojo>
> >   </cxfse:endpoint>
> > </beans>
> >
> > myClassImpl contains the @WebService annotations and
> implements an
> interface with
> > @WebService annotation too.
> >
> > In the pom.xml, I have :
> > [...]
> >
> <packaging>bundle</packaging>
> [...]
> >          <plugin>
> >            
> <groupId>org.apache.felix</groupId>
>            
> <artifactId>maven-bundle-plugin</artifactId>
>             <configuration>
> >                <instructions>
> >                  
> >
> <Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
>                   <Import-Package>
> >                     javax.jws,
> >                     META-INF.cxf,
> >                     META-INF.cxf.osgi
> >                  
> </Import-Package>
>                  
> <Private-Package>MyServicePackage.*</Private-Package>
>                  
> >
> <Require-Bundle>org.apache.servicemix.bundles.woodstox-3.2.3</Requ
> ire-Bundle>
>                </instructions>
> >             </configuration>
> >          </plugin>
> > [...]
> >
> > I have build my bundle using :
> > mvn
> org.apache.felix:maven-bundle-plugin:bundle
>
> > I have installed this bundle (using the shell) using
> :
> osgi install file:/....
> > osgi start bundle_id
> >
> > The bundle is installed and started
> correctly.
>
> > But, doing nmr list in the SMX shell, I can't see
> any endpoints defined.
>
> > Now, how can I expose this bundle using another
> bundle (or component) for
> example
> > in HTTP (SOAP), file or JMS ?
> >
> > 4/ Advice to migrate from SMX3 to SMX4
> > As I don't have a lot of services in my SMX3, I
> would like to fully
> migrate to
> > SMX4 to be ready for the future :).
> > In my mind, the best way is to reimplement all my
> old SUs/SUa using OSGi
> bundles.
> > Is it a good way ?
> > Freeman has said to me that it's possible to have a
> myServices.xml file in
> the
> > deploy directory containing all my services
> definition (endpoints, beans,
> etc).
> > In this kind of file, how can I refer OSGi bundles
> (that I have previously
> installed and deploy) (it's quite the same question
> that in the point 3) ?
> Is OSGi bundles is the good way to provide services
> in the NMR or should I
> use :
> > - basic jar files containing my beans
> > - a myServices.xml in the deploy directory
> containing services/endpoints
> declaration using my beans
> >
> > Thanks a lot for your feedback :)
> >
> > Regards
> > JB
> > --
> > Jean-Baptiste Onofré
> > [hidden email]
> et
> BuildProcess/AutoDeploy Project Leader
> > http://buildprocess.sourceforge.net
>>
> >
> >
> >
> >
> >
>
>
> -----
> ---
> Gert Vanthienen
> http://gertvanthienen.blogspot.com
--
> View this message in context:
http://www.nabble.com/Several-questions-around-SMX4-tp20244740p
> 20256265.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Several questions around SMX4

Jean-Baptiste Onofré
In reply to this post by Jean-Baptiste Onofré
 Hi Gert,

 The two links that you have mentioned in your e-mail are not yet
available.
 Anyway, your answer is enough for me (for now :)).

 I will open a new JIRA and put all my SMX4 services samples. I will
make a docbook XML file containing explanation how to create and build
each services samples (to be included in the SMX4 tutorial).

 Regards
 JB
 --
 Jean-Baptiste Onofré
 [hidden email]
 BuildProcess/AutoDeploy Project Leader
 http://buildprocess.sourceforge.net

 On Thu 30/10/08 22:55, Gert Vanthienen [hidden email]
wrote:

 JB,

 1/ Yes, if you register the service in the OSGi context, you can
access it
 from that context (e.g. by importing it with Spring DM
functionality) but it
 is not available as a service on the NMR. If you do make it
available on
 the NMR, you can e.g. expose it from a JBI BC endpoint on the same
NMR.

 2/ According to the information on
 http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html,
[1] you
 should be able to specify implementor="#myBean" to refer to a Spring
bean to
 implement the service.

 3/ You need additional imports (for the endpoint classes you're
using), but
 basically this should work. You also want to add
 class="org.apache.servicemix.common.osgi.EndpointExporter"/> to
export the
 endpoints you defined from your bundle. There are a few examples
waiting to
 be added to the distribution in
 https://issues.apache.org/activemq/browse/SMX4-83. [2] Especially
the proxy
 example in the zip file attached to this issue might give you more
 information about how to do this.

 4/ For migrating to SMX4, you can start by simply deploying your
exisiting
 SA on the new container. Next, you probably want to start leveraging
the
 possibility of using OSGi packaging instead of JBI packaging. You
can also
 use the plain XML file approach as you mention. The question about
 importing classes in the XML file's OSGi 'bundle' is a very fair
one. Could
 you raise a JIRA issue so we add an example on how to do this to the

 distribution?

 Regards,

 Gert

 Jean-Baptiste Onofré wrote:
 >
 > Hi all,
 >
 > I have several questions around SMX4.
 >
 > 1/ cxf-nmr and cxf-osgi example
 > Both example are quite the same except that the  tag
 > address
 > attribute is not the same :
 > - in the case of the cxf-nmr, the address is set to nmr:HelloWorld

 > - in the case of the cxf-osgi, the address is set to /HelloWorld
 > Does it mean that to register the OSGi bundle in the NMR, I need
to use
 > the first
 > address format ?
 > I guess that registering the bundle in the NMR is the only manner
to
 > expose the
 > bean via another component (such as JMS, http, etc). Correct ?
 >
 > 2/ Using bean for jaxws implementor
 > In the cxf examples, Guillaume uses the  which looks like
 > the
 >  previous component.
 > In my SMX3 services, I uses a SU with something like :
 >  
 >

 >  
 >  
 >  
 >  
 >

 >
 >
 >
 > Using the , I have seen only the implementor attribute
 > taking a
 > classname. Is it possible to use bean ref as implementor ?
 >
 > 3/ My first bundle
 > I have wrote my first bundle to migrate one of my cxfse
components.
 > In the META-INF/spring/beans.xml, I have define something like
this :
 >
 >

Links:
------
[1]
http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html,
[2] https://issues.apache.org/activemq/browse/SMX4-83.
[3] http://www.w3.org/2001/XMLSchema-instance
[4] http://servicemix.apache.org/cxfse/1.0
[5] http://fsb.fimasys.com
[6] http://www.springframework.org/schema/beans</font
[7]
http://www.springframework.org/schema/beans/spring-beans.xsd</font
[8] http://servicemix.apache.org/cxfse/1.0</font
[9] http://servicemix.apache.org/cxfse/1.0/servicemix-cxf-se.xsd
[10] mailto:[hidden email]
[11] http://buildprocess.sourceforge.net</font
[12] http://gertvanthienen.blogspot.com
[13]
http://www.nabble.com/Several-questions-around-SMX4-tp20244740p20256265.html
Reply | Threaded
Open this post in threaded view
|

Re: Several questions around SMX4

Jean-Baptiste Onofré
In reply to this post by Jean-Baptiste Onofré
 Hi Gert,

 Well, I have resumed my migration to SMX4 using OSGi.

 First of all, I have created a OSGi bundle using CXF to use an
existing bean.

 The pom.xml defines the bundle packaging and I use Felix maven
plugin to build my bundle.

 In the META-INF/spring/beans.xml file, I have the following
definition :

 <?xml version="1.0" encoding="UTF-8"?>

 <beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:jaxws="http://cxf.apache.org/jaxws"
 xsi:schemaLocation="
 http://www.springframework.org/schema/beans [1]
http://www.springframework.org/schema/beans/spring-beans.xsd [2]
 http://cxf.apache.org/jaxws [3]
http://cxf.apache.org/schemas/jaxws.xsd [4]">

 <import resource="classpath:META-INF/cxf/cxf.xml"/>
 <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
 <import
resource="classpath:META-INF/cxf/transport/nmr/cxf-transport-nmr.xml"/>

 <bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 <property name="locations">

<value>classpath:/automatic-validation-service-config.properties</value>
 </property>
 </bean>

 <bean id="jndiTemplate"
class="org.springframework.jndi.JndiTemplate">
 <property name="environment">
 <props>
 <prop key="java.naming.factory.initial">
 ${bos.jndiContextFactory}
 </prop>
 <prop key="java.naming.provider.url">
 ${bos.jndiUrlProvider}
 </prop>
 </props>
 </property>
 </bean>

 <bean id="ejbProxy"
class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean">
 <property name="jndiName"
value="ejb/profinance/back-office/AutomaticSimulationService"/>
 <property name="businessInterface"
value="com.fimasys.finance.profinance.components.simulation.common.ejb.AutomaticSimulationSession"/>
 <property name="homeInterface"
value="com.fimasys.finance.profinance.components.simulation.common.ejb.AutomaticSimulationSessionHome"/>
 <property name="jndiTemplate" ref="jndiTemplate"/>
 </bean>

 <bean id="automaticSimulation"
class="com.fimasys.fsb.services.AutomaticSimulationService">
 <property name="proxy" ref="ejbProxy"/>
 </bean>

 <jaxws:endpoint id="AutomaticSimulation"
 implementor="#automaticSimulation"
 address="nmr:fsb/AutomaticSimulation/AutomaticSimulationBean"/>

 </beans>

 And my AutomaticSimulation class looks like this :
 /**
 * Delegator to the AutomaticSimulationSession EJB
 *
 * @author <a href="mailto:[hidden email]">Jean-Baptiste Onofré</a>
 */
 package com.fimasys.fsb.services;

 import javax.jws.WebService;

 //import
com.fimasys.finance.profinance.components.simulation.common.ejb.AutomaticSimulationSession;

 @WebService(endpointInterface =
"com.fimasys.fsb.services.AutomaticSimulationService")
 public class AutomaticSimulationServiceImpl implements
AutomaticSimulationService {

 public String getSimulResults(String idCont, int simulationTypeId) {

 return null;
 }

 }

 implementing the following interface :
 package com.fimasys.fsb.services;

 import javax.jws.WebService;

 @WebService
 public interface AutomaticSimulationService {

 public String getSimulResults(String idCont, int simulationTypeId);

 }

 The build is OK and I have installed my bundle using the SMX kernel
shell :
 osgi install file:/path/to/myBundle.jar

 and start the bundle using :
 osgi start 85

 Using osgi list, I can see :
 [ 85] [Active ] [ 50] FSB :: Services :: OSGi :: Automatic
Simulation (4.0)

 So it seems that the bundle is correctly deployed and started.

 But a first thing that it's strange for me is, if I make, in the SMX
Kernel shell :
 servicemix@devfms-6:/> nmr list
 Endpoints
 ---------

 I can't see any endpoint define whereas I have used
address=nmr:fsb/AutomaticSimulation/AutomaticSimulationBean in the
jaxws endpoint.
 I expect an entry in the nmr corresponding to my endpoint, no ?

 Anyway, I have continu my test by defining a fsb-core.xml file in
the deploy directory. This file contains :
 <beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:http="http://servicemix.apache.org/http/1.0"
 xmlns:fsb="urn:fsb"
 xmlns:osgi="http://www.springframework.org/schema/osgi"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="
 http://www.springframework.org/schema/beans [5]
http://www.springframework.org/schema/beans/spring-beans.xsd [6]
 http://www.springframework.org/schema/osgi [7]
http://www.springframework.org/schema/osgi/spring-osgi.xsd [8]
 http://servicemix.apache.org/http/1.0 [9]
http://servicemix.apache.org/http/1.0/servicemix-http.xsd [10]">

 <bean class="org.apache.servicemix.common.osgi.EndpointExporter"/>

 <http:endpoint service="fsb:AutomaticSimulation"
endpoint="AutomaticSimulationHTTP"
 role="consumer"
 locationUri="http://0.0.0.0:8192/FSB/AutomaticSimulation"
 defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
 soap="false"
 targetService="fsb:AutomaticSimulation"
 targetEndpoint="fsb:AutomaticSimulationBean"/>

 </beans>

 My purpose is to expose the OSGi bundle registered in the NMR using
a HTTP BC.

 Using osgi list in the SMX Kernel shell, I can see :
 [ 86] [Installed ] [ 50] fsb-core (0.0.0)

 So it seems that the XML file has been take care by SMX.

 But, once again, if I make nmr list in the SMX Kernel shell, I can't
see any NMR endpoints define :
 servicemix@devfms-6:/> nmr list
 Endpoints
 ---------

 As I use <bean
class="org.apache.servicemix.common.osgi.EndpointExporter"/> in my XML
file, I was thinking that my HTTP endpoint appears in the NMR
endpoints.

 So, is my understanding of the NMR shell usage is correct ?
 Why I can't see any NMR endpoints ?

 Thanks again for your feedback.

 Regards
 JB
 --
 Jean-Baptiste Onofré
 [hidden email]
 BuildProcess/AutoDeploy Project Leader
 http://buildprocess.sourceforge.net

 On Thu 30/10/08 22:55, Gert Vanthienen [hidden email]
wrote:

 JB,

 1/ Yes, if you register the service in the OSGi context, you can
access it
 from that context (e.g. by importing it with Spring DM
functionality) but it
 is not available as a service on the NMR. If you do make it
available on
 the NMR, you can e.g. expose it from a JBI BC endpoint on the same
NMR.

 2/ According to the information on
 http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html,
[11] you
 should be able to specify implementor="#myBean" to refer to a Spring
bean to
 implement the service.

 3/ You need additional imports (for the endpoint classes you're
using), but
 basically this should work. You also want to add
 class="org.apache.servicemix.common.osgi.EndpointExporter"/> to
export the
 endpoints you defined from your bundle. There are a few examples
waiting to
 be added to the distribution in
 https://issues.apache.org/activemq/browse/SMX4-83. [12] Especially
the proxy
 example in the zip file attached to this issue might give you more
 information about how to do this.

 4/ For migrating to SMX4, you can start by simply deploying your
exisiting
 SA on the new container. Next, you probably want to start leveraging
the
 possibility of using OSGi packaging instead of JBI packaging. You
can also
 use the plain XML file approach as you mention. The question about
 importing classes in the XML file's OSGi 'bundle' is a very fair
one. Could
 you raise a JIRA issue so we add an example on how to do this to the

 distribution?

 Regards,

 Gert

 Jean-Baptiste Onofré wrote:
 >
 > Hi all,
 >
 > I have several questions around SMX4.
 >
 > 1/ cxf-nmr and cxf-osgi example
 > Both example are quite the same except that the  tag
 > address
 > attribute is not the same :
 > - in the case of the cxf-nmr, the address is set to nmr:HelloWorld

 > - in the case of the cxf-osgi, the address is set to /HelloWorld
 > Does it mean that to register the OSGi bundle in the NMR, I need
to use
 > the first
 > address format ?
 > I guess that registering the bundle in the NMR is the only manner
to
 > expose the
 > bean via another component (such as JMS, http, etc). Correct ?
 >
 > 2/ Using bean for jaxws implementor
 > In the cxf examples, Guillaume uses the  which looks like
 > the
 >  previous component.
 > In my SMX3 services, I uses a SU with something like :
 >  
 >

 >  
 >  
 >  
 >  
 >

 >
 >
 >
 > Using the , I have seen only the implementor attribute
 > taking a
 > classname. Is it possible to use bean ref as implementor ?
 >
 > 3/ My first bundle
 > I have wrote my first bundle to migrate one of my cxfse
components.
 > In the META-INF/spring/beans.xml, I have define something like
this :
 >
 >

Links:
------
[1] http://www.springframework.org/schema/beans
[2] http://www.springframework.org/schema/beans/spring-beans.xsd
[3] http://cxf.apache.org/jaxws
[4] http://cxf.apache.org/schemas/jaxws.xsd
[5] http://www.springframework.org/schema/beans
[6] http://www.springframework.org/schema/beans/spring-beans.xsd
[7] http://www.springframework.org/schema/osgi
[8] http://www.springframework.org/schema/osgi/spring-osgi.xsd
[9] http://servicemix.apache.org/http/1.0
[10] http://servicemix.apache.org/http/1.0/servicemix-http.xsd
[11]
http://cwiki.apache.org/CXF20DOC/writing-a-service-with-spring.html,
[12] https://issues.apache.org/activemq/browse/SMX4-83.
[13] http://www.w3.org/2001/XMLSchema-instance
[14] http://servicemix.apache.org/cxfse/1.0
[15] http://fsb.fimasys.com
[16] http://www.springframework.org/schema/beans</font
[17]
http://www.springframework.org/schema/beans/spring-beans.xsd</font
[18] http://servicemix.apache.org/cxfse/1.0</font
[19] http://servicemix.apache.org/cxfse/1.0/servicemix-cxf-se.xsd
[20] mailto:[hidden email]
[21] http://buildprocess.sourceforge.net</font
[22] http://gertvanthienen.blogspot.com
[23]
http://www.nabble.com/Several-questions-around-SMX4-tp20244740p20256265.html