The idea was to package POJO + xbeans as an OSGI bundle, just to be able to dynamically deploy/undeploy it. I am now wondering what the difference is between: 1. package it as OSGI bundle myself (using maven-bundle plugin) 2. create a JBI packaging as SA + SU and deploy so it is implicitly converted to a bundle.
Other than having to maintain SA and its pom. But, I cannot seem to make (1) work! Thanks! saravanan.t wrote: > > Hi, > > It doesn't really work. > > When I keep it as xbeans.xml inside resources folder, endpoint is not > activated. But the osgi bundle is started! > > And when I keep it under resources/META-INF/spring folder as you > mentioned, I get deployment error: > > SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is > strict, but no declaration can be found for element 'bean:endpoint' > > Note that I am trying to deploy a POJO on servicemix-bean component and > packing it as OSGI bundle. > > Thanks! > > > > > Freeman Fang wrote: >> >> Hi, >> You need add >> <bean class="org.apache.servicemix.common.osgi.EndpointExporter" /> >> in your xbean.xml >> We have example shipped with SMX 4.0 to demostrate it, take a look at >> examples/simple in the kit. >> Freeman >> >> saravanan.t wrote: >>> Hi, >>> >>> Its kind of very late in following up...hope you don't mind. >>> >>> You mentioned that I could make a OSGI bundle for servicemix bean >>> component. >>> It seems I cannot use the xbeans.xml file as such, can you tell me what >>> is >>> wrong here please. >>> >>> I have a valid bundle with Import/Exports, and this xbeans.xml file: >>> >>> <beans xmlns="http://www.springframework.org/schema/beans" >>> xmlns:bean="http://servicemix.apache.org/bean/1.0" >>> xmlns:beanservice="http://www.moodysanalytics.com/beanservice" >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>> xmlns:esb="http://esbinaction.com/examples" >>> xmlns:jms="http://servicemix.apache.org/jms/1.0" >>> >>> xmlns:osgix="http://www.springframework.org/schema/osgi-compendium" >>> xsi:schemaLocation="http://www.springframework.org/schema/beans >>> >>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> >>> >>> >>> <bean:endpoint service="beanservice:service2" endpoint="endpoint2"> >>> <bean:bean> >>> <bean class="com.pocproject.provider.Service2SmxImpl"/> >>> </bean:bean> >>> </bean:endpoint> >>> >>> </beans> >>> >>> I kept this first under META-INF/spring, but I got some error. If i keep >>> it >>> under resources the spring configuration seem to be inactive and there >>> is no >>> endpoints! Any clue...? >>> >>> Thanks a lot! >>> >>> >>> >>> >>> >>> Ashwin Karpe wrote: >>> >>>> Hi, >>>> >>>> The answer is that both are possible if you are using Servicemix 4 >>>> OSGi. >>>> As for which one to follow, Option A with 2 SU's is the traditional way >>>> and if you prefer being JBI spec compliant then that is the way to go. >>>> >>>> If not, then option 2 is perfectly ok and rather simpler too. >>>> Personally I >>>> find the JBI spec overly controlling with respect to packaging and can >>>> be >>>> rather painful when dealing with a large set of SU's/SA's in >>>> conjunction >>>> with Maven. >>>> >>>> I would personally prefer option 2 since you are fully compliant with >>>> JBI >>>> in all things except packing for which you rely on Spring/OSGi. >>>> >>>> Cheers, >>>> >>>> Ashwin... >>>> >>>> >>>> saravanan.t wrote: >>>> >>>>> Thanks guys for your quick responses! >>>>> >>>>> I have a followup question: >>>>> >>>>> what are the options for deployment here? >>>>> >>>>> do i need to develop/deploy as JBI: one su for bean and another for >>>>> cxf-bc? >>>>> >>>>> or I can develop/deploy one OSGI service consisting the bean code & >>>>> cxf-bc config (with POM package as osgi packaging) >>>>> >>>>> maybe it is not either/or, and if both ways are possible, which way is >>>>> recommended. your comments are appreciated. >>>>> >>>>> Thanks! >>>>> >>>>> >>>>> Ashwin Karpe wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> You can definately front it with a servicemix bean. It is not >>>>>> necessary >>>>>> to have a CXF-SE. >>>>>> >>>>>> You will need to obviously then consume, transform the payload and >>>>>> send >>>>>> an appropriate response via the servicemix-bean. Also, you need to >>>>>> appropriately handle the different MEPs (In-Only etc) for methods >>>>>> invoked by the CXF-BC correctly in the POJO. >>>>>> >>>>>> Hope this helps. >>>>>> >>>>>> Cheers, >>>>>> >>>>>> Ashwin... >>>>>> >>>>>> >>>>>> saravanan.t wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I have a (beginner) question on fronting a pojo with CXF-BC. Can I >>>>>>> do >>>>>>> this: >>>>>>> >>>>>>> 1) using servicemix-bean component, expose this pojo. >>>>>>> 2) front this endpoint using CXF-BC >>>>>>> >>>>>>> or >>>>>>> >>>>>>> Do I have to create a CXF-SE (with annotated pojo) and only then i >>>>>>> can >>>>>>> front it using CXF-BC? >>>>>>> >>>>>>> Thanks and have a nice day! >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >>> >> >> >> -- >> Freeman Fang >> ------------------------ >> Open Source SOA: http://fusesource.com >> >> >> > > -- View this message in context: http://www.nabble.com/SMX4%3A-exposing-a-pojo-externally-with-cxf-bc-tp23154504p23759251.html Sent from the ServiceMix - User mailing list archive at Nabble.com.
