Configuration steps for Equinox OSGi server application

Source: Internet
Author: User
Tags root directory

This article describes how to configure a simple Web application based on Eclipse Equinox OSGi in Eclipse to build a more complex application based on the Eclipse version 3.3.1, which is used in this article. If your eclipse version is 3.2.0 or above, it should be OK.

One, support static pages and servlet

1. Create a new plugin project, Net.bjzhanghao.osgi.test, in the first step of the wizard, select this plug-in is target, and in the next "Plug-in Options", select "Generate an Activator ".

2. Add the following dependencies in the MANIFEST.MF of the example project, which are all from eclipse:

org.eclipse.equinox.http.jetty
org.eclipse.equinox.http.servlet
org.mortbay.j etty
org.apache.commons.logging
javax.servlet
org.eclipse.equinox.http.registry

3. In the example project root directory to create a directory to place Web files, such as "Web_files", in this directory to write a simple index.html file.

4. Create a Plugin.xml document for the project, which reads as follows:

Alias= "/web"

Base-name= "/web_files"/>

Note that this time if the MANIFEST.MF prompts the error, as long as the Bundle-symbolicname line after the addition of "; Singleton:=true" can be resolved.

5. You can start this application now. Select "Run->open Run Dialog ..." On the Eclipse menu, create a new startup configuration entry under the "OSGi Framework" on the left, and click "Deselect All" on the right to clear all the check boxes. Then select your own OSGi project under Workspace, and then click the "ADD Required bundles" button, and Eclipse will automatically select the items on which it depends. Finally press the "Debug" button to start, the embedded jetty and our project will be started together.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.