我对Blueprint和Spring DM有点困惑:
从我的想法是真的:
没有?
我们可以期望这两个框架在未来成为一个(合并)吗?如果没有,哪一个将是最具前瞻性的?
我有一个在eclipse virgo OSGi平台上运行的spring MVC projet.当我尝试使用<osgi:reference>标记导入OSGi服务时,我得到以下异常:
Servlet /Web threw load() exception org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/osgi]
Run Code Online (Sandbox Code Playgroud)
这是我的应用程序上下文文件:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<annotation-driven />
<resources mapping="/resources/**" location="/resources/" />
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="com.apptivit.web" />
<osgi:reference id="entityService" interface="com.apptivit.db.service.AbstractEntityService"/>
</beans:beans>
Run Code Online (Sandbox Code Playgroud)
最后在我的MANIFEST.MF文件中我这样做:
Manifest-Version: 1.0
Export-Package: com.apptivit.web;uses:="org.springframework.stereotype
,org.springframework.ui,org.springframework.web.bind.annotation"
Tool: Bundlor 1.0.0.RELEASE
Import-Package: com.apptivit.db.service,
org.apache.log4j,
org.slf4j, …Run Code Online (Sandbox Code Playgroud) spring source dm server特定的Import-Bundle和OSGi的Require-Bundle有什么区别?
我很困惑是否在我的项目中使用Import-Bundle或Require-Bundle.
关于Spring配置和OSGi Blueprint(例如Gemini Blueprint)的组合是否有任何良好/最佳实践?您使用哪些XML文件?你把它们放在OSGi包中的哪个位置(META-INF/spring,OSGi-INF)?以下哪种做法可以让您将捆绑包与蓝图的非Gemini实施结合使用?
背景:我们正在从Spring/Spring DM切换到Spring/Blueprint.我知道定义<bean>元素的蓝图.但是,我们偶尔会遇到蓝图规范的有限bean定义功能无法满足我们所有需求的情况.因此,在我们的捆绑包中使用Spring配置和通过OSGi服务连接捆绑包的Blueprint似乎是一个不错的选择.
我找到了一本书"Spring DM in action".当我开始检查Spring for OSGI的最新版本时,我发现Spring已经停止了这个项目.
由于我有一些在Spring中开发的经验,我想了解我是否应继续阅读有关Spring和OSGI或切换到Spring Boot作为创建模块化应用程序的方法?
spring DM的xml配置文件<osgi:reference>和之间的区别是什么<osgi:service>.
我正在使用OSGi-(felix),SpringDM,hibernate,maven的项目.当我安装bundle时,没关系,我运行bundle id时的输出是:
LastModified 1384619994484
Headers [Manifest-Version=1.0, Bundle-Vendor=NguyenVinhLinh, Bnd-LastModified=1384619954778, Tool=Bnd-2.1.0.20130426-122213, Bundle-Name=DrugManager, Built-By=nguyenvinhlinh, Import-Package=org.hibernate,org.hibernate.classic,org.hibernate.criterion,org.springframework.beans.factory;version="[2.5,3)",org.springframework.core.io;version="[2.5,3)",org.springframework.transaction.annotation;version="[2.5,3)", Bundle-SymbolicName=DrugManagerDAO, Export-Package=drug,drugGroup,model;version="1.0.0", Bundle-Version=1.0.0, Build-Jdk=1.7.0_45, Created-By=Apache Maven Bundle Plugin, Bundle-ManifestVersion=2]
BundleContext null
Revisions [169.0]
BundleId 169
SymbolicName DrugManagerDAO
RegisteredServices null
ServicesInUse null
Version 1.0.0
Location file:/home/nguyenvinhlinh/Projects/felix-framework-4.2.1/bundle/DrugManager-1.0.jar
State 2
Bundle 169|Installed | 1|DrugManagerDAO (1.0.0)
Run Code Online (Sandbox Code Playgroud)
这就是我看到的,当我开始这个包时:
org.osgi.framework.BundleException: Unresolved constraint in bundle DrugManagerDAO [169]: Unable to resolve 169.0: missing requirement [169.0] osgi.wiring.package; (osgi.wiring.package=org.hibernate)
Run Code Online (Sandbox Code Playgroud)
这是我的beans.xml:
<?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:osgi="http://www.springframework.org/schema/osgi"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/osgi
">
<tx:annotation-driven …Run Code Online (Sandbox Code Playgroud) 我是Spring DM的新成员,我想访问Bundlecontext.我的问题是我有一个与Activator捆绑,但它没有xml配置文件.我无法触摸此捆绑包,然后我需要访问BundleContext和serviceReference以获取我的捆绑包中的服务.我在捆绑中使用Spring DM.那么,我怎么能得到BundleContext?
谢谢!
问候!
我有一个应用程序,我必须使用Spring根据OSGi包中的一些业务条件加载bean.这个bean不用于导出,用于计算inisde我的包.基本上我有一个实际的服务组件,它被导出,并且它必须在内部使用这个Spring bean.但...
有没有办法做到这一点?
我正在使用Fuse ESB(ServiceMix),我一直在搜索,希望在运行命令'osgi:list'时找到对各种标题的更好解释.即我想要理解的两个列是'Blueprint'和'Spring'.我猜测他们的各种状态是指什么,但随后出现的其他情况让我对此提出质疑.
如果有人可以提供一些解释,或者更好,请指出一些解释各个列及其潜在价值的文档,这将是最有帮助的.
其实我正在阅读Spring Dynamic Modules和OSGi.所有这些都引用了URL http://www.springsource.org/osgi来下载相关的库和jar文件.
您可以验证,每次我点击此网址时,它都会显示以下错误页面:
所以我正在寻找替代方案,然后找到可以在这里找到的manning论坛https://forums.manning.com/posts/list/25280.page 并在这个论坛中他们回答:
最后,当我点击最后一个链接时,它被重定向到http://spring.io/projects网站,其中没有Spring DM的迹象.
我的问题是如何/在哪里可以下载最新版本的Spring DM库?
我需要等待一段时间才能关闭我的OSGI上下文.(花一些时间来完成当前正在运行的任务).我shutdown.wait.time在extenderProperties豆里遇到了财产.
任何人都可以让我知道如何使用这个OSGi片段来实现我的目标?我想我可以将一个片段包附加到我现有的OSGI包中.
提前致谢.感谢您的帮助.
spring-dm ×12
osgi ×11
spring ×8
java ×5
apache-felix ×1
blueprint ×1
equinox ×1
maven ×1
spring-boot ×1