Show TOC

Testing Applications' Business Logic Using the EJB ExplorerLocate this document in the navigation structure

Use

When developing an application you need to test your business logic. You can do this using the EJB Explorer. This tool provides a detailed overview of all applications that are deployed on the AS Java and containing session beans. The information is organized in a tree view that consists of applications, EJB modules, session beans, business and component interfaces, and business methods.

You can expand all nodes on a particular level, using the context menu, or you can expand the tree node by node, selecting the elements you prefer. When you select a business method, you are able to set different arguments and execute it.

Procedure

Accessing the EJB Explorer

There are several ways to access the EJB Explorer:

  • By entering the following URL in a Web browser: http://<host>:<port>/ejbexplorer , where:

    • <host> is the host where the SAP NetWeaver Application Server for Java is installed.

    • <port> is the HTTP port of the ICM. It consists of 5<Java_instance_number>00 . For example, if the instance number of the Java instance is 60 , the HTTP port is 56000 .

    Note

    You can add to the URL the following optional parameters: <application_name> , <ejb_module_name> , <bean_name> , and <bean_interface> . You can use all of them, or a combination of these parameters. The <application_name> parameter represents the name of the application, which may include the name of the vendor, for example, app=sap.com/testApp . The other parameters are related respectively to the names of the EJB module, the session bean, and the bean interface, where the bean interface includes the fully qualified business interface (for EJB 3.0) and the fully qualified home and component interfaces (for EJB 2.x). The following example includes all parameters: http://<host>:<port>/ejbexplorer?app=<application_name>&mod=<module_name>&bean=<bean_name>&interf=<bean_interface_name>

  • Via SAP NetWeaver Administrator

    Open the SAP NetWeaver Administrator and choose Start of the navigation path Configuration Next navigation step Infrastructure Next navigation step Application Modules End of the navigation path. From the Related Links dropdown list choose EJB Explorer .

  • Via Developer Studio

    To open the EJB Explorer using the Developer Studio, you have to perform one of the following tasks:

    • Select the Java class for the session bean interface in the Project Explorer . In its context menu, choose Start of the navigation path Run As Next navigation step Run on Server End of the navigation path. Select a server and choose Finish . After the application is deployed, the EJB Explorer appears. You have to log on to access the EJB Explorer.

      You can apply this to an EJB module and a bean as well. The node that you have chosen in the Project Explorer is selected in the tree of the EJB Explorer.

    • Select the Java class for the session bean interface node from the Deployment Descriptor node of the project in the Project Explorer . In its context menu, choose Start of the navigation path Run As Next navigation step Run on Server End of the navigation path. Select a server and choose Finish . After the application is deployed, the EJB Explorer appears. You have to log on to access the EJB Explorer.

      You can apply this to an EJB module and a bean as well. The node that you have chosen in the Project Explorer is selected in the tree of the EJB Explorer.

    • Choose Start of the navigation path Run Next navigation step Run Configurations... End of the navigation path. In the context menu of SAP Application , choose New . In the Module tab, to fill in the Module field, browse to the desired EJB module. To fill in the Module Artifact field, browse to the appropriate bean interface. To deploy the application, select the Build and Deploy checkbox.

      Choose Apply and then Run .

      You can do the same thing by choosing Start of the navigation path Run As Next navigation step Run Configurations... Next navigation step Run End of the navigation path in the context menu of a particular EJB module, a bean, or an interface in the Project Explorer. The node that you have chosen in the Project Explorer is selected in the tree of the EJB Explorer as well.

Working with the EJB Explorer

You can perform the following tasks in the EJB Explorer:

  1. You can filter the information by filling in one or more of the following fields and choosing Filter in the Filter tray:

    • Application

    • Module

    • Bean

    • Interface

  2. Select the appropriate application. You can expand its nodes and display the details of each of them in the right pane.

    Note

    To expand all nodes of a particular level of the tree view, choose Expand item in the context menu of the application or the session bean.

  3. Select the EJB module, a session bean, one of its interfaces and choose one of the business methods. Detailed information about the particular business method and the navigation path of its location appears in the right pane.

    Note

    For each session bean type, business method, and interface there is a different icon. To list all icons, expand the Legend tray.

  4. To test the selected business method, change its arguments and choose Execute method.

  5. To reset the arguments, choose Reset.

  6. To update the tree view, choose Refresh from the context menu of the selected node.

    Note

    You can choose Refresh from the context menu of any level of the tree.