Novell exteNd Messaging Platform JMS 5.1

Frequently Asked Questions

Contents

This FAQ is divided into 4 sections:

Below is a list of frequently asked questions for each of these sections.

Installation

How can I use a different jvm?
What gets installed on my system?
What tools are available in the product?
Database creation failed during install because I did't have the JDBC driver on my CLASSPATH (or because of some other problem). What can I do?
I unintentionally installed the ORB as a Java 2 extension during install. How do I get rid of it?
Can I install the Novell exteNd Messaging Platform from the command line?
How do I uninstall the Novell exteNd Messaging Plaform from my system?

Getting Started

When I run 'jmqserv' the following message appears: 'DB not created or unavailable...'
When I run 'jmqserv' the following message appears: 'detected ORB version 3.1; the JMS server requires ORB version 5.1 or higher ...'
When I run 'jmqserv' the message 'java.sql.SQLException' followed by some error message is printed.
When I run 'jmqserv' or 'dbinit' this message is printed: 'Missing XX in properties file' and XX is either 'driver name', 'password' 'username', 'jdbcURL', 'min pool size' or 'max pool size'.
When I run 'jmqserv', 'jmqrun' or 'dbinit' this message is printed: 'Exception in thread "main" java.lang.NoClassDefFoundError: com/sssw/jbroker/util/Messages'
When I run 'jmqserv', 'jmqrun' or 'dbinit' this message is printed: 'Exception in thread "main" java.lang.NoClassDefFoundError: com/sssw/jbroker/api/security/SecurityException'
What does the 'jmqrun' program do?
What is "iioploc" in the ORBDefaultInitRef command line argument?
When I run a JMS client program I get the following error message: Exception in thread "main" org.omg.CORBA.BAD_PARAM: unable to resolve initial reference: NameService minor code: 0 completed: No
Can I use 'jmqrun' to run clients that are not on the same host as the JMS server?
When running a JMS client program I get the following exception: javax.naming.ConfigurationException: COS Name Service not registered with ORB under the name 'NameService' [Root exception is org.omg.CORBA.ORBPackage.InvalidName: unable to resolve initial reference: NameService]
Running a JMS client program gives the following exception: 'Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial'
How do I run the JMS server with more memory?
How do clients exchange messages with the JMS server?
How do I run a client from a different host?
When I run a client I get the following exception: javax.jms.JMSException: maximum connection count of developer version exceeded.
How do I stop the JMS server?
When I start 'jmqserv' I get the following error message: 'Socket bind exception: Address already in use.'
Can I run multiple JMS servers on the same machine?
Can multiple JMS servers share the same database?

Advanced Messaging

The number of threads in my JMS client application keeps growing. What could be going on?
I have a multi homed host. How do I bind the JMS server to a specific adapter?
Why don't I get connect time fail-over when I run my client applications?
Can you summarize what the JMS cluster does?
How does clustering affect Pub/Sub messaging?
How does clustering affect P2P messaging?
Why does it sometimes take longer to send messages using a cluster.
My producer application does not fail-over when I shutdown one of the brokers in the cluster. Why?
How does clustering affect message ordering?
Are there any limitation to producer fault-tolerance?

Java Message Service

What guarantees does JMS make about message ordering?
Can I send an XML document using JMS?
Can I acknowledge a specific message?
Can I browse messages on a topic?
How does a selector work?
Can I use JMS to simulate a synchronous request (like invoking using RMI)?
Are there any other FAQ's on JMS available?

Installation

Question:

How can I use a different jvm?

Answer:

First make sure that both the Novell exteNd Messaging Platform's JMS and the database you're using work with the that particular jvm. The 'jmqserv' command simply uses the 'java' program found in your PATH environment variable, so first you need to update your path to point to the new jvm.

Since JMS relies on the ORB you must also make sure that the ORB can be found. If you have installed the ORB as an extension (this is the default) for the previous jvm you were using you have two choices:

  • Install the ORB as an extension of the new jvm you're trying to use.

  • Include the 'mp-orb.jar' file in your CLASSPATH environment variable. If the ORB was installed as an extension, this file is located in the jre/lib/ext directory below you java installation directory (JAVA_HOME). Also you must make the shared library available:

    • On Windows: Include %JAVA_HOME%\jre\lib\ext\x86 in your PATH environment variable. This gives Windows access to the 'mporb12.dll' file.

    • On Solaris: Include $JAVA_HOME\jre\lib\ext\sparc in your LD_LIBRARY_PATH environment variable to make 'libmporb12.so' available.

    • On Linux: Include $JAVA_HOME\jre\lib\ext\linux-x86 in your LD_LIBRARY_PATH environment variable to make 'libmporb12.so' available.

    • On Netware: Include %JAVA_HOME%\jre\lib\ext\netware in your PATH environment variable. This gives Netware access to the 'mporb12.nlm' file.

