How to Use RMI registry in eclipse-configuration process

Source: Internet
Author: User

How to Use RMI registry in eclipse-configuration process

Reprinted token


I. Install plug-in package eclipse RMI plug-in is http://www.genady.net/rmi/v16/ online there are a lot of RMI summary process, but not run in eclipse, the following is my own running process in eclipse.

Copy the decompressed features and plugins folders to the eclipse installation root directory to overwrite the original folder. I have downloaded the plug-in package and started eclipse in the attachment (if it has been started, restart eclipse). A tool icon is added to the toolbar, there is a registry management option, which is the RMI Registry Manager. The installation is successful.



2. Set the development environment

After installing the plug-in package, we will set up the RMI development environment. Start eclipse. In the menu window-> preferences dialog box, select Java-> RMI from the left tree menu, and the default RMI plugin settings will appear in the right window. The preceding path to RMI registry sets the path of the RMI registry in Java. For example, C:/program files/Java/jdk1.5.0 _ 05/bin/rmiregistry.exe is set here. Generally, you do not need to worry about it. The following box shows the RMI service port. The default value is 1099. This is similar to Tomcat service port 8080. You need to find the corresponding port to connect to the port. In fact, the lowest layer of RMI is socket. Note that RMI plugin is a paid Eclipse plug-in and has a 15-day free trial. The maximum window in the RMI attribute is to fill in the authorization information.


This is the basic setting of the development environment. It mainly requires RMI plug-ins and settings.

Iii. Run the debugging project

Before running the job, you need to set it. Otherwise, an error message is displayed, indicating that stub class cannot be found.

1. Start rmiregistry

Eclipse menu window-> show view-> others, select RMI views> RMI registry inspector in the pop-up menu. An additional window is displayed, showing registered RMI applications. Click the RMI plugin icon on the toolbar and select start local registry from the menu. Note that this only needs to be started once unless you turn it off. (But it seems that every time you open eclipse, you need to re-open % >_<%)

2. Configure and run the RMI Service, right-click the rmi_server.java file in the tree on the left (the class implemented by your server interface), and choose debug as> RMI application. In the displayed dialog box, find the RMI Properties tab. The first two items are displayed in red. Select Java. security. in the value box of the Police item, click the select button to display the file selection dialog box. Here we set it to C:/program files/Java/jre1.5.0 _ 05/lib/security/Java. security. Is the JRE security policy configuration file, you need to select the current JDK side of the mud file. Select the value of the second java. RMI. server. codebase item. Here, select the folder where the compiled class package is located. Click "select"-> "add ".
-> Pick from workspace, select the bin folder of the current project rmitest. Here is file:/E:/workspace/rmitest/bin /. (You can also click "select"> "add"> "compute from ".
Classpath ).

The preceding code runs RMI application, but my computer does not display RMI application. At that time, this window does not display any RMI project.


Rmiregistry cannot be started at this time, so you can only manually start rmiregistry


The RMI registration is started here, and the first off stub class will be generated under the bin path of the project. The running server class and client class are complete. Note that this RMI registration can only be started once, unless you disable it.

 

Related Article

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.