Pages

Tuesday, November 17, 2009

Soa Suite 11g MDS deploy and removal ANT scripts

With the release of Soa Suite 11g R1 Patch Set 1 Oracle improved the standard ant scripts for MDS deployment and removal. Before PS1 we had an ant example of Clemens.
Basically this is how my ANT scripts works. First add your own metadata folders under the apps folder ( do this in jdeveloper\integration\seed\apps ).

My ANT script will do the following steps for every metadata folder under apps
  • optionally remove the metadata folder from the remote Soa Suite Database MDS repository
  • Make a zip file of the metadata files ( Local MDS file repository) .
  • Make a new Soa Bundle zip with this metadata zip
  • Deploy this soa bundle to the Soa Suite Server, The server will add this to the Database MDS
When you want to use the MDS files in your own project read this blog


To make this work copy the antcontrib jar to the jdeveloper\ant\lib folder ( because of the foreach and the propertycopy fucntion )
Here is my build.properties

The build.xml

and at last the deployMDS.bat file
set ORACLE_HOME=C:\oracle\MiddlewareJdev11gR1PS2
set ANT_HOME=%ORACLE_HOME%\jdeveloper\ant
set PATH=%ANT_HOME%\bin;%PATH%
set JAVA_HOME=%ORACLE_HOME%\jdk160_18

set CURRENT_FOLDER=%CD%

ant -f build.xml deployMDS
See my github for the source code https://github.com/biemond/soa_tools

