Thanks for the note Freeman.   Here is the relevant tags from the REST 
blueprint xml 


 <jaxrs:server address="/coreservices" id="rsServer">
        <jaxrs:inInterceptors>
            <ref component-id="logInbound"/>
        </jaxrs:inInterceptors>

        <jaxrs:serviceBeans>
            <ref component-id="searchRestServiceImpl" />
        </jaxrs:serviceBeans>

        <jaxrs:outInterceptors>
            <ref component-id="logOutbound"/>
        </jaxrs:outInterceptors>
    </jaxrs:server>



    <bean id="searchRestServiceImpl" 
class=“xxx.search.rest.SearchRestServiceImplS”>
        <!—Service beans —>
       <property name="xxxService" ref=“xxxServiceBean"/>
        … 
        ...
        <property name=“yyyService" ref=“yyyTranslatorServiceBean”/>

                
    </bean>


I don’t think the following is relevant but I am using Camel for multicasting 
to the service beans. 

    <camelContext id="camel" xmlns="http://camel.apache.org/schema/blueprint"; >
        <packageScan>
            <package>xxx.search.camel.aggregator</package>
            <excludes>**.*Test*</excludes>
            <includes>**.*</includes>
        </packageScan>
    </camelContext>

In fact, the skeleton of the project looks more like 
https://github.com/arunma/karafcxfcamel (Except for the .kar)



Cheers,
Arun Manivannan


On March 27, 2014 at 3:45:50 PM, Freeman Fang ([email protected]) wrote:

Hi,

Could you please elaborate how you define the dependency between REST Service 
and ServiceImpl bundles?
Using OSGi service? Using blueprint to refer the OSGi service?
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat



On 2014-3-26, at 下午8:07, Arun Manivannan wrote:

This is a little embarrassing considering I have been meddling around with 
Karaf for a while now.

I have a service implementation bundle and a CXF-REST bundle. If I throw in the 
REST bundle before the ServiceImpl bundle into my deploy folder, it waits for 
the service bundle for a few seconds and then goes into a Failed state. 
Obviously, all goes well if I do it in sequence - ServiceImpl first and REST 
next. I wanted my REST service to wait forever until the ServiceImpl is 
deployed (just like the rest of the OSGi bundles)

My guess is that there is some place where I should be increasing the timeout 
to wait forever. This guess is based on the fact that for a PaxExam test, I 
should do so.


@Inject @Filter(timeout = 300000) BootFinished bootFinished;  
(source : KarafTestSupport.java)

Am I looking at the wrong place or should I be looking at other places for 
hints like Activator or Import/Export packages?

My REST maven-bundle-plugin looks like this : 





    <build>

        <plugins>

            <plugin>

                <groupId>org.apache.felix</groupId>

                <artifactId>maven-bundle-plugin</artifactId>

                <extensions>true</extensions>

                <configuration>

                    <instructions>

                        
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>

                        <Bundle-Version>${project.version}</Bundle-Version>

                        <Bundle-Activator>xxxx.xxx
.rest.Activator</Bundle-Activator>

                        <Import-Package>*</Import-Package>

                    </instructions>

                </configuration>

            </plugin>

        </plugins>

    </build>



I understand that deploying as a .kar file along with the the rest of the 
libraries (I deploy the dependencies as a .kar) would solve it but I do not 
want to do that for the REST and Impl bundles because of faster deployments 
(and bandwidth sizes - I am on EC2).


Cheers,
Arun Manivannan


Reply via email to