Wednesday, 12 November 2014

Starting managed servers using nodemanger from admin console

Change property in the nodemanager properties file

When you are planning to start a managed server from admin console (<host>:<port>/console).
Change the following property from false to true in nodemanger properties file.
StartScriptEnabled=true
The node manager properties file can be found at 
<fmw-home>\wlserver_10.3\common\nodemanager\nodemanager.properties
Where fmw-home is the weblogic installation directory or fusion middleware home.

Common Issues encountered


After this if you face port already in use error to start a managed server this is due to the debug property set to the same port . Try adding this lines to setDomain.sh / .bat  depending upon the environment you are using
<fmw-home>\user_projects\domains\soa_domain\bin\setDomainEnv.cmd
Rename the soa_server1 to your corresponding server name by default it is soa_server1

if "%SERVER_NAME%" == "soa_server1" (
   set DEBUG_PORT="8454"
)
at

if "%SERVER_NAME%"=="" (
    set SERVER_NAME=AdminServer
)

oraext:index-within-string throws internal xpath extension error

Using oraext:index-within-string is not pretty simple as it looks so . If you are using
oraext:index-within-string(($inputVariable.payload/client:DocId),'.')
Unlike builtin xpath functions which have internal type conversion this throws an error. Try using 
oraext:index-within-string(string($inputVariable.payload/client:DocId),'.')
Instead which works . Please note the conversion of string here .
This is applicable to oracle bpel assign activity .

Wednesday, 2 July 2014

how to make a file adapter skip if a directory doesn't exist in oracle bpel

Many a times we come across this requirement to read through all of the sub-directories inside a directory . There are use-cases that  even need to verify empty directories . In such cases adding this property to the composite would help.

Saturday, 26 April 2014

User creation in weblogic with multiple properties from ant using wlst

Creating users from the wlst is pretty straight forward and you can go through the oracle documentation for the same. Here is the link to the document page http://docs.oracle.com/cd/E23943_01/web.1111/e13715/config_wls.htm#i1021808.
This is written to automate the task of creating users from ant . The only change that is to be made is to set the fmw.home,user.url,adminusername,adminpassword to your environment.
All the properties can be edited from the build.properties file.
The source has four files
  1. Build.xml Contains the call to create users task for creating multiple users in a single shot. users.option is used to specify all or few of the users at a time
  2. Build.properties contains the name value pairs that can be customized
  3.  createUser.py creates the users using wlst
  4. userCreationlibrary.xml contatins invocation to the usercreation.py file with the necessary parameters set

If you need more information please feel free to comment.you can find the code at github. Link to the source is onto the right .

Friday, 25 April 2014

Configuring DB polling adapter with mark reserved value

There are many ways to make the polling of a DB adapter to make it singleton i.e. making the adapter poll a record only once even of there are many nodes on the cluster. This post typically explains how to use mark reserved value with both delete polling strategy and logical delete

This assumes that you have experience in deploying and creating connection factories  in the db adapter . If you need more help on this you can refer to the documentation or search other blogs there are plenty.

These are the steps to be followed for both of the polling strategies
  1. Create a table sample in the hr schema 
  2. Create a SOA project with composite in JDeveloper
  3. Drag and drop a db adapter on to the composite . Fill in all the details with any values you prefer .Create a connection to the hr schema and select it .
  4. Select the operation type as poll for new or changed records in the table.
  5. Import the table sample and select data as the primary key for the table.
  6. The polling strategy is to be selected in this step 
    1. Delete Polling strategy
      Select the option delete the rows when read
    2. Logical Delete
      Select the option update the field in the sample table(Logical delete)
  7. Leave the polling options and advance options to default values and click on finish
  8. In the case of Delete polling strategy there is no option for including the values of  MarkReadColumn,MarkReservedValue,MarkUnreadValue.Copy paste in the generated .jca file to make the necessary changes as shown below
  9. For Logical delete the ui configuration can be used to fill the property values
