|
|
how to use equinox blueprint services in spring osgi dynamic modules.
I have imported the blueprint service in spring configuration file as
lt;beans xmlns=quot;schema/beansquot; xmlns:xsi=quot;2001/XMLSchema-instancequot; xmlns sgi=quot;schema/osgiquot; xmlns:bp=quot;xmlns/blueprint/v1.0.0quot; xsi:schemaLocation=quot;schema/beans schem...ring-beans.xsd schema/osgi schem...pring-osgi.xsd xmlns/blueprint/v1.0.0quot;gt;
lt;!-- Export the simpleService bean (defined in a separate config file in this case) as an OSGi service --gt;lt;!-- definitions using elements of the osgi namespace can be included in this file. There is no requirement to keep these definitions in a separate file if you do not want to. The rationale for keeping these definitions separate is to facilitate integration testing of the bundle outside of an OSGi container --gt;
lt;osgi:reference id=quot;simpleServiceOsgiquot;
interface=quot;com.test.simpleserv.MyServicequot; /gt;lt;!--
lt;bp:blueprintgt;
lt;bp:reference id=quot;echoServRefquot; interface=quot;com.test.simpleserv.Echoquot;gt;lt;/bp:referencegt;
lt;/bp:blueprintgt;
and my blueprint config file was :
lt;service id=quot;echoServicequot; interface=quot;com.ebay.test.simpleserv.Echoquot; ref=quot;echoquot;/gt; lt;bean id=quot;echoquot; class=quot;com.ebay.test.simpleserv.internal.EchoImplquot; gt; lt;property name=quot;messagequot; value=quot;Echo: quot;/gt; lt;!-- lt;property name=quot;pkgAdminquot; ref=quot;pkgAdminquot;/gt;--gt; lt;/beangt;but when iam trying to use it when running the test iam getting below excpetionests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 2.297 sec lt;lt;lt; FAILURE!
testSimpleSpringServiceExported(com..test.simplese rvTest.SimpleServiceBundleTest) Time elapsed: 2.031 sec lt;lt;lt; ERROR!
org..beans.factory.xml.XmlBeanDefin itionStoreException: Line 26 in XML document from OSGi resource[classpath:com//test/simpleservTest/spring/context.xml|bnd.id=19|bnd.sym=org.. osgi.samples.simpleservice.test] 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..beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:404)
at org..beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:342)
at org..beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:310)
at org..beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:143)
at org..beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:178)
at org..beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:149)anythign wrong that iam doing ..? How to use blueprint services in spring osgi based view ? |
|