L.S.,

Could you try running osgi:ls to verify if the activemq-broker.xml
bundle is actually exporting the services?  That way, we can figure
out if the problem is at the publishing end or in your own bundle that
is trying to access the service.

I gave things a quick try with a new 4.5.1 installation: started with
the quickstart example at
http://servicemix.apache.org/docs/4.4.x/quickstart/activemq.html and
replacing the ActiveMQ component with one called "amqref" defined like
this:

    <reference id="pooledConnectionFactory"
interface="javax.jms.ConnectionFactory" />

    <bean id="amqref"
class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="connectionFactory" ref="pooledConnectionFactory"/>
    </bean>

This worked fine for me, so perhaps something else specific in your
setup is causing things to fail.  Could you try moving the bean
definition out of the <service/> tag and checking if that bean gets
injected with a proxy to the ConnectionFactory as expected?


Regards,

Gert Vanthienen


On Tue, Apr 16, 2013 at 9:05 AM, Niels <[email protected]> wrote:
> Hey there,
>
> I'm trying to get a reference to the pooled AMQ Connectionfactory that's
> default configured in the activemq-broker.xml like this:
>
>     <service ref="pooledConnectionFactory"
> interface="javax.jms.ConnectionFactory">
>         <service-properties>
>             <entry key="name" value="localhost"/>
>         </service-properties>
>     </service>
>
> I defined my reference in the blueprint file like this:
>
>     <reference id="pooledConnectionFactory"
> interface="javax.jms.ConnectionFactory" />
>
>     <service id="socketNotificationService"
> interface="xx.xx.ContextStartupListener">
>         <bean class="xx.xx.SocketNotificationService">
>             <property name="connectionFactory" ref="pooledConnectionFactory"
> />
>         </bean>
>     </service>
>
> This seems pretty clear and straight forward. But when I try to use the
> connectionFactory in my SocketNotificationService the factory is always
> empty!
>
> Any ideas any one?
> All the bundle for ActiveMQ are activated as well.
>
> Running on: Mac OS X 10.8.3 with explicit use of Java version "1.6.0_43".
>
>
>
>
>
>
> --
> View this message in context: 
> http://servicemix.396122.n5.nabble.com/Can-get-reference-to-AMQ-ConnectionFactory-tp5716494.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to