101 comments:

  1. Hi Edwin!
    What or where is this antcontrib jar located?


    pino

    ReplyDelete
  2. Hi ,

    here you can downnload the jar for ant
    http://ant-contrib.sourceforge.net/

    thanks Edwin

    ReplyDelete
  3. Hi Edwin,
    After deployment how can we verify those components.
    Is it possible by opening in IE

    ReplyDelete
  4. Hi ,

    you can make a new MDS database connection and connect to your Soa or ADF MDS database schema.

    or use sqlplus, the database design is not so dificult.

    thanks

    ReplyDelete
  5. Edwin,

    I am improving my buidl tool :-) How is your target

    antcall target="removeSharedData" inheritall="false"

    and

    antcall target="deploy" inheritall="false"

    Look like?

    Marc

    ReplyDelete
  6. Hi Marc,

    these are part of the default ant scripts of Oracle, located in the jdev bin folder after install of the soa add-on

    ant-sca-deploy.xml


    thanks

    ReplyDelete
  7. Edwin,

    I am not able to remove folders. All files inside the folder (ex:C:\oracle\Middleware\jdeveloper\integration\seed\apps\myapp) is removed but the folder (myapp) itself remains. Is that expected?

    Ari.

    ReplyDelete
  8. Yep,

    you are right, the folders remains but you can delete the records in the mds_paths table of your mds schema.

    thanks

    ReplyDelete
  9. Hi Edwin!

    I'm using ant file to deploy a XSD to the MDS Server. It is been deployed correctly.

    After that, I'm trying to use this shared XSD in a project. I had imported the schema using SOA-MDS connection and the schemalocation of my wsdl is iguals to "oramds:/apps/xsd/Common.xsd". The import is OK because I can use elements for this schema to define new variables.

    The problem is when I try to make deploy. If I use deploy inside jDeveloper, the jar file is created without errors, but if I use ant script to build and deploy, the following error occurs:

    scac:
    [scac] Validating composite : 'C:\@Andrade\@Trabalho\Development\NovosTestesVSTS\NovoTesteCommon/composite.xml'
    [scac] oracle.fabric.common.wsdl.XSDException: Error loading schema from file:/C:/@Andrade/@Trabalho/Development/NovosTestesVSTS/NovoTesteCommon/NovoTesteCommonBPELProcess.wsdl [Cause=Error in getting XML input stream: oramds:/apps/xsd/Common.xsd: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/xsd/Common.xsd does not exist.]
    [scac] at oracle.fabric.common.wsdl.SchemaBuilder.loadEmbeddedSchemas(SchemaBuilder.java:496)
    [scac] at oracle.fabric.common.wsdl.SchemaBuilder.loadSchemasFromWSDL(SchemaBuilder.java:365)

    Do you have any suggestion about what is generating this error?

    I already tryed to put the shared XSD in local and server MDS and made the changes in adf-config.xml, but I can't build my project via ant script.

    Thanks in advance for your attention.
    Rafael

    ReplyDelete
  10. Hi,

    Strange , I think it is a configuration problem in the build.xml or adfc-config.xml.

    Or the local MDS in the integration folder is not right

    thanks

    ReplyDelete
  11. Excellent article Edwin. Thanks for the help on this. I was able to get everything working. The only thing that I can't figure out is the way to move the assets that I built like xsd or wsdl from their applications to the local MDS. Do I need to use File Explorer to copy and past these assets to the local MDS folder or can it be done from JDeveloper?

    ReplyDelete
  12. Hi,

    yeah you need to copy this with explorer to the local MDS folder

    or you can make a dummy project in jdeveloper where you use the same mds structure only seed/apps
    so you can check this in svn.

    you only need to change the mds ant script for the new path and all the adf-config.xml of your soa applications

    thanks

    ReplyDelete
  13. Edwin,

    I have deployed some shared projects under MDS and now I want to delete them but cudn't find a way.

    In my IDEConn ->SOA_MDS -> Shared_Res -> apps i have 3 diff project, now I want to deploy some of them but not able to do it.

    Can you let me know how can I undeploy my mds applications?

    I appreciate all the help.

    -Dasmeet

    ReplyDelete
  14. Hi,

    did you try this

    ant -f build.xml undeployMDS -Dbasedir=%ORACLE_HOME%\jdeveloper\bin

    thanks Edwin

    ReplyDelete
  15. Edwin,

    I am using DB base repository and not file base.

    Secondly, I have deployed my shared project from jDev by first creating jar deployment (archive) in project properties and then SOA bundle in Aplication Propoerties and then deployed this SOA Bundle to App Server.

    I don't hv build.xml and file repository so i don't know is this command will work.
    ant -f build.xml undeployMDS -Dbasedir=%ORACLE_HOME%\jdeveloper\bin

    Please let me know how we can do with DB base repository?

    Thanks
    Dasmeet

    ReplyDelete
  16. hi,

    just copy the 3 files to a local folder and change the properties so it matches your app folders.

    and run the bat script.

    thanks

    ReplyDelete
  17. Is there a way I can download these files?

    Thanks,
    Sai

    ReplyDelete
  18. Ok,

    here we go http://www.sbsframes.nl/jdeveloper/ant_mds.zip

    thanks

    ReplyDelete
  19. HI Edwin,
    Is there any Ant task using which I can use to download the existing artifacts from MDS. This will be useful in scenarios multiple developers modify the files @MDS

    ReplyDelete
  20. Hi,

    this should do the trick

    ant -f ant-sca-deploy.xml exportSharedData -DserverURL=server.url -DjarFile=jar.file -Dpattern=pattern -Duser=user

    Note:
    After specifying the user name, enter the password when prompted.
    Argument Definition
    serverURL The URL of the server that hosts the SOA Infrastructure application (for example, http://stabc:8001).
    jarFile The absolute path of the JAR file to be generated.
    pattern The file pattern supported by MDS transfer APIs. Use the semicolon delimiter (;) if multiple patterns are specified. Exclude the shared data namespace /apps in the pattern. For example:

    /Project1/**;/Project2/**

    This example exports all documents under /apps/Project1 and /apps/Project2.
    user Optional. The user name for accessing the server when basic configuration is configured.
    password The password for accessing the server when basic configuration is configured. This parameter is optional.

    Example 41-22 shows how to export shared data of a given pattern into a JAR file.

    Example 41-22 Exporting Shared Data of a Given Pattern into a JAR File

    ant -f ant-sca-deploy.xml exportSharedData -DserverURL=http://stabc:8001 -DjarFile=/tmp/MySharedData.jar -Dpattern="/Project1/**"

    ReplyDelete
  21. very informative post. Thanks sharing with this blog.

    ReplyDelete
  22. Thanks for the help Edwin. I had seen this task ,but was not sure which way it will export(to /from MDS).I tried out the way u told and its working. Gr8 going.

    ReplyDelete
  23. Hi Edwin,

    I am looking for an API that I can use to retrieve the default composite version from the SOA 11g application. I was wondering if you have any idea of such an API.

    Thanks

    Ren

    ReplyDelete
  24. Hi Ren,

    you can read the attributes of Soa Suite composites mbeans, like i did in this blog http://biemond.blogspot.com/2010/02/invoking-fmw-application-mbeans-in.html

    thanks

    ReplyDelete
  25. This comment has been removed by the author.

    ReplyDelete
  26. Hi Edwin, Thanks!
    The script works very well, except my composite application uses shared schema objects in MDS, thus, there is reference as oramds:/apps/itas/FAInterface.wsdl

    And when running the ANT to deploy the composite application, it was giving error as

    Caused by: java.io.IOException: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/itas/FAInterface.wsdl does not exist.

    while the same project can be deployed in Jdeveloper without errors.

    1. I checked .adf/META_INF/adf-config.xml and it looks fine
    2. I can browse the file from SOA_MDS connection to the server.
    3. ant-sca-compile has include oramds.jar in the classpath.

    What else can be wrong? Appreciate your help!

    Grace

    ReplyDelete
  27. Hi Edwin, Thanks!
    The script works very well, except my composite application uses shared schema objects in MDS, thus, there is reference as oramds:/apps/itas/FAInterface.wsdl

    And when running the ANT to deploy the composite application, it was giving error as

    Caused by: java.io.IOException: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/itas/FAInterface.wsdl does not exist.

    while the same project can be deployed in Jdeveloper without errors.

    1. I checked .adf/META_INF/adf-config.xml and it looks fine
    2. I can browse the file from SOA_MDS connection to the server.
    3. ant-sca-compile has include oramds.jar in the classpath.

    What else can be wrong? Appreciate your help!

    Grace

    ReplyDelete
  28. Hi Edwin, Thanks!
    The script works very well, except my composite application uses shared schema objects in MDS, thus, there is reference as oramds:/apps/itas/FAInterface.wsdl

    And when running the ANT to deploy the composite application, it was giving error as

    Caused by: java.io.IOException: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/itas/FAInterface.wsdl does not exist.

    while the same project can be deployed in Jdeveloper without errors.

    1. I checked .adf/META_INF/adf-config.xml and it looks fine
    2. I can browse the file from SOA_MDS connection to the server.
    3. ant-sca-compile has include oramds.jar in the classpath.

    What else can be wrong? Appreciate your help!

    Grace

    ReplyDelete
  29. Hi,

    your project has an adfc-config.xml with a mds entry to your local MDS so you also need to have this app itas in the jdeveloper\integration\seed\apps folder of your local machine.

    thanks

    ReplyDelete
  30. Hi Edwin,
    I've got XSDs, WSDLs in my MDS artifact. I want to replace the endpoints in the wsdl based on the deploying environment. I tried using configuration plan to do that but no luck.
    Is there anyother way to replace the endpoints as u deploy in different environment.

    Thanks
    Srini

    ReplyDelete
  31. Hi

    please help what is usarmy MDS used for

    on the example u used woningnet-Test.

    I can't deploy it complains about the MDS

    Regards
    Emmanuel

    ReplyDelete
  32. Hi Srini

    I dont think you should put in wsdl with endpoint in the MDS. In MDS you can't use configuration plans.

    you still can use wsdl for services and components.

    thanks

    ReplyDelete
  33. Hi Emmanuel

    it is just an example just create your own app folder and change the build.properties and you are ready to go.

    thanks

    ReplyDelete
  34. Thanks Edwin,
    What do you mean by WSDL for services and components ?

    Cheers
    Srini

    ReplyDelete
  35. hi,

    the wsdl of the reference webservice contains endpoints to ws outside the soa server or to other composite. Then it is handy to change them in a configuration plan. In MDS this is not possible

    thanks

    ReplyDelete
  36. Hi,

    I updated my ant scripts so it works with PS1 and PS2, you don't need to set the basedir anymore and it is faster now because it doesn't need to import the soa build xml's .

    http://www.sbsframes.nl/jdeveloper/ant_mds.zip

    thanks

    ReplyDelete
  37. Hi Edwin,

    In properties file you mentioned mds-application as "Woningnet-Test".
    Do we need to create application for this?

    Regards
    PavanKumar.M

    ReplyDelete
  38. Hi,

    you need to replace it with your own app and change this property file.

    thanks

    ReplyDelete
  39. Hi Ediwin,

    Is it possible to replace the artifacts i have deployed on the mds without any base folder.. there are a few dvms that have been accidentally deployed directly under apps folder... trying '.' for folderName did not work...

    arv

    ReplyDelete
  40. Hi,

    you can go to the MDS database and change the path in one the tables .
    off course make sure it is not used by a composite

    thanks Edwin

    ReplyDelete
  41. I have uploaded MDS artifacts (using JDev following the steps in 43.6 of the Developer guide) in a wrong directory structure in the database. Can I use these ant scripts to undeploy MDS artifacts from the database? If so, what do I need to give in the mds.repository in build.properties file?

    Thanks
    Shanthi

    ReplyDelete
  42. Hi,

    if this is a 1 time operation then you can use the mds mbean. Go to the system mbean browser ( EM )

    then application defined mbeans
    -> oracle.mds.lcm -> go the soa-infra mbean -> operations.

    then you can use /XXXX/** or /apps/XXXX/abc/**

    thanks

    ReplyDelete
  43. Hi Edwin,
    Great article. Is it possible to include associated document references in MDS artifacts? For example, can I have a WSDL that imports an XSD using an oramds url? So far I haven't had any luck in my tests either for oramds urls or relative paths. Do I need to plug in a special URIResolver somewhere?

    thanks,
    Alex

    ReplyDelete
  44. Hi,

    both situations works perfectly.

    you can use ./yourschema.xsd in the wsdl when the xml schema is in the same folder or

    use oramds:/apps/XXX/xsd/yourschema.xsd

    hope this helps

    ReplyDelete
  45. Hey Edwin

    Excellent utility that has been made public. Quite handy. Thanks for sharing it.

    Kudos
    Chandu

    ReplyDelete
  46. Hi Edwin,

    I have the same issue as one of the user commented in this thread earlier.

    I could deploy without any issues with JDeveloper having references using oramds with shared resources deployed in DB based MDS.

    I verified adf-config.xml also, which has MDS setup pointing to DB only

    Pl help

    More on this error
    --------------------------------

    My composite application uses shared schema objects in MDS, thus, there is reference as oramds:/apps/xx.wsdl

    And when running the ANT to deploy the composite application, it was giving error as

    Caused by: java.io.IOException: oracle.mds.exception.MDSException: MDS-00054: The file to be loaded oramds:/apps/XX.wsdl does not exist.

    while the same project can be deployed in Jdeveloper without errors.

    1. I checked .adf/META_INF/adf-config.xml and it looks fine

    2. I can browse the file from SOA_MDS DB connection to the server.

    Appreciate your help!

    Thanks,
    Satish

    ReplyDelete
  47. Hi,

    Can you check this oramds:/apps/xx.wsdl I would expect something like this oramds:/apps/XXX/xx.wsdl where XXX is a folder. dont think you got permission to write in apps.

    ReplyDelete
  48. Edwin, thanks for quick reply.
    Actually, I just gave a ref url.
    The actual looks like below

    oramds:/apps/XXX/services/XX.wsdl

    I am using DB based MDS.
    I am on 11g (11.1.1.3)
    I could deploy the same project from JDeveloper and also Test the composite successfully.

    Only issue happening when deploying through ANT..

    Am I missing something ?

    thanks,
    Satish

    ReplyDelete
  49. Hi,

    I use a local MDS as source and deploy this to the SOA MDS.

    and maybe the path of mds.reposistory is on the wrong level, How does your zip/ jar looks like.

    it should be like XXXX\services\xxx.wsdl

    thanks

    ReplyDelete
  50. I deployed shared resources in MDS through separate project and verified them for path and also browsed them by creating a connection to SOA-MDS.

    Strange thing for me is JDeveloper able to compile the project which has oramds references , but not standalone Ant scripts.

    Is there any way we can enable detailed debug of what JDev doing during deployment? I believe , it also uses same ANT home which I am using in standalone.

    This is the exception I see
    Dec 20, 2010 4:33:56 PM oracle.adf.share.config.ADFMDSConfig createMDSInstanceFromelement
    SEVERE: MDSConfigurationException encountered in parseADFConfigurationMDS-01335: namespace "/apps" mapped to metadata-store-usage "mstore-usage_1" but its definition was not found in MDS configuration.
    oracle.mds.config.MDSConfigurationException: MDS-01335: namespace "/apps" mapped to metadata-store-usage "mstore-usage_1" but its definition was not found in MDS configuration.

    ReplyDelete
  51. Hi,

    Ok your mstore-usage_1 defintion in adf-config.xml is wrong.

    metadata-path property should be correct for example MiddlewareJdev11gR1PS2\jdeveloper\integration

    and the partition-name property contains the folder under this metadata-path folder and should exists for example seed

    ReplyDelete
  52. You need to have at least 1 project / workspace where you go from file to database mds. Else you cant work with mds. So change the adf-config for this project

    ReplyDelete
  53. Edwin,

    I got it resolved. Thank you so much for your prompt help

    The issue is with Application Home setting in my build.properties file because of which it is unable to load adf-config.xml . Now the deployment works fine even without having local MDS setup and just based on server DB based MDS.

    Although I have one other question. For some reason, I am unable to create MAR deployment profile for shared resources for direct deployment to server MDS.

    Right now , I am able to deploy only through SOA bundle. Is there any alternative ??

    Thanks again
    Satish

    ReplyDelete
  54. Hi,

    if you follow my ANT scripts then you see the mar is just a zipped file, without META-INF folder. you can deploy this zip in the enterprise manager application.

    thanks

    ReplyDelete
  55. Hi Ediwin,
    Thanks for your blog. We implemented the MDS concept based on your blog. However we got a problem with it. When a schema is changed we are making the soa bundle and deploying again to the server. We can able to see the updated schema in the server using JDev MDS connection. But our application is still picking up the old version of the schema. Is this a problem with caching? I invoked clearCache method on runtime mds mbean. But no use. Can you please help us in this situation?

    ReplyDelete
  56. Ok,

    that is strange and is the xsd after a reboot of the soa server Ok.

    if so then it is a caching problem.

    thanks

    ReplyDelete
  57. Edwin,
    Thank you for the response. We are getting the problem with XSLs. We are using doTransformForDoc( 'oramds:/apps/sample.xsl', ...). If sample.xsl is changed and updated to the MDS, BPEL process is not picking up the latest XSL in MDS. It is picking up the older one until BPEL Process is redeployed again.

    ReplyDelete
  58. Hi Edwin

    Any thoughts on this caching issue please we are encountering the same problem i.e. we have some xsls defined in MDS - and we call these dynamically by name from an SCA/BPEL process. So at design time the transform is not named in the source. At runtime if we run a transform, then change the xsl and re-run the transform we get the BPEL process ends up using the cached transform.

    ReplyDelete
  59. It looks like a bug has been filed for this.

    Bug 10104439: CHANGES TO MDS ARTIFACTS ARE NOT PICKED UP BY COMPOSITE PROCESSES THAT REFERENCE

    ReplyDelete
  60. I am on 11.1.1.3 and using DB based MDS.

    I could deploy the project from JDeveloper successfully but having issues deploying through ant.

    It seems like a few others had the same issue but got it resolved. Can you please help me with this?

    In my applications.home directory, I have created .adf/META-INF and copied the same adf-config.xml that I used in JDeveloper. I get the following error:
    [scac] FATAL_ERROR: location {/ns:composite/ns:import[@location='http://soasuite-dev.saic.com/soa-infra/services/default/AIAAsyncErrorHandlingBPELProcess/client?WSDL']}(19,30): Load of wsdl "http://soasuite-dev.saic.com/soa-infra/services/default/AIAAsyncErrorHandlingBPELProcess/client?WSDL with Message part element undefined in wsdl [http://soasuite-dev.saic.com/soa-infra/services/default/AIAAsyncErrorHandlingBPELProcess/client?WSDL] part name = FaultMessage type = {http://xmlns.oracle.com/EnterpriseObjects/Core/Common/V2}Fault" failed

    ReplyDelete
  61. Hi edwin,
    I started working on soa suite 11.1.1.3 a few weeks ago and I was looking on the internet for a way to share artifacts between composite applications and i found your blog in which you talk about MDS.
    To be honest I haven’t tried your solution yet because I just finished reading your articles, but I have a few questions for you:
    1) How can I subversion artifacts? Shoud I add to my SVN repository the files of the local MDS in which I have the shared artifacts or is there another way to do it?
    2) Lets’s imagine that in production environment I have 3 composite applications APP1, APP2 and APP3 which use the same XSD (xsdShared.xsd). to handle data during the process. They are asynchronous applications and let’s suppose that I have a few instances of these applications dehydrated waiting for a callback to dehydrate the process. One day I have to release a new version of APP1 in production. This new version sould use a new version of xsdShared.xsd. To deploy APP1 I have to load the new XSD in the MDS. What does it happen to the pending instances of APP2 and APP3 which are using a previous version of the shared XSD?
    Thanks
    Matteo

    ReplyDelete
  62. Hi,

    off course you need to add your changes to the MDS in subversion. I had a folder where I put in my own MDS app folder and add an extra MDS entry in my adf-config.xml so the jdev build scripts can find the mds artifacts.

    Second, always deploy the application with a higher version so new requests will use the new version and the old asyn requests still can use the previous version. and the XSD need to have a different name , put a version in the name and put this next to the other.

    when all request are finished you can retire the old version.

    thanks Edwin

    ReplyDelete
  63. Hey Edwin,

    Thanks for the post, We have projects which are inter-dependent like Consumer_proj refers services from Provider_Proj.

    And we Build our soa projects from the source control, which should be independent of server.

    Currently we use relative urls for service wsdls in Consumer_proj like : file:/Provider_Proj/service.wsdl
    - So we are able to build it anywhere irrespective of server is up or not.
    - we use config plans to replace these relative urls to actual server urls during deployment.


    Could you suggest how can we use MDS in this case.
    - Do we need to Source control the local MDS along with soa projects to build it ?
    - We need to manually put our wsdls/xsd in the local MDS from the Provider_Proj ?
    - In that case we will maintain two local MDS one locally on our dev machines and other in source control.
    - Do we need to deploy this to server MDS if we use config plan to replace oramds: urls to actual urls.

    - What benefit we will get , employing the MDS approach over our old approach

    Any suggestions are greatly appreciated.

    Thanks !!

    ReplyDelete
  64. Hi,

    the boys of the AIA Team made this excellent blog , hope this will help you http://blogs.oracle.com/aia/2010/11/aia_11g_best_practices_for_dec.html

    thanks

    ReplyDelete
  65. Hi Edwin,

    Thanks to you for such a great article. It helped me a lot.

    But I have one question.
    I have to transfer my artifacts(Xsds and WSDLs) from Jdeveloper to Local MDS.

    Manual copying is one option which is there.But I am looking for some way, where I can automate from each project in jdeveloper, artifacts are directly copied to local MDS.

    Can you please suggest some steps or ANT scripts for this.

    ReplyDelete
  66. Hi,

    you dont need to have 2 local MDS. you can update the adf-config.xml so it uses the local MDS and so you can put the file MDS in your project folder ( subversion ).

    If you dont want this you can make a simple ANT script which copies this for you.

    thanks Edwin

    ReplyDelete
  67. Hi Edwin,

    Thanks for reply. I have one more question.

    Right now, my local repository is at
    C:/Oracle/Jdeveloper/integration/seed/apps

    Under apps, I have folder ECH. So it is as
    apps/ECH/InputServices/CompositeA/
    apps/ECH/InputServices/CompositeB/
    apps/ECH/InputServices/CompositeC/

    CompositeA, CompositeB and CompositeC are under ECH/InputServices/ folder.

    Now to deploy all of them, I just give mds.applications= ECH in build.properties file.
    That deploys the full ECH folder to SOA_mds.
    All is well till this point.

    Twist comes when let us say next I need to deploy only CompositeB under ECH/InputServices folder.

    For that, I give mds.applications=ECH/InputServices/CompositeB in build.properties file

    But when I run deployMDS script.It gives error as Zip file is not created at the location.

    So can you please suggest how can I achieve this?

    Thanks,
    Parshant

    ReplyDelete
  68. Hi,

    you can change the include options of the copy step ( add an extra filter condition ) of the "create zip from file MDS store" task.

    ReplyDelete
  69. Hi Edwin,

    Using this scipt, what we upload, goes to apps folder on Server MDS.
    I have a requirement to update soa folder on server MDS. Can I do that with this script? Please suggest..

    Thanks,
    Parshant

    ReplyDelete
  70. Hi,

    no the soa mds folder is projected but you use the mbeans to modify the soa mds files.

    thanks

    ReplyDelete
  71. Great script!
    Got it working pretty fast

    ReplyDelete
  72. Hi Edwin,
    I am using a DB based MDS. Is there a way to remove file/files (myData.dvm) from the MDS instead of the folder (myMDSFolder)?
    For example: apps/myMDSFolder/myData.dvm

    ReplyDelete
  73. Hi,

    I think it is not possible with the ANT scripts but I did it once with the SOA MDS mbean ( open system mbean browser from the EM ), this allows you to do this.

    good luck.

    thanks edwin

    ReplyDelete
  74. HI Edwin awesome post

    i went exactly the way you explained.
    i got success in adding artifacts in mds..

    but i how can i delete the articats...

    ReplyDelete
    Replies
    1. Hi,

      You can run the undeploy mds target instead of deploy mds , keep in mind it does not delete the folders only the content.

      Thanks

      Delete
  75. Hi Edwin,
    It's an wonderful article for developer to work with MDS shared resource.
    I would love to take your suggestion from you regrading our startegy of using common xsd/ref wsdl.
    Right now we have created a war project contains all common xsd file and reference wsdl. All composites refers to that web project deployed in same WL domain. e.g, http://host:port/XSDProject/mySharedXDS.xsd, http://host:port/XSDProject/myShareRefWSDL.wsdl
    Now my question is, is it a good idea to use xsd/wsdl reference over HTTP or we can go with mds strategy?
    Will there be any performance issue w.r.t SOA runtime-
    1.Multiple MDS DB hits?
    2. Managing additional connection pool for MDS Datasource?
    Please provide your valuable suggestion.

    Thanks,
    Biltu

    ReplyDelete
    Replies
    1. Hi.

      this can be scary. you must make sure that the war is loaded first before soa-infra. and noway to replace a wsdl of xsd without re-deploying the war again or use an exploded war. but still a lot of work.

      MDS is a database, so really fast, ( cache and has its own connection), you can lookup the wsdl or replace the artifacts from jdeveloper. No use of http to lookup.

      and with MDS you can a local one on which you develop without effecting others. when finished you sync mds to soa and deploy you composites.

      thanks

      Delete
  76. Thanks Edwin for your quick guidance.
    We will follow your approach.
    Thanks,
    Biltu

    ReplyDelete
  77. Hi Edwin,

    We have created a separate MDS repository for an application (different then mds-soa and mds-owsm).How to upload the artifacts to this repository as ant script seems uploading to default (mds-soa) repository.Is there any way to change repository settings in ant script?

    Thanks,
    James

    ReplyDelete
    Replies
    1. Hi ,

      Indeed this is only for SOA Suite but you can use wlst ( \oracle_common\common\bin )
      http://docs.oracle.com/cd/E28271_01/web.1111/e13813/custom_mds.htm#CHDHDCAI

      importMetadata(application, server, fromLocation [, docs]
      [, restrictCustTo] [, excludeAllCust] [, excludeBaseDocs]
      [, excludeExtendedMetadata] [, excludeUnmodifiedDocs]
      [, cancelOnException] [, applicationVersion] [, remote] [, tenantName])

      Good luck.

      Delete
  78. Hi Adwin,

    Thanks for the build scripts. I tried the same but endup with this error.

    [deployComposite] INFO: Creating HTTP connection to host:www.xyz.com, port:80
    [deployComposite] ---->response code=2000, error:The server is not compatible wi
    th this deployment client: please verify that the server is a SOA managed server
    and that its version is supported by this deployment client
    deployProcess:

    Any idea\suggestions would be greatly helpful.

    Thanks,
    Sudheer

    ReplyDelete
    Replies
    1. Hi,

      your jdeveloper version is higher then the soa suite version, they should match of jdeveloper should be lower.

      thanks

      Delete
  79. Hi,

    How can I create /apps folder under mds-schema?

    ReplyDelete
    Replies
    1. Hi,

      the apps folder is already there and you can't create in the soa mds-db

      thanks

      Delete
  80. Hi All,

    I am new in soa11g. please suggest me how to deploy the composite into dev environment.

    ReplyDelete
  81. Hi Edwin,

    I have a problem with my workspace. When I try to connect MDS in my app, something wrong happens:

    Error: falha no parse do código XML pois "javax.wsdl.WSDLException: WSDLException: faultCode=INVALID_WSDL: Error reading import of file:/C:/Projetos/Nextel/3G/SOA/Send%20Protocol/SOA/SendProtocol/ProcessProtocolManagerIVRComnsReqABCSImpl/execute_pttRef.wsdl: oracle.j2ee.ws.wsdl.LocalizedWSDLException: WSDLException: faultCode=PARSER_ERROR: Falha ao ler o arquivo wsdl em: "oramds:/apps/AIAMetaData/AIAComponents/EnterpriseBusinessServiceLibrary/Industry/Communications/Custom/SendProtocol/SendProtocolEBS.wsdl", causada por: java.io.IOException. : java.io.IOException: oracle.mds.exception.MDSException: MDS-00054: O arquivo a ser carregado oramds:/apps/AIAMetaData/AIAComponents/EnterpriseBusinessServiceLibrary/Industry/Communications/Custom/SendProtocol/SendProtocolEBS.wsdl não existe.:

    --adf-config.xml































    ---

    What's going on?

    Thanks!

    ReplyDelete
    Replies
    1. Sorry, i made a mistake...

      I forgot the aia.jar in Jdev classpath.

      Delete
  82. HI

    I am trying to deploy the ant script i am getting the below error.

    error:build.xml220 project.reviosion is not found unable to find project.revision

    please help me in that

    ReplyDelete
    Replies
    1. Hi,

      Did you add a property file to your workspace
      like this https://github.com/biemond/soa_tools/blob/master/ant/workspaces/wrkspc1/build.properties

      else then it is a configuration error , a project name or a folder is wrong

      Thanks

      Delete
  83. Dear Edwin,

    I am using above ant script to deploy components to MDS.Its working fine for.

    My requirement is , if i changed one of the file now i am deploying entire work space.

    is there any way i can deploy only changed file to MDS?

    Thanks,
    Samba

    ReplyDelete
    Replies
    1. Hi,

      you can add 1 entry to mds.applications parameter and only deploy that specific app folder

      and inside the app folder you can add your own include or excude filter in the fileset of the zip action

      zip destfile="${mds.deploy.dir}/${mds.application}_mds.jar" compress="false"
      fileset dir="${mds.reposistory}" includes="${mds.application}/**"/

      Thanks

      Delete
  84. Hi Edwin,

    I'am trying to add artifacts (xsd,wsdl,dvm,fault-policies)from the j-developer-common-seed-apps location to mds, by using above given build.properties and build.xml and MDS.sh
    In build.properties, I have given all my server details everything & in MDS.sh. And I also created a folder name as lib and i placed the file ant contrib.jar. when i double click on MDS.sh batch file it was giving errors.
    Kindly help me out in this, how to add artifacts to mds and remov,what steps i need to take.

    Thanks & Regards,
    G.Satish

    ReplyDelete
    Replies
    1. Hi,

      Can you show me the terminal output of MDS.sh

      Thanks Edwin

      Delete
  85. HI Edwin,

    Changes in the MDS is not getting in the deployed composites,

    Let me explain briefly : i had changed one of the xsd field and deployed in the server,
    I can able to see those changes in the mds jar file (while exporting jar file),
    But these changes are not picking by the already running composites. i tried below ways to solve this problem, ie..,
    1. Restarted the both Admin and SOA server,
    2. Redeployed the composties.
    but still the issue is not resolved can you suggest me any solution.

    Regards,
    vnraju

    ReplyDelete
    Replies
    1. Hi,

      Strange, this should work. You use this xsd in a wsdl on the exposed service interface plus using oramds protocol. then in SOAPui or in EM you should see the new XSD

      Because probably in BPEL etc you need to change the XSLT or the Assigns to fill this changed xsd.

      Thanks

      Delete
  86. Hi Edwin
    Excellent blog for deploying the artifacts from the local MDS.
    Is it possible when the artifacts are in SVN and not in MDS.

    Question :

    We are using SVN to store the code and using build tool to deploy the code to different environments. We are not using local MDS to store DVMs but in fact are using an External Directory(created on the SVN server ) and added as a reference in all Projects to use the shared DVM.
    The issue is we have a DVM that contains the endpoint URLs of different services which are called depending on the timezone of the server the request came in. We then use the same dvm to reply back to the original calling server.
    Now we want to create a Prod copy environment but since it is copy, we want to use a different DVM during deployment based on the build.xml that can search for any DVMs specific for the environment ( if found should over ride the other) if not( then continue using the same existing one).
    Is it possible to achieve this considering we are not using local MDS and the ant commands are specific to MDS.
    Please help we are not able to figure out a way as we are also not sure whether we are following the correct approach.
    Thanks in advance

    ReplyDelete
    Replies
    1. Hi,

      You can use hudson which does a svn checkout and deploy this to your SOA DB Mds.
      or make a production branch which contains the right dvm and do a checkout of this folder.

      and with ANT (SvnAnt) you can add an extra task , checkout to a local temp folder and publish from there

      thanks

      Delete
    2. Hi,

      We are also using a similar kind of structure to use shared SOA xsds and wsdls (without usinf MDS). We have maintained a folder structure for these on our SVN and on the SOA DOMAIN at %MW_HOME%/domains/SOA_DOMAIN. But we some times face deployment issues randomly for random composites on adding a new artifact to the server location. The error is some thing like oramds:/sharedArtifacts/xsd/xxxx.xsd does not exist. It is clear that the newly added file is not getting recognised during deployment. But we are not facing this problem always with the same composite. So we are unable to find a proper solution other than the server restart. Could someone please help with some ways to solve this problem. I have tried clearing mds cache too but it did not help.

      Thanks

      Delete
  87. Dear Edwin,

    Could you help with the below question,

    1. Created a MDS file store as /scenario parallel to /apps

    so it looks like in adf-config.xml as below

    For apps:




    For scenario:




    2. Successfully created jar file for scenario folder structure to deploy into SOA server
    3. Deployed jar file into SOA server successfully
    4. Exported the soa-infra_metadata.zip - I can see the below folder structure,
    apps
    deployed-composites
    META-INF
    scenario
    soa

    5. When deploy a BPEL process composite(named - sca_BPEL1_rev1.0) in soa-infra using the OEM console with /apps referred deployed successfully.

    6. However when deploy the same BPEL process composite(named - sca_BPEL1_rev1.0) in soa-infra using the OEM console with /scenario referred, getting the below error message -

    Error Message:
    Deploying on partition "default" of "/Farm_soa_domain/soa_domain/SOA_Cluster" ...
    Deploying on "/Farm_soa_domain/soa_domain/SOA_Cluster" failed!
    There was an error deploying the composite on WLS_SOA1: Deployment Failed: Unable to find a WSDL that has a definition for service {http://xmlns.oracle.com/BPEL1}BPEL1 and port BPEL1. Please make sure that the port attribute for the binding defined in the composite file is correct by checking the namespace service name and port name. In addition check that the WSDL associated with the binding namespace is imported and currently reachable (check the import nodes at the top of the composite file). Finally validate the HTTP proxy settings for the server..

    Thanks,
    Venkat

    ReplyDelete
    Replies
    1. Hi,

      maybe you got some hard references in the composite or service components xml's. Everywhere you should use oramds:

      Thanks

      Delete