How to set JNDI of LAC built on WebLogic

book

Article ID: 127161

calendar_today

Updated On:

Products

CA Live API Creator

Issue/Introduction



Wants to use JNDI in LAC for weblogc. 
Example in tomcat is documented in the document


However, example in weblogic is not documented in the document. 
How to set up JNDI with LAC on Weblogic?

Environment

CA Live API Creator - 5.1 

Resolution



On WebLogic, the war file needs to be altered to connect with the JNDI data source. 

1 - Make a copy of the LAC war file (let's call it LAC.war)
2 - Extract the web.xml file: 
         jar xvf LAC.war WEB-INF/web.xml
3 - Edit the WEB-INF/web.xml file to include the following section AFTER the </welcome-file-list> line (adjust the res-ref-name to correspond to the JNDI name defined in WebLogic):

<resource-ref>
  <description>Example JNDI</description>
  <res-ref-name>jdbc/MyDB</res-ref-name>
  <res-type>javax.sql.DataSource</res-type>
  <res-auth>Container</res-auth>
 </resource-ref>

4 - Put the web.xml file back into the war file:
      jar uvf LAC.war WEB-INF/web.xml

The updated war file can now be deployed into WebLogic. If you need to access additional JNDI data sources, you can just add additional resource-ref sections to the web.xml file.

Also, current, the step is written in the document