环境:
Eclipse Modeling Tools
Version: Indigo Service Release 2
Build id: 20120216-1857
操作系统:win7
tomcat: apache-tomcat-7.0.27
1、 简单操作(在bridge基础上再添加jar)
主页:
http://eclipse.org/equinox/server/http_in_container.php
http://eclipse.org/equinox/server/downloads/bridge.war
基本操作:
http://developer.51cto.com/art/200910/157948.htm
2、 通过eclipse product生成可运行的程序,然后嵌入到tomcat
(这里需要稍稍的了解类的加载。)
demo.zip 在 sample.http 的基础上增加了product打包功能,导入eclipse modeling后,打开/sample.server/server-web.product,点击·Launch an Eclipse application·,然后在浏览器中输入http://localhost/helloworld (启动后jetty默认端口为80)会看到“Hello World -- sample servlet”。
嵌入到tomcat,需要对bridge/WEB-INF/eclipse进行修改。
由于tomcat启动是已经加载了servlet-api(即javax.servlet),同时由于使用tomcat取代jetty作为容器。
1、 如果存在引用javax.servlet bundle。获取该插件的源码,分别打开${BUNDLE}/META-INF/MANIFEST.MF。切换到`Dependencies`页签,删除`Required Plug-ins`中javax.servlet,在`Imported Packages`中添加javax.servlet, javax.servlet.http。
2、 打开server-web.product,导出可运行的程序。
3、 文件处理
删除导出的 product-export/eclipse/plugins/ 下的 jetty.server 和 javax.servlet 的包。
同时,bridge/WEB-INF/eclipse/plugins仅保留org.eclipse.equinox.http.servletbridge和org.eclipse.update.configurator。(其他的包在product-export/eclipse/plugins/已经包含了)
拷贝 product-export\eclipse 下全部的文件到bridge/WEB-INF/eclipse
4、 配置文件bridge/WEB-INF/eclipse/configuration/config.ini
修改加载与启动的bundle。
打开config.ini, org.eclipse.update.configurator和org.eclipse.equinox.http.servletbridge; 删除 javax.servlet 和 org.mortbay.jetty.server 的加载项。
(仅进行了粗略的处理,org.eclipse.equinox.launcher应该也还可以去掉)
all-in-one.zip处理了后面的三个步骤,运行deploy.bat,然后把all-in-one/bridge/WEB-INF目录(是整个WEB-INF目录)拷贝到webapps/ROOT/目录下即可。
刚开始遇到同样的问题。在正常启动前,还没有处理掉javax.servlet插件。可能导致加载了不同jar中的的servlet类(javax.servlet bundle与servlet-api jar):
Reason: Missing Constraint: Import-Package:
org.eclipse.equinox.servletbridge; version="1.0.0"
http://www.eclipse.org/forums/index.php/mv/tree/34715/
查看的相关文章:
http://eclipse.org/equinox/server/http_in_container.php
http://www.geclipse.eu/fileadmin/Documents/Guides/deployment.pdf
http://eclipse.dzone.com/articles/embedding-osgi-tomcat
http://developer.51cto.com/art/200910/157948.htm
http://www.blogjava.net/Phrancol/articles/267508.html
源码地址:
:pserver:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/server-side/bundles/org.eclipse.equinox.http.servletbridge
:pserver:dev.eclipse.org:/cvsroot/rt,org.eclipse.equinox/server-side/bundles/org.eclipse.equinox.servletbridge
https://github.com/winse/hello/tree/ca902237e03c05f13c7a3cf838de48c825d98dc4
相关推荐
HIGHLIGHT OSGi in Action is the definitive guide to OSGi, the hottest technology available for creating modular enterprise Java applications. DESCRIPTION What is OSGi? Simply put, OSGi is a ...
embed 播放多媒体 embed详细介绍 embed入门
最新的servlet-api.jar,完美结果java代码中注释(@)部分报错的问题
Guide to Ambient Intelligence in the IoT Environment: Principles, Technologies and Applications (Computer Communications and Networks) ISBN-10 书号: 3030041727 ISBN-13 书号: 9783030041724 Edition 版本...
tags embed 页面标签 tags embed 页面标签
要用字体是:Calibri的11号字体。
关于“百歌搜索引擎tomcat嵌入版(Baioogle-SearchEngine Embed in Tomcat)”的说明: 2008年5月份,因学习《信息检索》课程,本人利用java的开源搜索引擎库lucene,以及结合ajax技术google-suggest功能,模仿baidu...
STK-X C++编程教程。In this exercise you will gain hands-on experience using STK X to embed STK functionality in a container application created with C++/CLI.
Embed Java VM in Executables using Java Native Interface (JNI) (7KB)
AS3 Embed用法
In this exercise you will gain hands-on experience using STK X to embed STK functionality in a container application created with MATLAB with GUIDE (Graphical User Interface).
HTML-embed代码详解word文档
tomcat-embed-el-9.0.16.jar
python-3.11.0-embed-amd64.zip
Packaging Details (or "What Should I Download?") apache-tomcat-[version].zip or .tar.gz: base ...apache-tomcat-[version]-embed.zip or .tar.gz: for using Tomcat only as an embedded servlet container.
tomcat-embed-core-8.5.23.jar
It is a program to embed and extract data in and an image using key.