Access it as you would any other service with spring, services are just 
interfaces that the serviceregistry 
provides you an implementation for.

/je
On Jul 12, 2011, at 12:51 PM, jstandard wrote:

> Hello,
> 
> I'm trying to access a blueprint service defined in defaultt
> activemq-broker.xml (using Fuse ESB 4.4.0) from within my spring bean.  This
> isn't working as expected (stack trace below).  Any idea what I'm doing
> wrong?
> 
> Thanks,
>   John
> 
> <?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:camel-osgi="http://camel.apache.org/schema/osgi";
>       xmlns:osgi="http://www.springframework.org/schema/osgi";
>       xmlns:bp="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>       xsi:schemaLocation="
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
>       http://www.springframework.org/schema/osgi
> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>       http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
>       http://camel.apache.org/schema/osgi
> http://camel.apache.org/schema/osgi/camel-osgi.xsd
>       http://www.osgi.org/xmlns/blueprint/v1.0.0
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";>
> 
>       <camel-osgi:camelContext xmlns="http://camel.apache.org/schema/spring";>
>       <package>com.fusesource.camel</package>
>       </camel-osgi:camelContext>
>       
>       <bp:blueprint>
>               <bp:reference id="pooledConnectionFactory"
> interface="javax.jms.ConnectionFactory"/>
>       </bp:blueprint>
>       
>       <bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
>               <property name="connectionFactory" 
> ref="pooledConnectionFactory">
>               </property>
>       </bean>
> </beans>
> 
> 14:33:20,161 | ERROR | ExtenderThread-1 | ContextLoaderListener            |
> 85 - org.springframework.osgi.extender - 1.2.1 | Application context refresh
> failed (OsgiBundleXmlApplicationContext(bundle=camel-jms-example,
> config=osgibundle:/META-INF/spring/*.xml))
> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
> 18 in XML document from URL [bundle://227.3:0/META-INF/spring/beans.xml] is
> invalid; nested exception is org.xml.sax.SAXParseException:
> cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration
> can be found for element 'bp:blueprint'.
>       at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)[68:org.springframework.beans:3.0.5.RELEASE]
>       at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[68:org.springframework.beans:3.0.5.RELEASE]
>       at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[68:org.springframework.beans:3.0.5.RELEASE]
>       at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)[68:org.springframework.beans:3.0.5.RELEASE]
>       at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)[68:org.springframework.beans:3.0.5.RELEASE]
>       at
> org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)[68:org.springframework.beans:3.0.5.RELEASE]
>       at
> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)[82:org.springframework.osgi.core:1.2.1]
>       at
> org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)[82:org.springframework.osgi.core:1.2.1]
>       at
> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[70:org.springframework.context:3.0.5.RELEASE]
>       at
> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)[70:org.springframework.context:3.0.5.RELEASE]
>       at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$800(AbstractDelegatedExecutionApplicationContext.java:69)[82:org.springframework.osgi.core:1.2.1]
>       at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:269)[82:org.springframework.osgi.core:1.2.1]
>       at
> org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)[82:org.springframework.osgi.core:1.2.1]
>       at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:247)[82:org.springframework.osgi.core:1.2.1]
>       at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:214)[85:org.springframework.osgi.extender:1.2.1]
>       at
> org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:169)[85:org.springframework.osgi.extender:1.2.1]
>       at
> org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)[82:org.springframework.osgi.core:1.2.1]
>       at
> org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:716)[85:org.springframework.osgi.extender:1.2.1]
>       at java.lang.Thread.run(Thread.java:662)[:1.6.0_26]
> Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The
> matching wildcard is strict, but no declaration can be found for element
> 'bp:blueprint'.
>       at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
> Source)[:]
>       at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)[:]
>       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
> Source)[:]
>       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
> Source)[:]
>       at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown 
> Source)[:]
>       at
> org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown
> Source)[:]
>       at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown
> Source)[:]
>       at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown
> Source)[:]
>       at org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(Unknown
> Source)[:]
>       at 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
> Source)[:]
>       at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)[:]
>       at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)[:]
>       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)[:]
>       at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)[:]
>       at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)[:]
>       at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)[:]
>       at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)[:]
>       at
> org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)[68:org.springframework.beans:3.0.5.RELEASE]
>       at
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)[68:org.springframework.beans:3.0.5.RELEASE]
>       ... 18 more
> 
> 
> --
> View this message in context: 
> http://servicemix.396122.n5.nabble.com/Accessing-blueprint-service-from-spring-tp4579885p4579885.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to