JBuilder7 debugging WebLogic7.0 EJB [reproduced]

zhaozj2021-02-16  102

JBuilder7 debugging WebLogic7.0 EJB Summary: This article is to introduce how to run the EJB in WebLogic, which is running in the integrated development environment JBuilder, divided into three parts. The first part describes the Java Platform Debugger Architecture. The debugger under jBuilder is based on this framework; the second part introduces the WebLogic configuration under jbuilder, correctly the JBuilder configuration is a prerequisite for ensuring successful debugging; Part III enter debugging EJB's essential phase, demonstrates EJB debugging with a specific example. 1. About Java Platform Debugger Architecture History in Java, Java 2 has made Java gradually cut into an enterprise-class application market. In the face of numerous enterprise application developers, how to provide a convenient, easy-to-use debug framework, providing a basic hierarchy for all Java 2 applications, making it an important issue to consider by Java 2 designers. The new Java Platform Debugger Architecture is accompanied by the development of Java 2, which consists of three parts: Java Virtual March (JVMDI), Java Debug Network Protocol (JDWP), and Java Debug Interface (JDI). The relationship between them can be described by the following schematic: Any virtual machine that meets the Java 2 specification must implement JVMDI to support debug commands from JDI. As for how to communicate between JVMDI and JDI, in an environment across the network, the preferred protocol is TCP, and of course there may be other network protocols and methods, depending on the implementation of the JVM provided by the manufacturer. For example, Sun's JVM, a JVMDI implementation provided by Sun, supports communication methods for TCP and Share Memory; and JVM for the Solaris platform, only support TCP communication methods. Usually we will start the Java 2 process that is about to be debugged in debug mode, and then debug the front-end Attach to this process, initiate debug commands to the process, which is called remote debugging. Since Java 2 release, in 1.3, 1.4, JPDA has been enhanced. For more JPDA information, see Java 2 online documentation. In jbuilder, we are about to use the debugging method is Remote Debugging. 2. Configuring WebLogic "Wrathone, you must," JBuilder as a powerful IDE, and JBuilder supports development, commissioning, and deploying J2EE applications in a variety of application server environments. By default, JBuilder is only configured with a free Tomcat as an EJB container, and we need to reset the JBuilder default application server for WebLogic.

2.1. Configuring WebLogic Application Server After starting JBuilder, select the menu "Tools" -> "Configure Servers ...", the setting screen is as follows: Home Directory - WebLogic Server Sitting Main Class - When you set Home Directory, JBuilder will automatically set VM. parameters - when set Home directory, JBuilder will automatically set Working directory - the directory where the WebLogic Server domain JDK installation directory - WebLogic Server used by JDK directory where the BEA home directory - BEA software directory domain directory - with Working directoryUser name - Start WebLogic Server System User Password - System User Password 2.2. Specifies that WebLogic Application Server is the steps over the default application server, which has actually configured an available WebLogic Server in JBuilder. We will set this WebLogic Server to The application server used by the JBuilder project default. Select menu "Project" -> "Default Project Properties ..." -> "Server", select WebLogic Application Server 6.x in Single Server for All Services in Project, click "OK" button to configure WebLogic in JBuilder Matters. 3. Tit EJB3.1 in JBuilder. Establishing a new project SAMPLE uses JBuilder development J2EE apps, it is project, so we first build a project called debugejb in jbuilder, select the menu "file" -> "New Project ..." Click the "FINISH" button to complete the establishment of the SAMPLE project. 3.2. Increase the demugejb ejb module to the project Select menu "file" -> "new", select the EJB Module type in the Object Gallery dialog Next, named the ejb module in the pop-up dialog, start adding to the ejb module EJB, for convenience, we join a simple session ejb named SAMPLE to add a Test method for the session EJB, the return value is defined as a String type: JBuilder will automatically generate the code of the corresponding method in SampleBean.java, we switch To the code area corresponding to the TEST method, add the following code: int i = 0; i ; return "SampleBean.test Was Called !!!"; compile and generate EJB package files Sample.jar.

Then use jbuilder to generate an EJB Test Client for the EJB to modify the main method of SampleTestClient1.java to call the development of EJB: client.create (); string s = client.test (); system.out.println ("The Return Value from EJB IS" S); Choose Project-> Project Properties ...-> run-> new, generating a runtime configuration file for the startup of EJB (new features of JBuilder7): Next, It is also necessary to generate a runtime configuration file for calling the session bean (this should be selected): Set the breakpoint in the Test method, then click the Debug Project icon of the floating toolbar and select for for. EJB RUN, as shown below. JBuilder7 will launch WebLogic 7.0 to start debugging. Since WebLogic 7.0 is running in development mode, we only need to copy DEBUGEJB.JAR to the C: / BEA / User_Projects / MyDomain / Applications directory, and WebLogic 7.0 will automatically deploy our EJB. Then run the application that calls the session bean, JBuilder7 will stop at the breakpoint: Once the code of the session bean changes, we can copy the debugejb.jar directly to the C: / bea / user_projects / mydomain / applications directory WebLogic 7.0 will automatically redeploy the new .jar file. After the debugging is completed, you should delete the debugejb.jar under the C: / BEA / User_Projects / Mydomain / Applications directory. Appendix Here is some information for reference Java 2 SDK, Standard Edition Documentation Borland JBuilder Online Help Search article: http://dev2dev.bea.com.cn/techdoc/webser/20030472.html (Source)

转载请注明原文地址:https://www.9cbs.com/read-10430.html

New Post(0)