---
title: "OSGI学习笔记（八）"
author: "AbstractForever"
date: "2012-03-19T21:08:51Z"
tags: []
categories: ["编程语言"]
slug: "osgi"
draft: false
lastmod: "2012-03-19T21:09:34Z"
id: 1145406
url: "https://abstractforever.iteye.com/blog/1145406"
---

SpringDM初步使用（三）

spring第三个例子web-console实现了对现有bundle的一个信息提取。和控制台信息的提取。启动该项目关键还是在jar的引入，我在外部做了一个服务器web\_console\_server启动。启动后效果如下：  
D:\\tomcat\\web\_console\_server&gt;java -jar org.eclipse.osgi\_3.7.0.v20110613.jar -console

 

osgi&gt; INFO \[org.springframework.osgi.web.tomcat.internal.Activator] - Starting Apache Tomcat/6.0.18 ...  
INFO \[org.springframework.osgi.web.tomcat.internal.Activator] - Using default XML configuration bundleresource://19.fwk605645/conf/default-server.xml  
INFO \[org.springframework.osgi.extender.internal.activator.ContextLoaderListener] - Starting \[org.springframework.osgi.extender] bundle v.\[1.2.1]  
INFO \[org.springframework.osgi.extender.internal.support.ExtenderConfiguration] - No custom extender configuration detected; using defaults...  
INFO \[org.springframework.scheduling.timer.TimerTaskExecutor] - Initializing Timer  
INFO \[org.apache.catalina.startup.ClusterRuleSetFactory] - Unable to find a cluster rule set in the classpath. Will load the default rule set.  
INFO \[org.apache.catalina.startup.ClusterRuleSetFactory] - Unable to find a cluster rule set in the classpath. Will load the default rule set.  
INFO \[org.springframework.scheduling.timer.TimerTaskExecutor] - Initializing Timer  
INFO \[org.springframework.osgi.web.extender.internal.activator.WarLoaderListener] - Starting \[org.springframework.osgi.web.extender] bundle v.\[1.2.1]  
INFO \[org.springframework.osgi.web.extender.internal.activator.WarListenerConfiguration] - No custom extender configuration detected; using defaults..  
.  
INFO \[org.springframework.osgi.web.deployer.tomcat.TomcatWarDeployer] - No Catalina Service set; looking for one in the OSGi service registry...  
INFO \[org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean] - Looking for mandatory OSGi service dependency for bean \[] match  
ing filter (objectClass=org.apache.catalina.Service)  
INFO \[org.apache.coyote.http11.Http11Protocol] - Initializing Coyote HTTP/1.1 on http-8080  
INFO \[org.apache.catalina.startup.Catalina] - Initialization processed in 483 ms  
INFO \[org.apache.catalina.core.StandardService] - Starting service Catalina  
INFO \[org.apache.catalina.core.StandardEngine] - Starting Servlet Engine: Apache Tomcat/6.0.18  
INFO \[org.apache.coyote.http11.Http11Protocol] - Starting Coyote HTTP/1.1 on http-8080  
INFO \[org.springframework.osgi.web.tomcat.internal.Activator] - Succesfully started Apache Tomcat/6.0.18 @ Catalina:8080  
INFO \[org.springframework.osgi.service.importer.support.OsgiServiceProxyFactoryBean] - Found mandatory OSGi service for bean \[]  
INFO \[org.springframework.osgi.web.deployer.tomcat.TomcatWarDeployer] - Found service Catalina  
INFO \[org.springframework.osgi.web.tomcat.internal.Activator] - Published Apache Tomcat/6.0.18 as an OSGi service  
ss

Framework is launched.

id      State       Bundle  
0       ACTIVE      org.eclipse.osgi\_3.7.0.v20110613  
1       ACTIVE      org.apache.felix.fileinstall\_3.1.6  
2       ACTIVE      com.springsource.javax.xml.stream\_1.0.1  
3       ACTIVE      org.springframework.context.support\_2.5.6.SEC01  
4       ACTIVE      com.springsource.javax.servlet.jsp\_2.1.0  
5       ACTIVE      com.springsource.javax.el\_1.0.0  
6       ACTIVE      com.springsource.javax.activation\_1.1.1  
7       ACTIVE      org.springframework.web\_2.5.6.SEC01  
8       ACTIVE      org.springframework.context\_2.5.6.SEC01  
9       ACTIVE      com.springsource.javax.xml.bind\_2.1.7  
10      ACTIVE      com.springsource.org.objectweb.asm\_2.2.3  
11      ACTIVE      org.springframework.osgi.catalina.osgi\_5.5.23.SNAPSHOT  
12      ACTIVE      com.springsource.org.apache.xmlcommons\_1.3.3  
13      ACTIVE      org.springframework.osgi.io\_1.2.1  
14      ACTIVE      com.springsource.slf4j.api\_1.5.0  
                    Fragments=18  
15      ACTIVE      org.springframework.osgi.jstl.osgi\_1.1.2.SNAPSHOT  
16      ACTIVE      com.springsource.javax.persistence\_1.0.0  
17      ACTIVE      org.springframework.aop\_2.5.6.SEC01  
18      RESOLVED    com.springsource.slf4j.log4j\_1.5.0  
                    Master=14  
19      ACTIVE      org.springframework.osgi.catalina.start.osgi\_1.0.0  
20      ACTIVE      com.springsource.javax.xml.ws\_2.1.1  
21      ACTIVE      com.springsource.slf4j.org.apache.commons.logging\_1.5.0  
22      RESOLVED    com.springsource.org.apache.coyote\_6.0.18  
                    Master=39  
23      ACTIVE      com.springsource.org.apache.juli.extras\_6.0.18  
24      ACTIVE      org.springframework.osgi.commons-el.osgi\_1.0.0.SNAPSHOT  
25      ACTIVE      org.springframework.beans\_2.5.6.SEC01  
26      ACTIVE      com.springsource.javax.xml.rpc\_1.1.0  
27      ACTIVE      com.springsource.javax.ejb\_3.0.0  
28      ACTIVE      org.springframework.osgi.web\_1.2.1  
29      ACTIVE      org.springframework.core\_2.5.6.SEC01  
30      ACTIVE      com.springsource.javax.annotation\_1.0.0  
31      ACTIVE      com.springsource.javax.mail\_1.4.0  
32      RESOLVED    log4j.configuration\_1.2.1  
                    Master=38  
33      ACTIVE      com.springsource.net.sf.cglib\_2.1.3  
34      ACTIVE      org.springframework.osgi.extender\_1.2.1  
35      ACTIVE      org.springframework.osgi.jasper.osgi\_5.5.23.SNAPSHOT  
36      ACTIVE      com.springsource.org.aopalliance\_1.0.0  
37      ACTIVE      org.springframework.osgi.core\_1.2.1  
38      ACTIVE      org.springframework.osgi.log4j.osgi\_1.2.15.SNAPSHOT  
                    Fragments=32  
39      ACTIVE      com.springsource.org.apache.catalina\_6.0.18  
                    Fragments=22, 42  
40      ACTIVE      org.springframework.web.servlet\_2.5.6.SEC01  
41      ACTIVE      org.springframework.osgi.web.extender\_1.2.1  
42      RESOLVED    org.springframework.osgi.samples.webconsole.catalina.cfg\_0.0.0  
                    Master=39  
43      ACTIVE      com.springsource.javax.servlet\_2.5.0  
44      ACTIVE      com.springsource.javax.xml.soap\_1.3.0

 

此时访问[http://localhost:8080/web-console/console.do](http://localhost:8080/web-console/console.do)就可以体验该例子：

   
![](http://dl.iteye.com/upload/attachment/0065/1231/5e2962fc-1c99-3ac4-8d81-52f9458694f4.png)  
 web\_console\_server可以在[https://chenjun-java.googlecode.com/svn/spring-osgi/](https://chenjun-java.googlecode.com/svn/spring-osgi/)下载。