Hi,

What's the output of "la" command?
What's your bundle status?
-------------
Freeman(Yue) Fang

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



On 2014-5-16, at 上午12:55, constv wrote:

> I have a bundle that should export references to shared services (in Karaf
> 3.0.1) This used to work fine in my other applications. Everything seems
> fine: I have my blueprint XML file under /resources/OSGI-INF/blueprint.
> Here's the sample contents:
> 
> <blueprint default-activation="eager"
> xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
> 
> xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0";>
> 
>    <cm:property-placeholder persistent-id="myConfigId"
> update-strategy="reload">
> 
>        <cm:default-properties>
>            <cm:property name="ds.oracle.connection.url"
> value="jdbc:oracle:thin:@myhost:1521:SMTH"/>
>            <cm:property name="ds.oracle.connection.username" value="user"/>
>            <cm:property name="ds.oracle.connection.driver"
> value="oracle.jdbc.driver.OracleDriver"/>
>            <cm:property name="ds.oracle.connection.password"
> value="password"/>
>        </cm:default-properties>
>    </cm:property-placeholder>
> 
> 
> 
> 
>    <bean id="oracleDataSource" class="oracle.jdbc.pool.OracleDataSource">
>        <property name="URL" value="${ds.oracle.connection.url}"/>
>        <property name="user" value="${ds.oracle.connection.username}"/>
>        <property name="password" value="${ds.oracle.connection.password}"/>
>    </bean>
> 
>    <bean id="jdbcTemplate"
> class="org.springframework.jdbc.core.JdbcTemplate">
>        <property name="dataSource" ref="oracleDataSource"/>
>    </bean>
>    <bean id="someSharedDao"
> class="com.mycompany.myapp.common.dataaccess.SomeDao">
>        <property name="jdbcTemplate" ref="jdbcTemplate"/>
>    </bean>
>    *<service interface="com.mycompany.myapp.common.dataaccess.SomeDao"
> ref="someSharedDao"/>*
> 
>    ... other similar bean definitions and exports...
> 
> </blueprint>
> 
> 
> 
> In my Maven POM I am ensuring that the packages with the classes whose
> instances are to be shared are exported:
> 
> <plugin>
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>                <version>${maven-bundle-plugin.version}</version>
>                <extensions>true</extensions>
> 
>                <configuration>
>                    <instructions>
> 
> <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
>                        <Import-Package>
>                            <Import-Package>
>                                *
>                            </Import-Package>
>                        </Import-Package>
>                       <DynamicImport-Package>*</DynamicImport-Package>
>                        <Export-Package>
>                            com.mycompany.myapp.common*,
>                             ... etc
> 
>                        </Export-Package>
>                    </instructions>
>                </configuration>
>            </plugin> 
> 
> All dependencies seem to be defined properly and installed in Karaf. The
> bundle deployes without errors, but I don't think that the blueprint context
> is being created for this bundle, I am not seeing any indication of that in
> the logs. i have never seen this before, it used to be fairly
> straightforward. 
> 
> When I do the OSGi  ls command on the bundle, it renders nothing, so no
> beans are exported.
> 
> What could cause the Blueprint XML files to be ignored?  I am positive that
> the config files are packaged within the bundle JARs - inside the JAR under
> \OSGI-INF\blueprint\ .  Any ideas?
> 
> Thanks!
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://karaf.922171.n3.nabble.com/Not-seeing-services-being-exported-via-blueprint-tp4033133.html
> Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to