Let me take back and explain the use of each property above
  • MarkReadColumn
    The column to be used for updating the below given three properties
  • MarkReservedValue
    This is the value which is used to pick the records on a specified node. The value can be specified with special variables . Let us look at the above property value and study it.
    In the above sample weblogic.Name is the name of the server node and IP is the ip address fo the node. -2 specifies the last two characters
    R${weblogic.Name-2}-${IP-2}
  • MarkUnreadValue
    This property specifies the value of the record which are to be picked . For simplicty you can consider this as where condition
  • MarkReadValue
    This property is useful only in the case of logical delete. This property updates the value of MarkReadcolumn with the specified property after sucessful processing for the record

OSB error handler using fault variable can't acess fault var

There is a typical situation where you can't access the fault variable directly inside the error handler . When you got to compare and conditionally branch and when you use the fault variable in the condition then you would see error as below

The typical flow would look like this
This can be solved by assigning the fault variable to an intermediate value as below
Then the condition can be specified using the intermediate value as given below
Now the error goes way and every thing works fine as expected.



Friday, 21 March 2014

Configuring singleton proxy services in OSB clustered environment

The way things work in a clustered environment is way different . At times it is required to poll for the services only once even on a high available environment. I would like to take some time to explain where singleton is supported in OSB.
Unlike in the BPEL services OSB doesn't support singleton behaviour for all of the services
These are the following services that are supported for singleton in OSB.
  1. File
  2. FTP
  3. Email
The respective configuration can be done from eclipse or from osbconsole . For more details refer to the oracle documentation
Link to oracle doc 

Tuesday, 7 January 2014

OSB can't acess soa mds aritifacts during runtime

You can't acess soa mds aritifacts from OSB during runtime.  The reason is as follows
Since OSB is a stateless service bus it shouldn't have any dependency on the other products like database unlike soa which has a dependency.
So OSB should have a local copy of file which you want to acess.
But you can acess the other metadata using a java callout which is simple. But whenever you change a xsd it needs to be changed in the osb project also.
When you want to acess you can use http request which is deployed as a soa composite.

Sunday, 5 January 2014

BAM deployment to remote server using ant

There is no much information around the BAM deployment . BAM deployment can be done by the following two ways
  1. When you have to do a deployment to BAM all you can use is ICommandTask which needs to run from the same machine as the weblogic server. You can still use it from the remote machine provided you copy the config file from the remote machine to the local one
  2. Using the ICommand.jar file you can create an ant task and deploy it to the server. You needn't copy any files from the remote server all you need is url and credentials to the environment
In this post i would like to explain on the second approach as you can find a lot of oracle doc from the oracle site. This jar was published as a oracle white paper white paper url .
I have done some enhancements to the ant task . The enhancements are
  1. BAM icommand only accepts inline content as it can't read remote files . Copying and pasting all this is a pain so i have automated using ant and reading the file.
  2. Checking the response in the file (is difficult for multiple files) so i have made it available on to the command prompt.
The bam.option is to be set to all if you wish to deploy mutiple files at once else provide the file name in the bam.option. Don't modify the command file name and command file location unless you wish to change the template command file name and location .The properties file should be modified as per the  environment you wish


 
The ant task reads the file to be imported and replaces the predefined config file for export. Since the content requires to be inline for remote deployment.

You can get the complete source on my git hub repository.

Creation of connection pools with multiple properties in weblogic resource adapters using ant

Since there is already a blog post written by Edwin Beimond I wouldn't rewrite the entire deployment process . You can refer the post http://biemond.blogspot.in/2012/02/configure-weblogic-resource-adapters.html.


This is meant to configure multiple properties of adapters. The changes i made from the version of Beimond are
  • Read the path from the application 
  • Adding multiple properties to the connection factory




The properties should be  of the above mentioned format i.e. each property name should be followed by it's property value. For example the dataSource property has value of jdbc/hr which should be given as
dataSource:jdbc/hr

You can get the complete source from my git hub repository.

NOTE:
This works good as long as it's a local machine . If it is a remote server you have to run this from the machine where the web logic server is running.