Migrating Objects in the MDS

There are some great blogs out there that address MDS management via ANT. As good as they were I didn’t find the exact answer I was after which was migrating common objects such as Domain Value Maps, XSD, WSDL, etc, development lifecycle. Thanks to Edwin and Clemens who provided the base for this post.

To maximise reuse in a SOA Suite deployments developers can utilise the MDS. Instead of storing the objects within the SOA Composite itself. The objects can be stored in the common area in the MDS for all developers to use.

In this post I use a Domain Value Map and migrate it from the developers local machine through to production using a generic ANT script. The same concept can be applied to other common objects such as XSD and WSDLs.

  1. By default JDeveloper uses a file based MDS repository. This can be used to develop SOA composites even without connectivity the the server. To modify the file based MSD you use OS commands. It is recommended practice to place custom objects in the apps folder. This needs to be created.

    In widows explorer change directory to the JDeveloper home and create an apps directory in the integration/seed directory.


  2. In JDeveloper you can make a connection to the file MDS and you will be able to see the new directory


  3. In this example I create a generic project that I use to crate my Domain Value Map.


  4. Once the DVM has been created you need to move it to the MDS so SOA Composites can find it at design time. This is done using OS commands. To make my DVM easier to find I also create a DVM folder in the apps directory we created in step 1.



    Once copied you will be able to view it in JDeveloper.


  5. Now the developer can use this DVM as a shared object. The issue now is if you tray and deploy a SOA project to the server which uses this DVM it will fail. The DVM does not exist on the server, so before you deploy the project you need to deploy the DVM to the server. I have created an ANT script to help you migrate these objects. You can download them here.

    build.properties
    build.xml
    ant-contrib-1.0b3-bin.zip

  6. Unzip the ant-contrib-1.0b3-bin.zip file and copy the ant-contrib-1.0b3.jar file to JDEV_HOME/ant/lib

  7. You will need to make some adjustments for your environment.  Below is a copy of the build.properties you will need to change the home directories to match your environment.

    # global  
    wn.bea.home=d:/oracle/product/jdeveloper/11.1.1.4
    oracle.home=${wn.bea.home}/jdeveloper
    java.passed.home=${wn.bea.home}/jdk160_21
    wl_home=${wn.bea.home}/wlserver_10.3
      
    # temp  
    tmp.output.dir=d:/temp
      
    local.enabled=true
    local.reposistory=d:/oracle/product/jdeveloper/11.1.1.4/jdeveloper/integration/seed/apps/
    local.undeploy=true
    
    exclude.pattern=
    search.pattern=/dvm/*
    download.description=dvm
    target.environment=dev
    source.environment=local
    deployment.plan.environment=dev
      
    # dev deployment server weblogic
    dev.serverURL=http://dev.nz.oracle.com:8001
    dev.overwrite=true
    dev.user=weblogic
    dev.password=welcome1
    dev.forceDefault=true
    dev.server=dev.nz.oracle.com
    dev.port=8001

    Some properties of interest are:

    search.pattern  this is the search that is performed to find the objects you want to migrate. If the source environment is a DB MDS you can have multiple searches, e.g. /dvm/*;/xsd/*

    target.environment
    this is the environment you want to move the objects to. This value must match the prefix of the connection properties, e.g. dev.serverURL.

    source.environment this is the source enviroment where the objects are sourced. This value must match the prefix of the connection properties, e.g. dev.serverURL

    tmp.output.dir this is the directory that is used to create all the files as they are prepared to be deployed into the target environment.

    In this example I have only provided a local and a development environment. You can add new environments such as test and production if required, e.g.
    # test deployment server weblogic
    test.serverURL=http://test.nz.oracle.com:8001
    test.overwrite=true
    test.user=weblogic
    test.password=welcome1
    test.forceDefault=true
    test.server=test.nz.oracle.com
    test.port=8001
  8. The build.xml should not need changing but I’m sure you may want to add some enhancements if required.
    <?xml version="1.0" encoding="iso-8859-1"?>  
    <project name="soaDeployAll" default="main">  
        <echo>basedir ${basedir}</echo>  
      
        <property environment="env"/>   
        <echo>current folder ${env.CURRENT_FOLDER}</echo>  
      
        <property file="${env.CURRENT_FOLDER}/build.properties"/>    
        <property name="mds.deploy.dir" value="${tmp.output.dir}/${source.environment}"/>
    
      
        <tstamp>
    
           <format property="time" pattern="yyyyMMddhhmm" offset="-5" unit="hour"/>      
        </tstamp>   
        <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
    
    
        <target name="main">      
          
          <echo>Please select a correct operation</echo>
    
          
        </target>  
        <target name="migrateObjects">   
          <if> 
    
    
            <equals arg1="${source.environment}" arg2="local" />      
            <then>         
              <antcall target="exportLocalMDSobjects"/>   
              <antcall target="deployMDSobjects"/>
    
    
            </then>      
            <else>         
              <antcall target="exportRemoteMDSobjects"/>   
              <antcall target="deployMDSobjects"/>
    
            
            </else>   
          </if>          
        </target>  
        
        <target name="exportLocalMDSobjects">  

            <echo>Export Local MDS Objects ${local.folder}</echo>          <echo>export and create local MDS temp</echo>               <echo>create zip from file MDS store</echo>                 <mkdir dir="${mds.deploy.dir}"/>                <zip destfile="${mds.deploy.dir}/${download.description}${time}_mds.jar" compress="false">             <fileset dir="${local.reposistory}" includes="${search.pattern}" excludes="${exclude.pattern}"/>          </zip>            <echo>create zip with MDS jar</echo>                  <zip destfile="${mds.deploy.dir}/${download.description}${time}_mds.zip" compress="false">             <fileset dir="${mds.deploy.dir}" includes="*.jar"/>          </zip>            </target>         <target name="exportRemoteMDSobjects">             <propertycopy name="export.serverURL"    from="${source.environment}.serverURL"/>          <propertycopy name="export.overwrite"    from="${source.environment}.overwrite"/>          <propertycopy name="export.user"         from="${source.environment}.user"/>          <propertycopy name="export.password"     from="${source.environment}.password"/>          <propertycopy name="export.forceDefault" from="${source.environment}.forceDefault"/>            <echo>Export objects from ${export.environment} MDS</echo>            <echo>Export from ${export.serverURL} with user ${export.user}</echo>          <echo>Export jarFile ${mds.deploy.dir}/${download.description}${time}_mds.zip</echo>            <mkdir dir="${mds.deploy.dir}"/>         <ant antfile="${oracle.home}/bin/ant-sca-deploy.xml" inheritAll="false" target="exportSharedData">               <property name="wl_home" value="${wl_home}"/>               <property name="oracle.home" value="${oracle.home}"/>               <property name="serverURL" value="${export.serverURL}"/>               <property name="user" value="${export.user}"/>               <property name="password" value="${export.password}"/>                 <property name="pattern" value="${search.pattern}"/>              <property name="jarFile" value="${mds.deploy.dir}/${download.description}${time}_mds.jar"/>         </ant>            <echo>create zip with MDS jar</echo>                  <zip destfile="${mds.deploy.dir}/${download.description}${time}_mds.zip" compress="false">             <fileset dir="${mds.deploy.dir}" includes="*${time}_mds.jar"/>          </zip>     </target>        <target name="deployMDSobjects">             <propertycopy name="deploy.serverURL"    from="${target.environment}.serverURL"/>          <propertycopy name="deploy.overwrite"    from="${target.environment}.overwrite"/>          <propertycopy name="deploy.user"         from="${target.environment}.user"/>          <propertycopy name="deploy.password"     from="${target.environment}.password"/>          <propertycopy name="deploy.forceDefault" from="${target.environment}.forceDefault"/>            <echo>deploy objects to ${target.environment} MDS</echo>            <echo>deploy on ${deploy.serverURL} with user ${deploy.user}</echo>          <echo>deploy sarFile ${mds.deploy.dir}/${download.description}${time}_mds.zip</echo>            <ant antfile="${oracle.home}/bin/ant-sca-deploy.xml" inheritAll="false" target="deploy">               <property name="wl_home" value="${wl_home}"/>               <property name="oracle.home" value="${oracle.home}"/>               <property name="serverURL" value="${deploy.serverURL}"/>               <property name="user" value="${deploy.user}"/>               <property name="password" value="${deploy.password}"/>               <property name="overwrite" value="${deploy.overwrite}"/>               <property name="forceDefault" value="${deploy.forceDefault}"/>               <property name="sarLocation" value="${mds.deploy.dir}/${download.description}${time}_mds.zip"/>          </ant>          </target>     </project>

  9. The final file is the bat file to run the ANT script. this will need to be changed to meet your environment.

    set ORACLE_HOME=d:\oracle\product\jdeveloper\11.1.1.4
    set ANT_HOME=%ORACLE_HOME%\jdeveloper\ant
    set PATH=%ANT_HOME%\bin;%PATH%
    set JAVA_HOME=%ORACLE_HOME%\jdk160_21

    set CURRENT_FOLDER=%CD%

    ant -f build.xml %1

  10. You can run the ANT script from any directory you choose to download the scripts. The bat file will set the correct path to find the right executables. As all the dynamic variables are set in the build.properties you only need to specify the project to execute. Open a command prompt and change directory to where you ANT scripts are. Execute the following:

    mdsConfig.bat migrateObjects


  11. You should now see you DVM in your DB MDS in JDeveloper.


  12. The last test it to see that your DVM has now been loaded in the server and can be accessed from the SOA Composer.




Comments:

Great blog James - I used this to deploy shared artefacts to our Linux MDS server. Thanks !

Posted by Dom on May 20, 2011 at 04:23 AM GMT+13:00 #

Hi, I saw another way to deploy the MDS repository to the server as said in the below link. http://www.orafmwschool.com/soa-11g-mds/ May I know the advantage of this ant script over the method said in this link? In this link, they hav suggested to make use of JAR file and then creating a deployment profile to reflect the changes in the server. Thanks, Sabarisri. N

Posted by Sabarisri on May 21, 2011 at 01:02 PM GMT+13:00 #

Hi, I have tried with the script you hav given. I get the following error. BUILD FAILED D:\StudyForInstalling\SOA11gHome\MyWorkSpace\FaultPolicy\build.xml:37: The following error ocurred while executing this line: D:\StudyForInstalling\SOA11gHome\MyWorkSpace\FaultPolicy\build.xml:64: Property '${source.environment}.serverURL' is not defined. I have my .bat file like this: set ORACLE_HOME=D:\StudyForInstalling\SOA11gHome set ANT_HOME=D:\StudyForInstalling\SOA11gHome\jdeveloper\ant set PATH=%ANT_HOME%\bin;%PATH% set JAVA_HOME=D:\StudyForInstalling\SOA11gHome\jdk160_21 set CURRENT_FOLDER=%CD% ant -f build.xml %1 **************************** build.xml # global wn.bea.home=D:/StudyForInstalling/SOA11gHome oracle.home=D:/StudyForInstalling/SOA11gHome/jdeveloper/ant java.passed.home=D:/StudyForInstalling/Softwares/jdk160_21 wl_home=D:/StudyForInstalling/Softwares/wlserver_10.3 # temp tmp.output.dir=D:/Temp_MDS local.enabled=true local.reposistory=D:/StudyForInstalling/SOA11gHome/jdeveloper/integration/seed/apps/ local.undeploy=true exclude.pattern=search.pattern=/faulthandling/* download.description=faulthandling target.environment=dev source.environment=local deployment.plan.environment=dev # dev deployment server weblogic dev.serverURL=http://localhost:7001 dev.overwrite=true dev.user=weblogic dev.password=sabari18 dev.forceDefault=true dev.server=http://localhost dev.port=7001 I dint do any changes with the build.xml you hav given. Pls tell where i went wrong.. Thanks, Sabarisri. N

Posted by Sabarisri on May 21, 2011 at 04:16 PM GMT+13:00 #

This is a good link, the real difference is in my blog I load all the common objects into the local file MDS using OS commands. They are using jdeveloper to bundle them together. My script allows you to move common objects between environments which is good for things like DVM as they could be changed in the composer for the test environment and you want to migrate those changes. Using the orafmwschool method you will need to make the chnages again in JDeveloper and rebundle. It comes down to your use case. You could evne use a comnination of the 2. cheers James

Posted by James Taylor on May 22, 2011 at 02:14 AM GMT+13:00 #

Something doesn't look right. You have set the source to be local. This means it is going to look for the objects on your file MDS (JDeveloper). If you look at the build.xml there is an if statement checking if this is local or not. It looks like this maybe failing or there could be a space at the end of the line for the source.environment parameter. Make sure in the build.properties that there are no space on the end. cheers James

Posted by guest on May 22, 2011 at 02:29 AM GMT+13:00 #

Hi,

I have created a deployment plan in soa 11.1.1.4, which creats a soa-bundle that includes dvms to migrate from Jdeveloper to database based MDS.

Problem is: After deploying the dvm to MDS as a bundle, i do not see the dvm in composer. However, it shows up in MDS.

Am i missing any step between deploying dvm into MDS as a bundle and viewing the same in soa composer.

Thanks,
Naveen.k.v

Posted by guest on November 15, 2011 at 05:53 AM GMT+13:00 #

If you bounce the soa managed server does it show up now?

another thing to check is the MDS that you have inserted to is the same as the one for the SOA Composer.

cheers
James

Posted by James Taylor on November 15, 2011 at 08:07 AM GMT+13:00 #

Hi,

Nice blog. I tried this. When deploying this JAR file via ant, i am facing this issue.

[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

Any suggestions plz.
-Sudheer

Posted by Sudheer on October 04, 2012 at 07:19 PM GMT+13:00 #

I think error 2000 is due network problems (firewall...).

Posted by oracledigger on August 30, 2013 at 05:39 AM GMT+13:00 #

Hello, I have this issue. Sometime it works, sometime it doesn't. I don't know why

----------------------------------------------------------------------

[deployComposite] INFO: Received HTTP response from the server, response code=500
[deployComposite] SEVERE: Invalid logging line: <!DOCTYPE HTML PUBLIC "-//W3C//D
TD HTML 4.0 Draft//EN">
[deployComposite] SEVERE: Invalid logging line: <HTML>
[deployComposite] SEVERE: Invalid logging line: <HEAD>
[deployComposite] SEVERE: Invalid logging line: <TITLE>Error 500--Internal Server Error</TITLE>
[deployComposite] SEVERE: Invalid logging line: <META NAME="GENERATOR" CONTENT="
WebLogic Server">
[deployComposite] SEVERE: Invalid logging line: </HEAD>
[deployComposite] SEVERE: Invalid logging line: <BODY bgcolor="white">
[deployComposite] SEVERE: Invalid logging line: <FONT FACE=Helvetica><BR CLEAR=a
ll>
[deployComposite] SEVERE: Invalid logging line: <TABLE border=0 cellspacing=5><T
R><TD><BR CLEAR=all>
[deployComposite] SEVERE: Invalid logging line: <FONT FACE="Helvetica" COLOR="bl
ack" SIZE="3"><H2>Error 500--Internal Server Error</H2>
[deployComposite] SEVERE: Invalid logging line: </FONT></TD></TR>
[deployComposite] SEVERE: Invalid logging line: </TABLE>
[deployComposite] SEVERE: Invalid logging level on line: <TABLE border=0 width=1
00% cellpadding=10><TR><TD VALIGN=top WIDTH=100% BGCOLOR=white><FONT FACE="Couri
er New"><pre>java.net.ProtocolException: Exceeded stated content-length of: &#39
;298&#39; bytes
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.ServletOutputStreamImpl.checkCL(ServletOutputStreamImpl.java:200)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.ServletOutputStreamImpl.write(ServletOutputStreamImpl.java:146)
[deployComposite] SEVERE: Invalid logging line: at java.io.OutputStream.
write(OutputStream.java:58)
[deployComposite] SEVERE: Invalid logging line: at oracle.integration.pl
atform.blocks.deploy.servlet.CompositeDeployerServlet.sendLogMessages(CompositeD
eployerServlet.java:431)
[deployComposite] SEVERE: Invalid logging line: at oracle.integration.pl
atform.blocks.deploy.servlet.CompositeDeployerServlet.doPost(CompositeDeployerSe
rvlet.java:127)
[deployComposite] SEVERE: Invalid logging line: at javax.servlet.http.Ht
tpServlet.service(HttpServlet.java:727)
[deployComposite] SEVERE: Invalid logging line: at javax.servlet.http.Ht
tpServlet.service(HttpServlet.java:821)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.ServletStubImpl.execute(ServletStubImpl.java:300)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.TailFilter.doFilter(TailFilter.java:27)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.u
til.JpsSubject.doAsPrivileged(JpsSubject.java:313)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.http.JpsFilter.doFilter(JpsFilter.java:71)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.u
til.JpsSubject.doAsPrivileged(JpsSubject.java:313)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
[deployComposite] SEVERE: Invalid logging line: at oracle.security.jps.e
e.http.JpsFilter.doFilter(JpsFilter.java:71)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
[deployComposite] SEVERE: Invalid logging line: at oracle.dms.servlet.DM
SServletFilter.doFilter(DMSServletFilter.java:136)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.FilterChainImpl.doFilter(FilterChainImpl.java:57)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.j
ava:3715)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:
3681)
[deployComposite] SEVERE: Invalid logging line: at weblogic.security.ser
vice.SecurityManager.runAs(SecurityManager.java:120)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.WebAppServletContext.execute(WebAppServletContext.java:2183)
[deployComposite] SEVERE: Invalid logging line: at weblogic.servlet.inte
rnal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
[deployComposite] SEVERE: Invalid logging line: at weblogic.work.Execute
Thread.execute(ExecuteThread.java:209)
[deployComposite] SEVERE: Invalid logging line: at weblogic.work.Execute
Thread.run(ExecuteThread.java:178)
[deployComposite] SEVERE: Invalid logging line: </pre></FONT></TD></TR>
[deployComposite] SEVERE: Invalid logging line: </TABLE>
[deployComposite] SEVERE: Invalid logging line: </BODY>
[deployComposite] SEVERE: Invalid logging line: </HTML>
[deployComposite] ---->response code=500, error:null

BUILD SUCCESSFUL
Total time: 1 second

Posted by guest on April 15, 2014 at 02:03 AM GMT+13:00 #

It looks like you have a network issue connecting to the MDS data store. This can happen if you are on a different network, i.e. at work, or on wireless, etc.

cheers
James

Posted by guest on April 15, 2014 at 10:31 AM GMT+13:00 #

When I try to deploy others composites, even in JDeveloper, I have the same issue. The error comes from the server (500), So may be the problem is not the network. I have restarted the server, but same issue.

What does this means : 'Exceeded stated content-length of: &#39
;298&#39; bytes' ? How can I solve it ?

Thanks

Posted by guest on April 15, 2014 at 10:41 AM GMT+13:00 #

I'm not surprised by this result. The server is responding back with a HTTP 500 error which means the server is not responding. As I say have you changed your network, i.e. wireless, connecting via VPN, connecting via a proxy server.

If you think you have the network right, shutdown your PC and try again. for some reason JDev can hold cache even if you shut it down.

cheers
James

Posted by guest on April 15, 2014 at 11:58 AM GMT+13:00 #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Discussions and Examples using Oracle Fusion Middleware. Some image links are broken when using Firefox, Safari, and Chrome. If you want to see the full image please use IE.

Twitter:@james8001

tumblr hit counter vistors, thanks for your support

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today