Note that when the ORB is installed as a Java extension, the jars and shared libraries under the jre/lib/ext directory are automatically available when invoking the 'java' program. If the ORB was not installed as a Java 2 extension, the shared libraries and mp-orb.jar file are located in the top-level lib directory.


Question:

What gets installed on my system?

Answer:

The Novell exteNd Messaging Platform installation always installs the binaries, libraries, documentation and sample programs in the directory you specified during installation. Since JMS relies on the ORB it will also install this unless it was already installed. By default the ORB is installed as a Java extension. If you do not have write permission in the Java home directory, the installer will install the ORB in the top-level lib directory.

Question:

What tools are available in the product?

Answer:

The Novell exteNd Messaging Platform's JMS comes with several tools for managing the server. Please refer to the administrator's guide and the tools man pages for more details.

Question:

Database creation failed during install because I did't have the JDBC driver on my CLASSPATH (or because of some other problem). What can I do?

Answer:

You can just create the JMS database tables after installation. Simply edit the msgsvc.properties file located in the top-level lib directory to match your database settings and run 'dbinit -create'. For more information, see the man page for the dbinit program.

Question:

I unintentionally installed the ORB as a Java 2 extension during install. How do I get rid of it?

Answer:

Locate the jre/lib/ext directory of your Java 2 runtime environment. You need to move the 'mp-orb.jar' file and the 'security.properties' file. For your platform you also need to do this:

  • If you're on Solaris, you also need to move 'libmporb12.so' from the sparc directory.
  • On Linux, you need to move the 'libmporb12.so' from the linux-x86 directory.
  • On Windows, you need to move the 'mporb12.dll' from the x86 directory.
  • On Netware, you need to move the 'mporb12.nlm' from the netware directory.

You should move these file to another place where JMS can locate them, e.g. the top-level lib directory. Then you need to update you environment variables as follows:

  • On Solaris/Linux, you must set LD_LIBRARY_PATH to include the directory where 'libmporb12.so' resides. If the 'mp-orb.jar' and 'security.properties' files are in the top-level lib directory, they will automatically get picked up by the JMS binaries. If these files are in a different directory, you need to update your CLASSPATH to include both 'mp-orb.jar' and the directory where the 'security.properties' file is located.

  • On Windows, you must set PATH to include the directory where 'mporb12.dll' resides. If the 'mp-orb.jar' and 'security.properties' files are in the top-level lib directory, they will automatically get picked up by the JMS binaries. If these files are in a different directory, you need to update your CLASSPATH to include both 'mp-orb.jar' and the directory where the 'security.properties' file is located.

  • On Netware, you must set the SEARCH path to include the directory where 'mporb12.nlm' resides. If the 'mp-orb.jar' and 'security.properties' files are in the top-level lib directory, they will automatically get picked up by the JMS binaries. If these files are in a different directory, you need to update your CLASSPATH to include both 'mp-orb.jar' and the directory where the 'security.properties' file is located.

Question:

Can I install the Novell exteNd Messaging Platform from the command line?

Answer:

Yes. You can run the installer with the -silent flag as follows:
   java -jar jbrokerMQ21.jar -silent
If you wish to change the installation directory, create a database and install the ORB as a Java 2 extension, you can use a command line like this:
   java -jar jbrokerMQ21.jar -silent \
       -W target.dir=/opt/jbrokerMQ21 \
       -W orb.extension=true \
       -W db.store=ASAnywhere \
       -W db.create=true \
       -W db.url=jdbc:sybase:Tds:localhost:2641/database \
       -W db.driver=com.sybase.jdbc2.jdbc.SybDriver \
       -W db.user=dba \
       -W db.password=sql \
       -W db.minPoolSize=10 \
       -W db.maxPoolSize=20 \
       -W db.classPath=/usr/local/jConnect-5_5/classes/jconn2.jar \
       -W server.name=broker1 \
       -W server.port=3456 \
       -W server.secure=true \
       -W server.log=/tmp/logs

Question:

How do I uninstall the Novell exteNd Messaging Plaform from my system?

Answer:

If you really want to uninstall the Novell exteNd Messaging Plaform from you system, you can run the uninstall tool. Simply point to the uninstall.jar file in the _uninst directory where you originally installed the product:
   java -jar _uninst/uninstall.jar

Getting Started

Question:

