Wednesday, February 13, 2008

How to setup BPEL JNDI connection on the application server

At the time of BPEL process / ESB service deployment into Production/QA environment, the developer should remove the following entries to make sure the service is not accidentally uses the local DB connection settings. For the first time deployment, developer should request the system administrator to create JNDI location configuration. Once configured server connection pool will be applicable even if the below mcf.* Properties exists in the xxx.WSDL file.

-------------------------START--------------------------------
<jca:address location="eis/DB/App1" UIConnectionName="App1" />
<!-- ManagedConnectionFactory="oracle.tip.adapter.db.DBManagedConnectionFactory"
mcf.DriverClassName="oracle.jdbc.OracleDriver"
mcf.PlatformClassName="oracle.toplink.internal.databaseaccess.Oracle9Platform"
mcf.ConnectionString="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1)(PORT=1523))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2)(PORT=1523))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = EENADU)
)
)"
mcf.UserName="app1"
mcf.Password="8234567129863157899ESDOWI3950MSXSOF" -->
-------------------------END------------------------------------------


If you want to wear the system administrator hat for a second, follow the below process to create the connection pool, data source and to configure the jndi location. This procedure is little different than the ESB.


1. Create the Connection Pool (eg. App1)

2. Create Data Source (eg. App1)

3. Goto /SERVER/j2ee/oc4j_soa/application-deployments/default/DbAdapter

4. Edit oc4j-ra.xml and add the folllowing
<connector-factory location="eis/DB/App1" connector-name="Database Adapter">
<config-property name="xADataSourceName" value="jdbc/App1"/>
<config-property name="dataSourceName" value=""/>
<config-property name="platformClassName" value="oracle.toplink.platform.database.Oracle9Platform"/>
<config-property name="usesNativeSequencing" value="true"/>
<config-property name="sequencePreallocationSize" value="50"/>
<config-property name="defaultNChar" value="false"/>
<config-property name="usesBatchWriting" value="true"/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>

5. Restart the Application Server (or only OC4J_SOA instance)
6. Test the Web service using the following URL
7. http://server.client.com:7777/event/DefaultSystem/Service1 (here Service1 is the project)
8. Now test the service to check the validity of the configuration.
9. If you have any issues, you should be able to find the issue in BPEL domain logs.

No comments: