How to configure the Weblogic service in eclipse!

Source: Internet
Author: User

Configure the Weblogic ide plug-in eclipse

WebLogic-EclipsePlug-ins are designedEclipse IDERunWebLogicServer. WithWebLogicServer plug-in, fromEclipseEnable and stopWebLogicServer, you can useEclipseDebuggingWebLogicServer. InEclipseInstallWebLogicPlug-ins, andEclipseAfter setting the server class path and JVM options, you can useEclipse IDEConfiguration and managementWebLogicServer.

  Overview

J2EE developers often need to manageWebLogicServer and debugWebLogicThe application deployed on the server.WebLogicServer console can be started and stoppedWebLogicBut cannot set JVM options and server class paths. Start is required.WebLogicConfigure JVM options and server class paths. Debugging is required.WebLogicFor applications deployed on the serverIDE. WithWebLogicAfter the plug-in, you can useEclipse ID; eManagementWebLogicServer.

  Installation preparation

Download and install eclipse 3.3 ide: www.eclipse.org

Download and install WebLogic Server Plugin for Eclipse: https://eclipse-plugin.projects.dev2dev.bea.com/

  Install the Weblogic-Eclipse plug-in

Install nowWebLogic-Eclipse IDEThere are two ways to install the IDE plug-in. The first is to install the plug-in through find and install in the eclipse menu. The other is to install the plug-in through links! First, install the SDK by using find and install.Eclipse IDESelect help> Software Updates> Find and install. the install/update form is displayed. Select search for new features to install and click Next. In the displayed install form, click the new remote site button to specify the update web site from which the plug-in is installed. In the new update site form, specify the name and install WEblogic-EclipseThe URL of the plug-in.WebLogic-EClipseThe plug-in URL is https://eclipse-plug-in.projects.dev2dev.bea.com/update. In this way, the updated site configuration is added. In useAt eclipseweblogicSelect "sites to include in search" in the check box, and then click Next. On the install form functional area, select Weblogic-Eclipse feature and click Next.

Select the license terms and click Next. In the install location form, specify the directory where the Weblogic-Eclipse plug-in is installed. Click Finish to complete WebLogic plug-in configuration. In the displayed jar verification form, click Install to install the Weblogic-Eclipse plug-in. Restart the eclipse Workbench to install the plug-in. Now the Weblogic-Eclipse plug-in is installed in Eclipse IDE. In eclipse, run> Start Weblogic and run> stop WebLogic are added.

