JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle GlassFish Server Message Queue 4.5 Developer's Guide for Java Clients
search filter icon
search icon

Document Information

Preface

1.  Overview

Setting Up Your Environment

Starting and Testing a Message Broker

To Start a Broker

To Test a Broker

Developing a Client Application

To Produce Messages

To Consume Messages

Compiling and Running a Client Application

To Compile and Run the HelloWorldMessage Application

Deploying a Client Application

Example Application Code

2.  Using the Java API

3.  Message Queue Clients: Design and Features

4.  Using the Metrics Monitoring API

5.  Working with SOAP Messages

6.  Embedding a Message Queue Broker in a Java Client

A.  Warning Messages and Client Error Codes

Index

Setting Up Your Environment

The Message Queue files that need to be used in conjunction with Message Queue Java clients can be found in the IMQ_HOME/lib directory. Message Queue Java clients need to be able to use several .jar files found in this directory when these clients are compiled and run.

You need to set the CLASSPATH environment variable when compiling and running a JMS client.

The value of CLASSPATH depends on the following factors:

The table below lists the .jar files you need to compile and run different kinds of code.

Table 1-1 .jar Files Needed in CLASSPATH

Type of Code
To Compile
To Run
Remarks
JMS client
jms.jar imq.jar jndi.jar
jms.jar imq.jar jndi.jar

Directory containing compiled Java application or ’.’

See discussion of JNDI .jar files, following this table.
SOAP Client
saaj-api.jar activation.jar
saaj-api.jar

Directory containing compiled Java application or ’.’

SOAP Servlet
jaxm-api.jar saaj-api.jar activation.jar
GlassFish Server already includes these .jar files for SOAP servlet support.
Code using SOAP/JMS transformer utilities
imqxm.jar

.jar files for JMS and SOAP clients

imqxm.jar
Also add the appropriate .jar files listed in this table for the kind of code you are writing.

A client application must be able to access the file jndi.jar even if the application does not use the Java Naming and Directory Interface (JNDI) directly to look up Message Queue administered objects. This is because JNDI is referenced by the Destination and ConnectionFactory classes.

JNDI .jar files are bundled with JDK 1.4. Thus, if you are using this JDK, you do not have to add jndi.jar to your CLASSPATH setting. However, if you are using an earlier version of the JDK, you must include jndi.jar in your CLASSPATH.

If you are using JNDI to look up Message Queue administered objects, you must also include the following files in your CLASSPATH setting: