} }
Files Prepare Run Troubleshooting Related Topics
This example shows how to send JMS messages using a Java servlet.
Directory Location:
MW_HOME/wlserver_10.3/samples/server/examples/jms/sender/
(where MW_HOME is the directory containing your Oracle WebLogic Server installation)
File Click source files to view code. |
Description |
---|---|
build.xml | Ant build file that contains targets for building and running the example. |
SenderServlet.java | Servlet to run example. |
Before working with this example:
The following have been preset and/or preconfigured for your convenience:
You need to choose one or more targets for the JMS server associated with the topic. The examplesJMSServer server has been preconfigured to include the examplesServer as a chosen target.
You need to deploy the SenderServlet servlet as part of a web application hosted on the Oracle WebLogic Server. For your convenience, the SenderServlet servlet has been deployed on the examplesWebApp provided. For more information on deploying a servlet, refer to Creating and Configuring Servlets in Developing Web Applications, Servlets, and JSPs for Oracle WebLogic Server.
In order to support persistent messaging, a backing store must be configured and assigned to the JMS server. This example defines a JDBC backing store that uses a Pointbase Java database. An evaluation version of Pointbase is included with Oracle WebLogic Server and a demo database is provided.
No special configuration is required for this example because the weblogic.examples.jms.QueueConnectionFactory and exampleTopic Connection Factories are preconfigured. To verify that the Connection Factoies are configured and deployed, follow the steps below:
To configure Oracle WebLogic Server:
The script will compile the SenderServlet, as shown in this example for a Windows system:
prompt> javac -d %EX_WEBAPP_CLASSES% SenderServlet.java
and copy the file to the following directory: SAMPLES_HOME\server\examples\build\examplesWebApp\WEB-INF\classes\examples\jms\sender
http://hostname:port/examplesWebApp/SenderServletwhere:
(Internet connection required.)