Method 2: Install through links. First, download the WebLogic Server Plugin for Eclipse plug-in, which is provided above. After downloading, decompress the plug-in and install it through links! (For specific installation methods, see: http://blog.csdn.net/apicescn/archive/2005/03/19/323478.aspx)

  Configure the Weblogic-Eclipse plug-in

After the Weblogic-Eclipse plug-in is installed, We will configure the plug-in Eclipse IDE. First, create a project to configure the Weblogic plug-in. Select File> New> project. In the new project form, select Java> JAVA project and click Next. In the create a Java project form, specify the project name and click Next. Add the source folder for the project in the Java settings form. Click Add folder. Specify the folder name in the new source folder form. A message form prompts you to set the bin folder as the build Output Folder. Next, add the library required by the project. The sample application needs to add J2EE jar in the class path. Select the libraries tab and click Add external jars.

Add the J2EE 1.4 J2EE. jar file to the project. 1.4 J2EE. jar will be listed in the project library. Click Finish to complete the project configuration. Add a project to the Eclipse IDE package explorer view.

Next, specify the Weblogic server configuration. Select WINDOW> preferences. In the displayed preferences form, select the Weblogic node. On the Weblogic preference page, click Add and select the WebLogic Server version to be configured. Specify different field values, as shown in table 1. The Installation server and configuration domain directories have different values. Click the Apply button to apply the specified value.

Table 1 Weblogic-Eclipse plug-in

Field Description Value
Bea home Bea installation directory E:/Bea
WebLogic home WebLogic Server Installation Directory E:/BEA/weblogic81
Domain Name WebLogic domain Mydomain
Domain directory WebLogic domain directory E:/BEA/user_projects/domains/maydomain
Server Name WebLogic Server Name Myserver
User User used to log on to WebLogic Server WebLogic
Password Password used to log on to WebLogic Server WebLogic
Hostname WebLogic Server Host Name Localhost
Port WebLogic Server Port 7001

If you must add a jar file to the server class path, select WebLogic> classpath. You can add a jar/ZIP file or directory before or after the Weblogic library. In this example, add only the pre-WebLogic startup library files (weblogic. jar and WebServices. Jar files), as shown in:

Select the Weblogic> JavaVM options node to specify the JavaVM option. For example, modify the attribute weblogic. productionmodeenabled. Set the property value to false to start the server in development mode. Click Apply to apply the JavaVM option. (In this example, the parameter is-ms64m-mx64m-djava. library. path = "E:/BEA/weblogic81/Server/bin"-dweblogic. management. discover = false-dweblogic. productionmodeenabled = false), as shown in:

Note that the JRE used for weblogic8.0 and later must be of JDK 1.42. You can use the JDK version that comes with WebLogic directly.

Next, specify the project for debugging using weblogic server configuration. Click the Add button and select the project to add to the plug-in configuration. To debug a project, the project must be in the plug-in configuration. Click OK.

In this way, the selected project is added to the project list. Click Apply, and then click OK to configure the Weblogic plug-in using the project and WebLogic Server.

  • In the eclipse menu, choose windows> show View> other...

At the bottom, you can see the Weblogic servers menu item under the Weblogic category. Select and open it.

In this way, you can start and stop WebLogic Server.

  • Select the project node under Weblogic and set the following parameters

Project added to the end of the classpath, you can click the Add button to select the project you want to load, so that all the class libraries in the selected project will be automatically added, however, its loading order is at the end of classpath.
Start WebLogic Server

  • In the open view, right-click and select start to start WebLogic Server.

The following startup information is displayed on the console:

The startup is successful.

You can also add other Weblogic server configurations here, as shown below:

Modify the configuration of WebLogic Server

Delete the configuration of WebLogic Server

You can also view the corresponding help documentation as follows:

Open the Weblogic Plugin help document for reference.

Stop WebLogic Server

  • In the open view, right-click and select stop to stop the WebLogic Server.

The following stop information is displayed on the console:

  Deploy, restart, and stop applications

Deploy an application: You can only deploy a new application through a browser. You can directly deploy the application here.

Restart: If we have deployed a web application through a browser or other control terminals.

In this case, stop WebLogic through the plug-in, start it, and double-click to display the Web appplication modules. You can view the deployed Application below. However, it is slow to stop and start again.

You can use the refresh function provided by the plug-in to display the deployed modules as follows:

To restart the application, right-click the application name and select redeploy in the pop-up menu to redeploy the application, which is fast.

To delete an application, right-click the application name and select undeploy in the pop-up menu to delete the application. The module name disappears immediately and is fast, re-deployment must be completed through a browser or other control terminals.

  Summary

This plug-in feature allows us to easily integrate eclipse and WebLogic for development and usage, improving efficiency.

  Develop and debug WebLogic applications

After the Weblogic plug-in is configured, a J2EE application will be developed for deployment and debugging on the WebLogic Server. The sample J2EE application consists of session EJB and client servlet. Obtain the J2EE application from the resource ZIP file (for the source code in this article, you can view the article http://wldj.sys-con.com/read/issue/archives/,Vol. 5, ISS. 2 In the wldj archive file online ). Extract the resource ZIP file to the directory. In the Eclipse project eclipseweblogic configured above, select File> Import to import the src directory of the J2EE application. In the import form, select the file system node and click Next. In the file system form, select directories/files to add a project, and click Finish (see figure 1 ).


Figure 1

In this way, the sample J2EE application file is added to the project. Use the ant build. xml file to build the project. Right-click build. xml and choose run> ant build to build the J2EE application and deploy it in the WebLogic Server application directory. Next, choose run> Start WebLogic to start WebLogic Server in Eclipse IDE. In this way, the session EJB/servlet application is deployed on the WebLogic Server, as shown in the application node.

Enter URL http: // localhost: 7001/WebLogic/weblogicplug-in the browser to run weblogicservlet. Servlet output will be displayed in the browser. Next, add an exception (nullpointerexception) to the client servlet to verify the debugging function of the Weblogic plug-in. In the weblogicservlet, we will:

Out. println (sessionejb. geteclipseplug-in ());

Replace:

String STR = NULL;
Out. println (Str. tostring ());

Select Run> Add Java exception breakpoint to add a breakpoint to the servlet. In the Add Java exception breakpoint form, select nullpointerexception. Delete the previously built directory and use build. XML to build the application. Select debug perspective. In debug perspective, we can see that the Weblogic server is running on the localhost host.

Run the sample servlet (with nullpointerexception) in the browser ). The server is interrupted because the servlet has an exception, and debug perspective displays nullpointerexception. You can use the debug function in the run menu to debug applications.

  Conclusion

To sum up, you can use the Weblogic plug-in to manage the WebLogic Server through Eclipse IDE and debug the applications deployed on the server through Eclipse IDE. WebLogic plug-in does not support JSP debugging. The plug-in version 2.0 will have more features.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.