Assignment 4 due May 11. 11:59 pm.
Resources:
Basics
Install Weblogic under your home directory using the script :
/stage/classes/current/51024-1/pub/weblogic_install2009.sh
cd $WL_HOME/samples/domains/wl_server
startWebLogic.sh
Note that it may take a few minutes for the server to start. Verify that your browser is running ( http://<machine>.cs.uchicago.edu:7001 ).
To use the management console go to: http://<machine>.cs.uchicago.edu:7001/console where <machine> is the host where you started your Weblogic server. You'll need to enable applets for full functionality.
Login using username = weblogic and password = weblogic.
A number of bean examples are already deployed.
IMPORTANT: To cleanly stop the server don't use Ctrl-C but:
Deploy a Stateless EJB
- mkdir $WL_HOME/samples/server/examples/src/examples/<YOUR_DIR>
cd $WL_HOME/samples/server/examples/src/examples/<YOUR_DIR>- cp -r /stage/classes/current/51024-1/pub/EJB/HelloWorldExample/ .
cd $WL_HOME/samples/server/examples/src/examples/<YOUR_DIR>/HelloWorldExample
make
It will also compile your client and put all .class file in the $WL_HOME/samples/server/examples/build/clientclasses/examples/helloworld directory ( which is already in your CLASSPATH).
Then, for this example, you do not need to modify the deployment descriptors: ejb-jar.xml and weblogic-ejb-jar.xml but please take a look at them.
- Auto-deployment is on by default. This means that at startup, and whenever you add a file to the applications directory the server tries to load your bean. You can turn auto-deployment off by starting the server in production mode with -Dweblogic.ProductionModeEnabled=true. The Makefile copied the bean jar file already to the applications directory so for the config you are using right now you do not have to do anyting.
- If your server is started you can use the management console to load the bean and edit deployment descriptors if you need. (Note however that these changes are not persistent)
- Also, if your server is started, you can also use Weblogic's deployment tool from the command line.
Info on deploying applications. More info on editing deployment descriptors.
java -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Djava.naming.provider.url=t3://localhost:7001 examples.helloworld.HelloClient
Also take a look at the server's output to see the sequence of methods called.
A stateful session example is available here:
/stage/classes/current/51024-1/pub/EJB/Count
Assignment 4 (due May 11, 11:59 pm). Create and deploy your own
Stateless EJB
Now that you have successfully deployed your first EJB, the next step is
to create a bean yourself. Implement and deploy the calculator from Lab
1 and 4 as an EJB. Submit your code in a gzipped tarball by the due date to the TAs (sravana@cs and soner@cs). Use the structure from milestone 1.