Developer Tools
JDeveloper
You can quickly create a project in which to organize your application files. Then work in JDeveloper's IDE to develop and test run your EJB session bean.
Create a New Application: Use the Create Application wizard to create a generic application.
Create an EJB Session Bean: Use the Create Session Bean wizard to create a new EJB 3.0 session bean.
Add a Bean Method: Use the source editor to add a method to the bean class.
Create and Run a Java Client: Create a sample Java client and add code to the client to call the business method. Run the session bean, then run the Java client in the IDE's runtime service.
The JDeveloper application is the highest level in the organizational structure. While you are developing your application, it stores information about the objects you are working with. At the same time, it keeps track of your projects and all environment settings. [ tell me more...]
SessionEJB.
Application templates provide you with a quick way to create the project structure for standard applications with the appropriate combination of technologies already specified. The new application created from the template appears in the Application Navigator already partitioned into tiered projects, with the associated technology scopes set in each project. [ tell me more...]
When you complete the steps for creating a new application and project, the Projects panel in the Application Navigator should look like this: [ tell me more...]
In JDeveloper's IDE, you can quickly create a runnable session bean, and create business methods declaratively. [ tell me more...]
HelloWorldSession as the EJB name to follow along with the example. Make sure
State
less
and
Container
are selected. Confirm that
Generate
Session Facade Methods
is not selected. Click
Next
.
To follow along with the example, in this step and throughout the cards, enter values as shown in the instructions. Then you will be able to follow the steps in the cue cards exactly as written. [ tell me more...]
acme.ejb.session.HelloWorldSessionBean as the bean class name, and click
Next
.
Changing the package name in the Bean Class field will put all the session bean information in its own package. Partitioning your EJBs in different packages can be less confusing when there are many components in a project. [ tell me more...]
When you create a session bean using the wizard, you have the option of creating local or remote interfaces, or both. Which interfaces you choose to generate depends on the type of client. If the client is running in the same virtual machine (VM), a local interface is the best choice. If the client is running a separate VM, a remote interface is required. Web clients run in the same VM, while Java clients run in a different VM. In the example, you will be creating a Java client, so you only need to generate the remote interface. [ tell me more...]
When you complete the steps for creating your session bean, the Application Navigator should look similar to this: [ tell me more...]
A session bean contains business methods that can be executed by a client. In the example, you will use the source editor to add a method to the bean class generated by JDeveloper. [ tell me more...]
While you can add a new method using the source editor, you can also use JDeveloper's dialogs to create methods declaratively. Once you've selected a session bean in the Application Navigator, you can create a new method by right-clicking
HelloWorldSessionBean in the Structure window, and then choosing
EJB
New Method. [
tell me more...]
You can use the Bean Method Details dialog to edit the details of an existing EJB method or create a new method. [ tell me more...]
When you complete the steps for adding a bean method and exposing the method through a remote interface, the source editor should look similar to this: [ tell me more...]
JDeveloper includes a sample Java client utility for testing your business services. To begin generating a sample Java client, in the Application Navigator right-click the session bean and choose New Sample Java Client . [ tell me more...]
acme.client.HelloWorldSessionClient in the
Clie
nt Class Name
field to create the client in a separate package in the project. Make sure
IntegratedWebLogicServer is selected in the
Appli
cation Server Connection
dropdown list, then click
OK.
When you create a sample Java client, you can choose to create the client in the same package as the session bean, or specify a different package. Putting your client files in a separate package is a good practice because it simplifies navigation in large projects. [ tell me more...]
Successful compilation message in the Messages Log window.
When you complete the steps for creating a sample Java client, the Application Navigator should look like this: [ tell me more...]
Copyright © 1997, 2009, Oracle. All rights reserved.