When I run 'jmqserv' the following message appears: 'DB not created or unavailable...'

Answer:

You probably haven't created the JMS database. Try to run 'dbinit -create'

Question:

When I run 'jmqserv' the following message appears: 'detected ORB version 3.1; the JMS server requires ORB version 5.1 or higher ...'

Answer:

Your environment points to a previous version of the ORB, which is not supported by this version of JMS. This often happens if the ORB is installed as a Java 2 extension on the Java virtual machine you are using. You need to remove or upgrade the extension, or update your environment to point to a newer version of the ORB. Please refer here for information about JVM settings.

Question:

When I run 'jmqserv' the message 'java.sql.SQLException' followed by some error message is printed.

Answer:

One of the JDBC properties in the msgsvc.properties file is most likely incorrect. Maybe the database you refer to in the URL doesn't exist? You can try to run the 'dbinit' or 'jmqserv' program with the '-J-DJMQDebug=true' flag to get a full stack trace.

Question:

When I run 'jmqserv' or 'dbinit' this message is printed: 'Missing XX in properties file' and XX is either 'driver name', 'password' 'username', 'jdbcURL', 'min pool size' or 'max pool size'.

Answer:

This happens if the msgsvc.properties file doesn't have that entry. Please refer to the sample msgsvc.properties file and the documentation.

Question:

When I run 'jmqserv', 'jmqrun' or 'dbinit' this message is printed: 'Exception in thread "main" java.lang.NoClassDefFoundError: com/sssw/jbroker/util/Messages'

Answer:

This happens if the ORB can not be found. Please ensure that the ORB is installed as the default ORB for the JDK or JRE you are using. Alternatively, refer to the question on how to use a different jvm.

Question:

When I run 'jmqserv', 'jmqrun' or 'dbinit' this message is printed: 'Exception in thread "main" java.lang.NoClassDefFoundError: com/sssw/jbroker/api/security/SecurityException'

Answer:

This happens if the ORB can not be found. Please ensure that ORB is installed as the default ORB for the JDK or JRE you are using. Alternatively, refer to the question on how to use a different jvm.

Question:

What does the 'jmqrun' program do?

Answer:

This program invokes a JVM with the appropriate parameters for JMS clients on the command line. This includes setting the correct CLASSPATH and various system properties. Running 'jmqrun' is equivalent to invoking java directly with this command line:
   java -DORBDefaultInitRef=iioploc://localhost:53506 \
      -Djava.naming.factory.object=com.sssw.jms.naming.JMQObjectFactory \
      -Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory \
      -Dorg.omg.CORBA.ORBClass=com.sssw.jbroker.ORBLite \
      -Dorg.omg.CORBA.ORBSingletonClass=com.sssw.jbroker.orb.SingletonORB \
      -Djavax.rmi.CORBA.StubClass=com.sssw.jbroker.rmi.StubDelegate \
      -Djavax.rmi.CORBA.UtilClass=com.sssw.jbroker.rmi.UtilDelegate \
      -Djavax.rmi.CORBA.PortableRemoteObjectClass=com.sssw.jbroker.rmi.PortableRemoteObjectDelegate \
      -classpath <all .jar and .zip files in the top-level lib directory prepended to CLASSPATH>
      <class name> [parameters]
The JMS server's port information is derived from the msgsvc.properties file. The two naming system properties instructs the client program to use JNDI via a CosNaming provider. The rest of the properties ensure that the JMS server will use the ORB for IIOP communication. Note that you can also put -J flags on the command line to pass parameters to the jvm. If you want to run your client with additional memory you can do this:
   jmqrun -J-Xmx250m <class name> [parameters]

Question:

What is "iioploc" in the ORBDefaultInitRef command line argument?

Answer:

The argument given to ORBDefaultInitRef is a URL where iioploc specifies the protocol. With iioploc you can locate initial object references. This is used to tell the client program where to find the JMS server.

Question:

When I run a JMS client program I get the following error message: Exception in thread "main" org.omg.CORBA.BAD_PARAM: unable to resolve initial reference: NameService minor code: 0 completed: No

Answer:

This typically happens if the JMS server is not running. If you're using the ORBDefaultInitRef command line argument, ensure that the JMS server is running on the host and port specified.

Question:

Can I use 'jmqrun' to run clients that are not on the same host as the JMS server?

Answer:

Yes, you can modify the default parameters of the jmqrun program using the -J flag:
   jmqrun -J-DORBDefaultInitRef=iioploc://<hostname>:<port> <class name> [parameters]

Question:

When running a JMS client program I get the following exception: javax.naming.ConfigurationException: COS Name Service not registered with ORB under the name 'NameService' [Root exception is org.omg.CORBA.ORBPackage.InvalidName: unable to resolve initial reference: NameService]

Answer:

The JMS server is probably not running. This error occurs because the JMS server has a naming service running in-process and client applications expect to find the naming service there. If the JMS server is definitely running, this can also happen if you didn't put the '-DORBDefaultInitRef=iioploc://host:port' on the command line. If the JMS server is running on the local host on port 53506, you should specify '-DORBDefaultInitRef=iioploc://localhost:53506' on the command line.

Question:

Running a JMS client program gives the following exception: 'Exception in thread "main" javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial'

Answer:

You need to specify the '-Djava.naming.factory.initial=com.sun.jndi.cosnaming.CNCtxFactory' on the command line of your client program. This instructs JNDI to use a CORBA naming service to locate JMS administrated objects.

Question:

How do I run the JMS server with more memory?

Answer:

You can pass flags to the jvm using the -J command line flag. To set the maximum heap size to 250 MB you can start the JMS server like this:
   jmqserv -J-Xmx250m

Question:

How do clients exchange messages with the JMS server?

Answer:

The JMS server is running on top of the ORB and therefore uses IIOP. IIOP in turn uses the TCP/IP protocol stack to send messages. IIOP is a standards-based protocol with many advantages, including scalability, robustness, and interoperability.

Question:

How do I run a client from a different host?

Answer:

In order to run clients, you need the JMS libraries on the client. The easiest thing to do it typically to install JMS on the client machine. Then replace the 'localhost' part of the ORBDefaultInitRef command line parameter with the host where the JMS server is running. You can still use jmqrun.

Question:

When I run a client I get the following exception: javax.jms.JMSException: maximum connection count of developer version exceeded.

Answer:

You are trying to create more connections than are allowed by the developer version. In order to create more connections, you need to purchase a JMS license.

Question:

How do I stop the JMS server?

Answer:

Simply invoke 'jmqserv -stop' from a different window.

Question:

When I start 'jmqserv' I get the following error message: 'Socket bind exception: Address already in use.'

Answer:

This means that another JMS server is already running on that port. You must first stop the currently running broker or start the new broker on a different port.

Question:

Can I run multiple JMS servers on the same machine?

Answer:

Yes, but you must be careful that the servers do not conflict when accessing the database. The msgsvc.properties file has an entry called 'msgsvc.name' which identifies a particular JMS server. Multiple server must have different names to avoid database conflicts. For each different message server name, you must run 'dbinit -create' to create the tables for the JMS server with said name. You also need to ensure that each server is running on a different port. The easiest way to handle this is to maintain two separate property files and then start the two brokers like this:
   jmqserv -props b1.properties
   jmqserv -props b2.properties

Question:

Can multiple JMS servers share the same database?

Answer:

Yes, but they can not share the same tables. For each server you can create different tables in the same database by giving the server a different name. Refer to this entry for more information.

Advanced Messaging

Question:

The number of threads in my JMS client application keeps growing. What could be going on?

Answer:

The most likely cause from the JMS client library's point of view is creation of InitialContext objects. Because of the way the JNDI/CosNaming driver is structured, a new ORB is created every single time you instantiate an InitialContext object. You should therefore only create one initial naming context in each client application.

Question:

I have a multi homed host. How do I bind the JMS server to a specific adapter?

Answer:

Since JMS is a CORBA server based on the ORB, you can use the ORB runtime property ORBHost. Simply run the server like this:
   jmqserv -J-DORBHost=hostname
Please refer to the ORB documentation for additional details.

Question:

Why don't I get connect time fail-over when I run my client applications?

Answer:

This is probably because you didn't specify the ORBDefaultInitRef property correctly. This property determines the locations of the JMS name services and must match your JNDI lookup strings. As an example, if you are using a connection factory with a lookup string 'topic://jms1:53506,jms2:53506/connectionFactory' you need to specify ORBDefaultInitRef as follows:
   jmqrun -J-DORBDefaultInitRef=iioploc://jms1:53506,jms2:53506 Client

Question:

Can you summarize what the JMS cluster does?

Answer:

Here are the key features:
  • It synchronizes destination information, users, groups and ACL's across all brokers in the cluster. This means you can get destinations and authenticate using any available broker.
  • Producers applications can send to any available broker. The JMS cluster will automatically route messages to the appropriate destinations.
  • Producer applications are fault-tolerant. If a producer can not send to one broker, JMS will transparantly and automatically send the message to another broker.
  • Consumer applications can receive from any broker. If a queue receiver connects to a queue which is not located on the local broker, a proxy will forward messages from the appropriate broker to the receiver.
  • Both producer and consumer applications have connect time fail-over. If one broker is not available, the application automatically connects to another available broker.

