Tuesday, December 22, 2009

How to do Manual Deployment for ADF 11g Application EAR with Auto Generated JDBC Descriptors

Sometimes it can happen you will face a requirement to deploy previously generated EAR on another server. In my specific case we were deploying on WebLogic server directly from JDeveloper 11g, with enabled auto generation for JDBC descriptors - see my previous post. For some specific reasons, now we need to redeploy same EAR on another server, however we dont have access anymore to development environment. What we did, we took previously deployed EAR from ORACLE_HOME/user_projects/domains/domain_name/servers/AdminServer/upload folder and tried to deploy it manually. Of course we got error, because EAR was generated with JDBC descriptor auto generation enabled. We got error, same as described in my blog post mentioned above - No credential mapper entry found for password indirection user=hr data source HrDS:



This error is logical, what we need to do is to modify deployment plan and to remove JDBC descriptor declaration. When you deploy, you can do this through Oracle Enterprise Manager 11g, it offers option to edit Deployment Plan just before actual deployment. Its possible to open Deployment Plan through Oracle Enterprise Manager 11g, and it allows to delete JDBC descriptor:



Bad news - its not removing it, even after pressing Apply. Delete action is not working and deployment Plan remains the same. Since it remains the same, deployment fails the same error mentioned above.

In seems no choice and we need to apply good old manual approach. Extract EAR archive you want to deploy, and go to META-INF folder. Remove (back-up) JDBC configuration file (HrDS-jdbc.xml in my case) and open weblogic-application.xml file for editing:



From weblogic-application.xml file remove entry related to JDBC descriptor:



Now pack your EAR back, you can simply Zip it and rename file extension to ear. With modified descriptors, Deployment Plan will updated automatically and deployment should be successful:



Just make sure you have JDBC Data Source defined on WLS. Application will use Data Source that should be present on WebLogic server, it will not be autogenerated. Also you should check if your deployment target is listed in JDBC Data Source targets as well:



Running application:


4 comments:

Andreas Koop said...

Hi Andrejus,

thanks for sharing this useful information. But it might be quite cumbersome if you have to deploy on a daily basis;-)

I took the opertunity to blog myself about that topic with focus on automation, http://multikoop.blogspot.com/2009/12/adf-11-create-application-ear-for-test.html

Best regards,
Andreas.

Andrejus Baranovskis said...

Hi Andreas,

Thanks, great post and useful scripts.

Yeah, in this specific case it was urgent one time issue, so it was Okej to do it manually :-)

Regards,
Andrejus

Juan Camilo Ruiz said...

Hi Andrejus,

Happy New Year!!

You could also generate your EAR without the weblogic-jdbc.xml synchronization option and then create the data source on each server accordingly.

That would help to deploy easily on other servers.

Juan Camilo.

Andrejus Baranovskis said...

Hi Juan,

You are right, just in my case EAR was already generated and there was no way to regenerate it - we didnt had source code basically.

Thanks,
Andrejus