Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy Development Environment in J2EE distributed Framework

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly shows you "how to deploy the development environment in the J2EE distributed framework", the content is easy to understand, clear, hope to help you solve your doubts, let the editor lead you to study and learn "how to deploy the development environment in the J2EE distributed framework" this article.

Environment building:

1. Environmental preparation

1. Development tools: Eclipse IDE (a higher version is recommended)

2.JDK version: JDK1.7

3. Project Management: Maven3.1.1

two。 Installation steps

1. Install jdk1.7 and configure the environment variables (I believe everyone will do it, I will not repeat the instructions here)

two。 The maven:maven installation process is the process of unzipping (I have unzipped it for you, directory: e:\ myprj\ jeesz-maven\ apache-maven-3.1.1). For your convenience, the relevant installation packages are provided here and will be shared in the packaged directory.

3.mavan configure environment variables, right-click my computer? Attributes? Advanced system settings? Environmental variables? Find (system variable path), enter your maven installation package path at the front, and declare: because the specified directory was unzipped in the previous step, the configuration is as follows:

E:\ myprj\ jeesz-maven\ apache-maven-3.1.1\ bin

I believe everyone has been equipped with environmental variables, if you are not very clear, please consult the relevant information to understand the relevant knowledge of maven.

4. Open cmd and type: mvn-version inside. The following result indicates that your maven installation is successful.

Mvn is a command of maven, mvn-version is to check the version information, my operating system is 64-bit WIN7, the installed maven is 3.1.1, if you can print the above information, it means that Maven3 has been installed on your computer.

5. Build a workspace (select the j2ee view when you enter)

6. Configure Eclipse encoding as UTF-8

Select Window "Prefrences" General "Workspace from the Eclipse toolbar

7. Configure the jre environment (you need to install the jdk1.7 version before, so use the installed jdk to configure it here):

Select Window "Prefrences" java "Installed JREs" Edit "choose your own local jdk installation path" Finished "OK

8. Remove JavaScript verification and other information (because js, css, xml and other files in different formats are widely used in the project, and taking into account the execution time of each compilation, some verification information is temporarily removed here)

Window "Prefrences" Validation "Suspend all validators" ok

Modify the maven settings.xml configuration file you just installed in the following path: e:\ myprj\ jeesz-maven\ apache-maven-3.1.1\ conf

Add local library address: E:/myprj/jeesz-maven/apache-maven-3.1.1/repository

Modify the central library path (when the network is normal, you can download the missing jar package from the remote central library. I use the central library of Oschina here, if there is a problem with the network.

You can use your company's private server to load relevant jar packages). Considering that sometimes your packages cannot be downloaded, I have also shared the jar packages needed for the project, all of which are placed in the following directory:

E:/myprj/jeesz-maven/apache-maven-3.1.1/repository

Configure the maven installation directory and the local library directory loaded by the Setting file in Eclipse

11. Import Maven project

File "Import" Existing Maven Projects next step

Select your local maven project (please select the jeesz-project root directory) and click OK

After all the projects are loaded, click finish to finish.

Reminder: this import process will take some time, because I am locally connected to the network, so I will download all the jar packages needed for the project from the remote central library. Please wait patiently.

If you use the local library, you don't have to wait a long time, and if you use the company's private server, the waiting time won't be very long.

Project information after import

The package of the local library has been downloaded.

twelve。 After downloading all jar packages, update the maven project:

1) Select all items 2) right select maven "Update project" select all "check related items" and click ok

If there is also a red X error in the project, the relevant jar package must be missing, and you can use:

Window "showView" problem window to view exception information

If the jar package is missing, you can copy the jar package provided by us directly to your specified directory

No further work can be carried out until all the errors in the project have been cleared (as shown in the following figure).

Select all projects and clean up the projects: Project "clean

Try to compile and package the project to see if there is a problem:

Note: generally, we package and compile for the root project, because all the dependencies are configured. Right-click jeesz-project "Run As" Maven build...

Enter the clean install-X command in the pop-up dialog box and check Skip tests,Run.

Reminder: if you are not familiar with the maven command, you can check the relevant information

Here is a simple explanation: clean install-X means to clean up all projects and load the jar wrapper to the local library, where-X represents the output information (usually you can use-X to locate the problem when there is a maven problem. )

At this point, the console begins to compile and load all the packages, which is a long process. Please wait patiently.

The following results indicate that the project is normal.

The packaged packages (including war and jar) are all under the target folder. The screenshot is shown below, which only takes jeesz-web-admin as an example:

14.Tomcat publishes jeesz projects (everyone will do it without a detailed description of the release process):

Here is an introduction to the different projects:

Jeesz-web-admin: can be deployed independently (background management platform)

Jeesz-web-service: can be deployed independently (REST service platform, where customers can expand Rest services according to their own business, in which relevant examples have been written)

Jeesz-service-bookmark and jeesz-service-task are dubbo service providers (here, we only introduce the development of dubbo service projects through collections and to-do projects. Customers can expand dubbo services according to their own business, which can be deployed at the same time or split).

Jeesz-web-bookmark and jeesz-web-task are dubbo consumer platforms, where the service interfaces for dubbo service exposure are: Jeesz-facade-bookmark and jeesz-fa?ade-task (here, only through collection and to-do items to describe how the dubbo client invokes the dubbo service provider. Customers can implant the dubbo consumer into different projects by making some simple configuration.)

Deployment conditions:

1) execute mysql database script: jeesz.sql

For the configuration items of database jdbc, please refer to

2) Jeesz-web-admin can be deployed directly through tomcat

Login user name password: jeesz/admin

3) Jeesz-web-service: can be deployed independently through tomcat

Login user name password: jeesz/admin

Deployment of dubbo-related projects requires the following conditions

Install the dubbo management and control platform, extract the war package to tomcat, replace the directory with the root directory, and start tomcat directly (window is provided in the development environment)

Zookeeper registry installation. I provide the zookeeper-3.4.5 version (window is provided in the development environment). You can start it by entering the installation directory.

Reminder: I have provided the relevant procedures, in which the dubbo management and control platform should be independently deployed on the Tomcat server, which does not require high availability configuration, and can be started by directly starting tomcat. The Zookeeper registry has commands that can be run and started directly. If you want to deploy on the linux system, you can refer to the relevant documentation provided by us.

5) when the dubbo console and registry start ok, deploy the Jeesz-service-bookmark and jeesz-service-task projects to tomat at the same time (which can be deployed independently) as dubbo service providers

6) Log in to the dubbo console to view the relevant service information, and you can see that the service you released has been controlled by the console:

Http://localhost:8080/root

Can be accessed directly through the address because the package name has been changed to Root

Username password: root/root

7) partial deployment of Jeesz-web-bookmark and jeesz-web-task dubbo consumer projects is designed to let developers understand how services are invoked.

To this entire project installation process first here, please developers after installing the project into the development, all the business directly service, because the project is based on driver development, so your table design, through the jeesz-web-admin project gen code generation module automatically generate all controller, service, dao, xml, jsp interface, etc., directly for business preparation processing.

These are all the contents of the article "how to deploy a development environment in a J2EE distributed framework". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report