OSGI学习笔记(八)

 

SpringDM初步使用(三)

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

 

osgi> 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就可以体验该例子:

 
OSGI学习笔记(八)
 web_console_server可以在https://chenjun-java.googlecode.com/svn/spring-osgi/下载。