SPRING.DM Web Development Environment Construction

Source: Internet
Author: User

As a beginner, it's still a bit of a hassle to build a spring.dm web development environment. I met n more trouble, took a lot of detours. This article introduces 2 kinds of relatively simple construction of SPRING.DM OSGi Web development environment.

The first of these methods

Similar to the previous article, please step here: SPRING.DM version HelloWorld

First of all, refer to the Spring-osgi-2.0.0.m1 folder in the Dist and Lib folder of the package (not clear, see SPRING.DM version HelloWorld Environment Preparation chapter), the specific reference package effect is as follows:

Figure 1

Configure "Run Options", Eclipse menu: Run->run configurations ..., the Run Configuration window will appear, right-click on "OSGi Framework" in the left panel, click "New", as shown in

Figure 2

Then click on the: Run button to see the following results:

Figure 3

As you can see, Tomcat has started successfully and has a development environment.

But now there is a problem is that in the figure 2 point "Validate Bundles" button will appear some missing dependencies, as shown in this step can be started regardless, Tomcat can also get up, we will be in the 2nd method of time

To solve the problem.

Figure 4

2nd method

Idea: Do not use the default target Platform, define a folder yourself, put the relevant jar package into this file, and then create a new target Platform and set as the default, when the runtime will be using this target Platform to run. And then we start.

First create a folder "Target_spring_web" (everyone can name), and then put the required jar package in, the end result as shown:

Figure 5

Then eclipse type menu: windows->preference, open the following window, select click "Target Platform" in the left panel, as shown, click "Add" button 7 shown

Figure 6

Figure 7

Select "Nothing:start with an empty target definition" and then click on the "Next" button to launch the target definition interface, as shown in

Figure 8

In the click "Add" button, the interface will appear to add the content as shown, then we select "Directory", click "Next"

Figure 9

Figure 10

In the, click on "Browse" to browse the target_spring_web we just built, you will see the directory inside the jar package, as shown, click on the "Finish" button to complete the add;

Figure 11

Figure 12

In 12 you can see the 19 jar packages in our Target_spring_web directory, then select the "Content" tab, as shown, 19 Plug-ins selected, click "Finish" to complete the target creation.

Figure 13

Figure 14

In the you can see that we created the target Platform, then select it, click "Apply", then click "OK" to complete the creation.

OK, let's create a run configuration item, Eclipse menu: Run->run configurations ..., the Run Configuration page appears, right-click on the OSGi framework, select "New" to create one, I modify name to Spring_ Web, you can follow your own custom changes, check 19 bundles, point verification, will be prompted, no dependencies detected, as shown, and then click "Apply", point "Run", witness the moment of miracles!

We can see the results of the operation as follows:

Precautions

We encountered in the SPRING.DM version of the issue of abnormal log helloworld, in the internet also found a lot of solutions, there are some building a fragment project, to eliminate the problem of log anomalies, not now,

You can look at Figure 5 in the Red box bundle, version changed to: Com.springsource.org.apache.commons.logging-1.1.1.jar, just fine.

Experience

Another way to configure the environment is that with OSGI support for the Spring IDE, the general principle is the same as in the 2nd approach, where the version of OSGi is different from ours. The first method is simpler, but there are a lot of bundle references in the project that are annoying and not recommended. The second option is recommended for use.

SPRING.DM Web Development Environment Construction

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.