Show TOC Start of Content Area

Procedure documentation Specifying JNDI Names for the Beans References  Locate the document in its SAP Library structure

Use

Use this procedure to specify the JNDI names of the resources that are referenced by the bean. These JNDI names are the names under which the referenced resources are registered in the JNDI namespace.

Note

Use this procedure if the resource reference name specified in ejb-jar.xml differs from the name with which the resource is registered in the JNDI.

You can also use this procedure to define your resource references as non-transactional.

Prerequisites

The references are declared in ejb-jar.xml. For more information, see:

·        Declaring resource references

Procedure

...

       1.      Open the ejb-j2ee-engine.xml.

       2.      From the right-hand pane, choose the Enterprise Beans tab.

       3.      Open the corresponding tree structure according to the type of your enterprise bean (session, entity, or message-driven).

       4.      From your bean tree sub-structure, select resource-ref or resource-env-ref to specify the JNDI name of the resource in the corresponding reference.

       5.      Choose Add

A dialog box, which contains the corresponding references declared in ejb-jar.xml, appears.

       6.      Choose the reference and select OK.

The reference appears in the enterprise bean tree structure.

       7.      In the right-hand pane, specify the JNDI name of the referenced resource.

                            a.      If you specify a reference to a resource, the value of this field must be:

                                                  i.       for resources of type javax.sql.DataSource either the value of the <data-source-name>, or the value of the <alias> tag you specified in the data-sources.xml descriptor. Or if you used the data-source-aliases.xml instead, the value of this tag must be the same as the value of the <alias> tag for the corresponding DataSource.

                                                ii.       for resources of type javax.jms.QueueConnectionFactory and javax.jms.TopicConnectionFactory either the value of the <factory-name>, or the value of the <alias> tag you specified in the jms-factories.xml descriptor.

                                               iii.       for resources of type javax.resource.cci.ConnectionFactory either the value of the <jndi-name> tag, or the value of the <alias> tag you specified in the connector-j2ee-engine.xml descriptor. Or if you have not used the connector-j2ee-engine.xml descriptor at all (since it is not mandatory), the value of this tag is equivalent to the name of the corresponding RAR file (not including the .rar file extension).

                            b.      If you specify a reference to an environment resource, the value of this field must be the same as the name of the resource environment entry that you specified in the <destination-name> element of the jms-destinations.xml descriptor.

       8.      Optionally, you can define the resource reference as non-transactional by choosing the Non transactional option. For more information, see Connection Handling in Distributed and Local Transactions.

 

 

End of Content Area