Registering a JMS ConnectionFactory using
JNDI-Based Provider
Use this procedure to register a JMS ConnectionFactory when your JMS provider also provides a naming system. It applies both to the JMS Provider Service in the J2EE Engine and to any external JMS provider with naming provided.
With the administration tools of J2EE Engine, you can register a standalone ConnectionFactory. It is deployed on the server as an application that contains only the deployment descriptor for the JMS object.
You must have obtained a ConnectionFactory instance from your JMS Provider. The JMS Connector Service wraps the instance and provides transaction and resource management within the application server. Thus you do not need to manage the transactions and resource handling programmatically in your application.
If you use the JMS Provider Service of the J2EE Engine, see Managing JMS Connection Factories for more information about creating connection factories.
You can create a ConnectionFactory using the:
● Visual Administrator
● Console Administrator
1. In the Runtime tab of JMS Connector Service, choose Resources → Factories.
2.
Choose
on
the toolbar.
3. In the General tab complete the following fields. The user and password that you enter are used from JMS Connector service when a connection from the JMS Provider is required, that is, jmsFactory.getConnection (provided-user, provided-password) is invoked. If the default security settings of SAP JMS Provider are not changed, you can leave these fields empty. In this case an anonymous user is used. If default security settings of SAP JMS Provider are changed, then you have to provide a user that has enough permissions to use specified JMS factories and destinations.
Field |
Description |
Example |
Application Name |
Specify a name to which the ConnectionFactory is assigned. This name is used for the configuration that holds the object.
Do not enter the name of an application that is already deployed on the server. This leads to re-deployment of the application and data loss. |
myApplication |
Factory Name |
Enter a name for your ConnectionFactory. The system uses it to bind the factory in the naming system. You can look up the ConnectionFactory using this name. |
myConnFactory |
Client ID |
Enter a client identifier. It is also assigned to the connection that is created with this ConnectionFactory. The Client ID is not a required field. If you leave it empty, it defaults to the client ID of the connection factory from the JMS provider. |
|
User |
Enter a username for authentication to the JMS provider. This is the username that you used to obtain a connection factory from the JMS provider. The JMS provider assigns the same credentials to the connections created by this ConnectionFactory, unless you specify a different username for a connection in the application code. If you use the JMS Provider Service in the J2EE Engine, the user can be any of the defined users on the server. |
Administrator |
Password |
Enter a password corresponding to the username. |
|
Description |
You can enter descriptive text for the ConnectionFactory. This field is optional. |
This is an example for a JMS ConnectionFactory. |
Provider Type |
Choose JNDI Based from the drop-down menu. |
|
Library |
From the drop-down menu choose a library that the JMS Connector Service uses to obtain a connection factory instance. You need a JMS library when you use an external JMS provider instead of the JMS Provider Service in the J2EE Engine.
To use a JMS library, you must first deploy and define it on the J2EE Engine. |
|
Aliases |
You can add an unlimited number of aliases, which are alternative names of the connection factory. They enable the factory to be used by multiple clients and prevent you from having to create many equal connection factories only with different names. |
myJNDICFactory
|

The type of the ConnectionFactory (Queue or Topic) is automatically determined after you start the application associated to the factory.
4. Choose the Provider tab and complete the following fields. The user specified in the Security Credentials is used to connect to the JNDI provider where the JMS resources are bound. In case of SAP JMS Provider these settings are not needed because this is internal server lookup. JNDI properties are important only when an external JMS Provider is used, in case of SAP JMS Provider we recommend that you leave these fields empty.
Field |
Description |
Example |
JNDI Path |
Enter a string that denotes a reference to the ConnectionFactory object in the naming tree of the JMS provider. |
jmsfactory/default/TopicConnectionFactory |
The following properties are passed to the InitialContext that you obtain to look up the ConnectionFactory:
Field |
Description |
Example |
Initial Context Factory |
Enter the implementation of javax.naming.spi.InitialContextFactory that your client uses to obtain initial naming context. |
com.sap.engine.services.jndi.InitialContextFactoryImpl |
Provider URL |
Enter provider URL in <host>[:<port>] format. |
localhost |
Security Principal |
Enter the name of the entity (user) that is authenticated when the connection to the JMS provider is established. The Security Principal and the Security Credentials are included in the naming context when the connection factory is looked up from the naming. |
Administrator |
Security Credentials |
Enter the credentials (typically a password) that authenticate the security principal to the JMS provider. |
|

You can add more properties using the Additional tab. Enter the name and the value of the additional parameter(s) in the Property and Value fields respectively, and choose Add.

If you want
to create a JMS ConnectionFactory similar to an existing one, choose
on the toolbar to copy the properties of the
existing ConnectionFactory. Then choose
and
to paste the properties. Modify the parameters
and save the ConnectionFactory object with a new name or in another
application.
5.
To save the
changes, choose
on the toolbar.
Use the deploy_jms_resource command from the JMSCONNECTOR command group. For more information, see JMSCONNECTOR.

The J2EE Engine
supports registration of a JMS ConnectionFactory when deploying a J2EE
application. You have to include a relevant XML definition of the JMS object
in the application archive file (EAR). For more information about the format
of the XML file, see
jms-factories.dtd.
See also:
Registering a JMS ConnectionFactory using Non-JNDI Provider
Editing JMS ConnectionFactory and Destination