|
Here is the quickest way to start using Oracle9i
JDeveloper with BEA's WebLogic 6.1. More information can be found in Oracle9i JDeveloper online help. Click here - for an online demonstration.
Downloading and installing Oracle9i JDeveloper
1. Go to
and click on the "Oracle9i JDeveloper" download
link (on the right). Show me.
2. Answer the short survey and accept the license terms.
3. Download the complete version. Show
me
4. Unzip the downloaded zip file. (Well unzip to D:\jdeveloper
in this sample). Show me.
5. Go to d:\jdeveloper\jdev\bin and double click the jdevw.exe
to invoke Oracle9i JDeveloper. You might want to create a
short-cut to this file on your desktop.
6. Once JDeveloper started you might want to close the default
introduction page. Use the window->close all editors option
from the menu. Show me.
7. You are now ready to start developing in Oacle9i JDeveloper.
Mandatory setup to work with WebLogic
1. Copy d:\bea\wlserver6.1\lib\weblogic.jar to d:\jdeveloper\jdev\lib\ext
.
2. Restart Oracle9i JDeveloper after the file was copied to
its new location.
3. This tutorial assumes you are using the WebLogic Default Server.
Creating a connection to WebLogic from Oracle9i JDeveloper
1. Expand the connections node in the system navigator of
Oracle9i JDeveloper. Show
me
2. Right click on "Application Server" node and
choose new connection.
3. Follow the wizard to define a connection.
4. Name this connection "Weblogic61" and set the connection type to "WebLogic server 6.x". Show
me
5. Supply the system password and check the deploy password
check box. Show me.
6. Set the Host Name to the ip address where the WebLogic instance runs (127.0.0.1 if it is on the same machine as JDeveloper). Show
me
7. Test your connection and make sure you get "success".
Show me.
Creating a Servlet and deploying it to WebLogic
1. Right click on workspace
in the system navigator and choose "New Workspace". Show me.
2. Accept the default workspace name. Show me.
3. Create an empty project in your workspace. Show me.
4. Right click on your empty project and choose "Project
Settings ". Show me.
5. In the J2EE node change the names of the application name and the Context root to jdev. Show
me
6. In the compiler node choose UTF-8 as the "Character
encoding" for this project. Show
me
7. Right click on your empty project and choose "New". Show me.
8. From the gallery choose "Web Objects" and then
"HTTP Servlet". Show
me
9. Follow the Servlet wizards accepting the defaults for package and servlet names. Show
me
10. In the second step add a new parameter and rename it to p1. Show
me
11. In the third step check the Servlet mapping check box and accept the defaults. Show
me
12. In the servlet code add a line to print the value of p1: out.println("The value I got was "+var0); . Show
me
13. Right click on "Project1" and choose new. Show
me
14. From the Gallery choose "Deployment Profiles"
and "WAR File". Show
me
15. Accept the default for the deployment file. Show me.
16. Change the Enterprise application name to jdev in the WAR deployment profile setting. Show me.
17. Right click on the "webapp1.deploy" deployment file and choose deploy to-> Weblogic61. Show me.
18. The log window will show the status of the deployment.
Show me.
19. Once deployed you can see the servlet in your WebLogic
console under the deployments->webapplications node. Show me.
20. Test your servlet from a browser by going to the following URL http://127.0.0.1:7001/jdev/servlet1?p1=OK. Show me. (Note: the "jdev" context used before "servlet1" is the context set in step 5 and 16).
Creating an EJB and deploying it to WebLogic
1. Right click on workspace
in the system navigator and choose "New Workspace". Show me.
2. Accept the default workspace name. Show me.
3. Create an empty project in your workspace. Show me.
4. Right click on your empty project and choose "Project
Settings ". Show me.
5. in the compiler node choose UTF-8 as the "Character
encoding" for this project. Show
me
6. Right click on your empty project and choose "New". Show me.
7. From the gallery choose "Enterprise JavaBean"
and then "Stateless Session Bean". Show
me
8. Follow the EJB wizards accepting the defaults for the "EJB
name" and "EJB type". Show
me
9. In the second step accept all the default names for the
various interfaces and click Finish. Show
me
10. In the graphical editor switch to the Methods tab.
Click the add a method button. Show
me
11. Make the method an EJB Interface remote method called
"sayHello" that returns a String. Show
me
12. To add code to this method double click on the MySessionEJBBean.java file
in the system navigator. replace the null with "Hello from EJB". Show
me
13. Right click on the project and choose New. Show
me
14. Choose "Enterprise JavaBean" and "WebLogic
EJB Descriptor" to create a descriptor file for the EJB. Show
me
15. If you want to edit the values in the descriptor file right click
it and choose "Settings". Show
me
16. Right click on the project and choose New. Show
me
17. Choose "Deployment Profiles" and "EJB JAR
File". Show me.
18. Accept the default name and location for the deploy file.
Show me.
19. Accept the defaults for the deployment profile settings. Show
me
20. Right click on ejb1.deploy and choose deploy to->Weblogic61. Show
me
21. The log window will show the status of the deployment.
Show me.
22. Once deployed you can see the EJB in your WebLogic console.
Show me.
Building a client to test the EJB
1. Right click on the project and select Project Settings. Show me.
2. Choose the libraries node and click the New button to create a new library. Show me.
3. Name the new library weblogic and add the D:\jdeveloper\jdev\lib\ext\weblogic.jar file to it. Show me.
4. Your project should contain the weblogic library now. Show me.
5. Right Click on the project and choose New Class. Show me.
6. Name the class Client. Show me.
7. Replace the code in Client.java file with this code. Show me.
8. Right Click on Client.java and choose Run Client.java. Show me.
9. The log window will show the result returned from the EJB. Show me.
|