Special thanks for my colleague Michel Schildmeijer for inspiring me to make this flexible script and off course for the necessary WLST code.
Important to know.
- Run this script on the AdminServer, else it won't find the Resource Adapter Plans
- First you need to create a Plan for the 3 Resource Adapters (Db,Aq,Jms) and add a dummy entry, think how you name it and where you put it.
- When a plan is changed and you have a soa cluster or the soa weblogic instance is running on a different server then you need to copy the plan to all servers or put it on a shared storage.
If you don't like this then you can always create new Resource Adapters by following this blogpost.
Let's explain how it works
first you need to change some variables in this build.properties
default this scripts runs against the weblogic dev settings. You can change this to your own and configure the dev entries ( dev entries at the bottom of the build.properties )
wls.environment=dev
Where are the adapter rars located in your FMW domain, this can be in your SOA or OSB Home of the FMW domain.
connectorLocation=C:/oracle/MiddlewarePS3/Oracle_SOA1/soa/connectors/
Then add your own EIS entries, these ones in this var will be added to weblogic.
resourceAdapterEntries=hrDB,hrAQ,cf1JMS,cf2JMS
Think if you need to set the XA or Not XA datasource property or in Jms the connectionFactoryLocation.
# AQ entry
hrAQ.type=aq
hrAQ.eisName=eis/AQ/hr2
hrAQ.property=xADataSourceName
hrAQ.value=jdbc/hrDS
# DB entry
hrDB.type=db
hrDB.eisName=eis/DB/hr2
hrDB.property=dataSourceName
hrDB.value=jdbc/hrDS
# JMS entries
cf1JMS.type=jms
cf1JMS.eisName=eis/JMS/hr3
cf1JMS.property=ConnectionFactoryLocation
cf1JMS.value=jms/MyCF
After you can run the ANT script
ant -f build.xml createResourceAdapterEntries
Here you can download the code on github
Here is the whole build.properties file
The wlst part with the wlRedeployResourceAdapter and wlCreateResourceAdapter macrodefs
And at last the build.xml
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHi,
DeleteI don't think you got this soaps3 connection on your side
[wlst] Connecting to t3://soaps3:7001 with userid weblogic ...
thanks
This comment has been removed by the author.
Deletehi,
DeleteI think you are some ant libs jars or the ant contrib jar. put them in your ant lib or classpath.
thanks
Hi Biemond,
DeleteCould not load definitions from resource org/apach
e/tools/ant/antlib.xml. It could not be found.
where can find this lib iam unable to locate it...
It is located at the lib folder on github and loaded in the bat file.
Deletethanks
Hi Edwin,
DeleteIam able to execute the build successfully but the changes are not reflected on weblogic server, dont know where the problem is here pasting the log....
Hi,
Deleteyou must upgrade ANT and check your classpath and put contrib jar in the ant lib folder.
thanks
This comment has been removed by the author.
DeleteHi, Edwin,
ReplyDeleteThanks for share your code in GitHub, save me lots of time.
1. I did little change for my env. It's not problem in my Linux with using PlanPath, but don't know why it's not working in my Windows. just return Plan.xml without path.
planPath = get('/AppDeployments/'+appName+'/AbsolutePlanPath')
2. The destroy exist Variable/assignment function is not working in makeDeploymentPlanVariable, because you introduce idRandom on the name param. Either change this idRandom to FIXED string/number, or using find() to filter the exist Variable then destroy that. Otherwise always create new Avariable with the same eisName.
thanks
Thanks for your input.
DeleteI tested it on windows without any problem.
Thanks