Friday 29 September 2017

ANT : Get File Directory and File Name from Path

This is what you should do if you are trying to get ANT to get;

1. File name with directory path from a location

Use the below code snippet in your build.xml

                      <path id="filewithpath">
                            <fileset dir="${location}">
                                <include name="*_myfile_*.xml"/>
                            </fileset>
                        </path>

${filewithpath} should evaluate as the file name with full directory path.

2. Only File name from a location

                      <path id="filewithpath">
                            <fileset dir="${location}">
                                <include name="*_myfile_*.xml"/>
                            </fileset>
                        </path>

                  <pathconvert property="filename" refid="filewithpath"/>

${filename} should evaluate as the file name.


Helpful? Please comment.

Happy Learning!!





Wednesday 27 September 2017

OSB 12c Email Polling : Poller target server should be specified in case of cluster domain

This is what you should do if you have created a OSB proxy service to poll e-mail server and while deploying to cluster you are getting the below error in JDeveloper:

BEA-381611
Error: Poller target server should be specified in case of cluster domain.
Description
     Poller target server should be specified in case of cluster domain.
Action
     Make sure that the File proxy configuration has one of the managed servers as poller target server if it is running in the cluster.

Solution -

1. Goto your WebLogic console and copy one of the OSB managed server name.
2. Edit your proxy service source code [use notepad etc.], add managed server name to the element 'pollerTargetManagedServer'

ex:
<ema:pollerTargetManagedServer>osb_server2</ema:pollerTargetManagedServer>

3. Save
4. Refresh your JDeveloper code, after which in the proxy service you will be able to see the value in the Manged Server textbox.
5. Retry your deployment.

Or

You can deploy your jar directly using OSB console and when prompted, select one of the manged servers from the drop-down list in proxy service.


Helpful? Please comment.

Happy Learning!!

Tuesday 26 September 2017

SOA 12c DBAdapter: Error while validating JCA Reference Binding meta data during composite deployment

What you need to do if you are deploying you DBAdapter service and getting the below error:

Error deploying archive sca_SOADBAdapter_rev1.0.jar to partition "default" on
server soa_server1
HTTP error code returned [500]
Error message from server:
There was an error deploying the composite on soa_server1: Deployment Failed:
Error while validating JCA Reference Binding meta data during composite
deployment.: JCA deployment validation errors for 'Adapters/DBReference_db.jca'.

Check server log for more details.
Error deploying archive sca_SOADBAdapter_rev1.0.jar to   partition "default" on server
soa_server1
Deployment cancelled.
----  Deployment incomplete  ----.
Error deploying archive  file deploy/sca_SOADBAdapter_rev1.0.jar
(oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)


The possible cause for this issue is that the JNDI being used in .jca is unavailable, incorrect or invalid.

Solution - Create or Correct your JNDI.
Also, Check if your JNDI has the correct DataSource configured and the DataSource test is successful.
If all these are good and you still have the same error, open your DBAdapter configuration and check table imports and settings.


Helpful? Please comment.

Happy Learning!!

SOA 12c FileAdapter : JCA deployment validation errors

What you need to do if you have migrated your 11g code to 12c and you are getting the below error when deploying:

Error deploying archive sca_HelloWorldJCA_rev1.0.jar to partition "default" on server soa_server1
HTTP error code returned [500]
Error message from server:There was an error deploying the composite on soa_server1: Operation failed - Member(Id=3,member:soa_server1, Role=WeblogicServer):Error while validating JCA Reference Binding meta data during composite deployment. : JCA deployment validation errors for 'GetFile_file.jca'
; .  Please see the server diagnostic logs on soa_server1 for details.
 Check server log for more details.

First you will not get any error when you are compiling your code in JDeveloper.

Second this issue can be due to 2 reasons:

1. Your .jca file has a logical or physical directory entry which is invalid (means not a correct path or access permissions is not given to the folder)

Solution - Correct the path or give 777 access to the folder and retry.

2. When migrating your code form 11g to 12c, the resulting composite.xml has new empty property entries for the the logical directory like below:

<binding.jca config="GetFile_file.jca">
..
<property name="LoadDirectory" override="may" many="false" type="xs:string" source=""></property>
..
</binding.jca>

Solution - Remove the unwanted property and retry.

Helpful? Please comment.

Happy Learning!!

Sunday 24 September 2017

ANT : SVN checkout

Steps on how to setup and checkout SVN code using Ant

1. Create a folder AntCheckout
2. Inside it create a folder lib
3. Download the below list of jars and place them in the lib folder




4. Inside Ant folder create build.properties file which should look like below:

svn.url=http://svn.test.com/svn/repos/myproject
svn.revision=HEAD
svn.uname=test

svn.password=test
svn.checkout.dir=myrepo

5. Update the property values accordingly with your SVN details.

6. Inside Ant folder create build.xml which should look like below:

<?xml version="1.0" encoding="iso-8859-1"?>
<project name="svncheckout" default="checkout">

    <!-- Antcontrib path -->
    <path id="antcontrib.path">
      <pathelement path="lib/ant-contrib-1.0b3.jar" />
    </path>
    <taskdef classpathref="antcontrib.path" resource="net/sf/antcontrib/antcontrib.properties"/>
    <taskdef classpathref="antcontrib.path" resource="net/sf/antcontrib/antlib.xml"/>
   
    <!-- SVNANT path -->
    <path id="svn.ant.classpath">
        <fileset dir="lib">
        <include name="**/*.jar"/>
        </fileset>
    </path>      
    <taskdef classpathref="svn.ant.classpath" resource="org/tigris/subversion/svnant/svnantlib.xml"/>

    <!-- SVN Checkout -->
    <svnSetting svnkit="true" javahl="false"  id="svn.settings"/>
    <target name="checkout" description="Pulls code from Subversion into the directory" depends="init">
            <echo>SVN URL: ${svn.url}</echo>
            <echo>Revision: ${svn.revision}</echo>
            <echo>Target Dir: ${svn.checkout.dir}</echo>
            <svn refid="svn.settings" username="${svn.uname}" password="${svn.password}" >
              <checkout url="${svn.url}" destPath="${basedir}/${svn.checkout.dir}" revision="${svn.revision}"/>
            </svn>  

             <!-- Remove unwanted .svn folders --> 
            <delete includeEmptyDirs="true">
                <fileset dir="${svn.checkout.dir}" includes="**/.svn/" defaultexcludes="false"/>
            </delete>
    </target>

    <!-- Clean folder before checkout -->
    <target name="init">
    <echo>Cleaning checkout folder: svn</echo>
        <delete includeemptydirs="true">
            <fileset dir="svn" includes="**/*"/>
        </delete>
        <mkdir dir="${svn.checkout.dir}"/>
    </target>
</project>

     <!-- Check if build.properties is available -->
    <available file="build.properties" property="file.exists" value="true" />
    <fail unless="file.exists" message="ERROR: Filename 'build.properties' does not exist." />
    <property file="build.properties"/>
 

7. Save All
8. Open command-prompt/ putty and set your ANT HOME
9. Run command ant checkout
10. The required artifacts will be checked-out in the myrepo folder.


Helpful? Please Comment.

Happy Learning!!

OSB 12c : Dynamic Routing to Business/Proxy Service

Dynamic routing is a kind of  Content-based Routing pattern, which is used when the BusinessService/ProxyService path is required to be de...