Question:

How does clustering affect Pub/Sub messaging?

Answer:

Topics are automatically available on all brokers in a JMS cluster. Topic messages are forwarded between brokers which means the publishers can publish messages to any broker and subscribers can receive messages from any broker.

Question:

How does clustering affect P2P messaging?

Answer:

Queues are bound to a broker to ensure that only one receiver can get each queue messages. Client applications can connect to a specific queue by using the "queue@broker" JNDI lookup string. Queue receivers can use a proxy to receive messages from a broker where the queue is not located.

Question:

Why does it sometimes take longer to send messages using a cluster.

Answer:

This can happens right after you start the servers in the cluster. The brokers in a cluster ping each other at regular intervals and until the clustered brokers have been inter-connected, messages will not flow.

Question:

My producer application does not fail-over when I shutdown one of the brokers in the cluster. Why?

Answer:

Probably because the connection you use also has consumers. Fail-over is only supported for producer applications. If any session created by the connection has a consumer (or the connection has a connection consumer), fail-over will not occur.

Question:

How does clustering affect message ordering?

Answer:

Ordering can be affected because of message delays due to latency and broker downtime. If you have two subscribers for the same topic, but connected to two different brokers, they may receive messages in different order if multiple publishers are sending messages to both brokers.

Question:

Are there any limitation to producer fault-tolerance?

Answer:

Besides the requirement that the connection can not have any consumers, it is also not possible to fail-over a distributed transaction. This restriction exists because you can't prepare the transaction on one broker and commit it on another broker. Finally, you can't fail-over on a temporary destination since these are not replicated on the cluster.

Java Message Service

Question:

What guarantees does JMS make about message ordering?

Answer:

According to the JMS specification, messages with higher priority should be expedited. This means that if you send two messages where the latter message has higher priority, JMS may delivery the last message first. Within priority, the JMS specification requires that messages are ordered within the scope of a session. If one or more message producers use the same session to send messages, consumers will receive those messages in the order they were received by the session on the producer side. In summary, FIFO order is enforced within a session. Messages from multiple suppliers running in different sessions or processes will be ordered subject to when they were received by the JMS server.

Question:

Can I send an XML document using JMS?

Answer:

Yes, just insert the XML document into a TextMessage using the setText method. You can extract the XML document on the receiver side by typecasting the Message to a TextMessage and invoke the getText method.

Question:

Can I acknowledge a specific message?

Answer:

Yes, but you have to use JMS proprietary API's. The JMQSession defines an INDIVIDUAL_ACKNOWLEDGE mode, which causes the Message's acknowledge method to only acknowledge the current message. With standard API's this is not possible. Even when using CLIENT_ACKNOWLEDGE, the Message's acknowledge method will not only acknowledge the current message but all messages received since last time acknowledge was called.

Question:

Can I browse messages on a topic?

Answer:

Since a topic does not retain messages for future subscribers, it is not possible to have a regular topic browser. You can of course create a topic subscriber, which will then see all messages on the topic since the time of connection. Also, you can create a durable subscriber and every time this durable subscriber connects it can browse all message since last time it was connected. If you want such a browser to be able to browse the topic messages more than once, you should use CLIENT_ACKNOWLEDGE and never acknowledge any messages. Note that such a durable subscriber will accumulate messages forever, so you need some mechanism to expire or acknowledge messages eventually.

Question:

How does a selector work?

Answer:

In Pub/Sub a selector is like a filter: if a message doesn't match a subscribers selector, that message will not exist as far as that subscriber is concerned. It will be as if the message was received by the topic before the subscriber connected. In P2P a selector merely limits which message a particular receiver can see, i.e. it is a view applied by the receiver. A receiver can get messages, which did not match another receivers selector.

Question:

Can I use JMS to simulate a synchronous request (like invoking using RMI)?

Answer:

Yes, you can use a TopicRequestor or a QueueRequestor. A requestor is a concrete class in the javax.jms package, which sends a JMS message on a regular destination with the ReplyTo field set to a newly created temporary destination. Application developers are responsible for implementing the consumer, which must send a message back to the ReplyTo destination. Once the requestor receives a reply on the temporary topic, the reply is handed back to the user of the requestor.

Question:

Are there any other FAQ's on JMS available?

Answer:

Yes, you can try one of these: You can also visit the Novell Developer Site for articles and discussion about JMS.

Copyright © 1998-2003, Novell, Inc. All rights reserved.