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.
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 .
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 . 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 . 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 . 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 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.
. In the context menu ofChoose Apply and then Run .
You can do the same thing by choosing
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:
You can filter the information by filling in one or more of the following fields and choosing in the Filter tray:
Application
Module
Bean
Interface
Select the appropriate application. You can expand its nodes and display the details of each of them in the right pane.
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.
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.
For each session bean type, business method, and interface there is a different icon. To list all icons, expand the Legend tray.
To test the selected business method, change its arguments and choose .
To reset the arguments, choose .
To update the tree view, choose Refresh from the context menu of the selected node.
You can choose Refresh from the context menu of any level of the tree.