Sunday, November 28, 2010

Validating incoming String of Date format using Regular Expression

I was recently trying to restrict the format of the incoming variable so as to adhere it to the date format like 27-Nov-2010 04:17:37 PM. Well, this had to be pretty simple by using the xp20:matches function that can be used to match a string pattern against a regular expression. I used my function as

xp20:matches(bpws:getVariableData('inputVariable','payload','/ns3:PropertyDetails/ns3:PropertyValueToUpdate'), '^(0[1-9]|[12][0-9]|3[01])[- /.](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[- /.](19|20)\d\d (0[1-9]|1[012])[:](0[1-9]|[12345][0-9])[:](0[1-9]|[12345][0-9]) (AM|PM)$')

Ooops. This was not working and but telling me Internal Xpath Error. Well the reason was that getVariableData() function gets the data from the XML schema element in Object format rather than in String. Finally, all I did was that I used the string() function to convert the object from variable data and it worked without any issue.

xp20:matches(string(bpws:getVariableData('inputVariable','payload','/ns3:PropertyDetails/ns3:PropertyValueToUpdate')), '^(0[1-9]|[12][0-9]|3[01])[- /.](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[- /.](19|20)\d\d (0[1-9]|1[012])[:](0[1-9]|[12345][0-9])[:](0[1-9]|[12345][0-9]) (AM|PM)$')

Just a small learning…

Saturday, November 27, 2010

Provider ABCS not able to read the data while transform, Default Part Name not correct

I started working on AIA 3.0 with SOA 11.1.3.3 and developed a simple Worker interface that fetches the data from a table and transfers it to Provider ABCS.

But while running it, I faced the 2 errors.
The first error that I faced was at the time of compilation. Well, that was seemingly a bug which was worked around.

Later, when I was testing the process, it behaved strange in a way that the all records travelled till Provider ABCS Receive activity properly but did not get Transformed. The Transform activity payload looked empty as shown below. 

  <Invoke_WriteAllWorkersFile_InputVariable>
      <part  name="XxbbIntgWorkersCollection">
           <XxbbIntgWorkersCollection />
      </part>
  </Invoke_WriteAllWorkersFile_InputVariable>
  
I tried various things for this. But later found that the problem was with Provider ABCS. While constructing the PABCS using service constructor, it created the SyncWorkerProvABCSImpl.WSDL (<ProjectName.WSDL>) message part as
  
  <message name="SyncWorkerReqMsg">
        <part name="SyncWorkerEBM"   
              element="eboebo:SyncWorkerListEBM"/>
  </message>

However, looking at the transformation I noticed that actual data is coming into the part with name SyncWorkerListEBM instead of SyncWorkerEBM. Hence as my transform by default was trying to access the data from the SyncWorkerEBM part, it was not getting any data resulting in empty transformation output variable. I changed the above code as following and it worked like a charm.

  <message name="SyncWorkerReqMsg">
     <part name="SyncWorkerListEBM" 
           element="eboebo:SyncWorkerListEBM"/>
  </message>

The same has been raised to Oracle but till they come up with something, we need not stop. Let’s be going…

Tuesday, August 10, 2010

Oracle Fusion Middleware Console not showing up properly : Screen Reader Setting

Yesterday I was looking at my friend’s FMW and it was not displaying the details properly. It showed something like below with radio buttons and partially visible table content.
Well, this is not any problem but just an accessibility option. The solution is pretty simple. To correct this, go to Oracle FMW Console > Setup >  My Preferences Menu Item > Accessibility Menu Item > Uncheck I use a screen reader. This will solve the problem. 


Wednesday, July 28, 2010

How to install AIA 3.0 from scratch? AIA 3.0 Installation : Important Tips and Tricks...

Undoubtedly, it was a little challenge while trying to install AIA 3.0. Firstly the long Installation guide and very generic error descriptions  leave you nothing but perplexed, secondly, my OS being MS Vista adds fuel to the fire. But, despite all the odds, what matters most is that AIA 3.0 runs successfully on my Laptop (Neeraj-PC). However, just to save the time of world's greatest developers, I'm writing this post to give some of the tips and tricks that I found while installing. Hope they find it useful.


Note: For OS other than Windows the commands will change accordingly.
Processor : Intel Core 2 Duo 2.00 GHz
RAM : 3 GB
OS : Microsoft Windows Vista Home Premium (32 bits)


Below are the steps that I followed to install AIA

  1. Install Oracle Database 11g (11.2.0.1.0)
    • Download the Oracle database installable as zip files and extract them to a single directory. Make sure when you start the installation, there is only one folder having all the contents of both the zips. The easy way is multi-select both the zips and say Extract to some folder.
    • Proceed with the steps. I chose Desktop Class, Enterprise Edition and did not install Loopback Adapter.
    • Proceed with the steps and after successful installation check the Enterprise Manager console using http://<host_name>:<port_number>/em as in my case http://Neeraj-PC:1158/em.
  2. Create schemas using the Repository Creation Utility (rcu)
    • While creating the schemas, I gave all the schemas the same password. However, you can opt to give different passwords as desired.
  3. Install Weblogic server 11g R1 (10.3.2)
    • I installed using Sun JDK without any Loopback Adapter 
  4. Install Oracle SOA Suite (11.1.1.2.0)
    • Study the software and hardware requirements before installing and also gather the necessary supporting documents as Installation guide, Administration guides etc.
    • Follow the installation guide and install the WLS. After installation do not wonder if you are not able to see the soa_server1 folder under <Middleware>/user_projects/domains directory. It will come when you start your managed server first time using the startManagedWeblogic soa_server1.
  5. Finally Installing the AIA 3.0
    • Go through the Hardware-Software requirements carefully and download the AIA installable from Oracle e-delivery website. Also download the following supporting documents from Oracle Support
      • Oracle Application Integration Architecture Foundation Pack 11g Release 1 (11.1.1.2.0): Installation Guide - [Doc No :E17949-01]
      • Known Issues and Workarounds for Oracle Application Integration Architecture Foundation Pack 11gR1 [Note ID : 1087180.1] 
    • While following the installation guide and preparing for installation, pay attention to the steps mentioned below.
    • Configuring JVM Parameters - Instead of modifying the file setDomainEnv.cmd, make the change in the setSOADomainEnv.cmd as this file seems to override all the changes in the other domain files. Set the if condition as described. if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (    set USER_MEM_ARGS=%PORT_MEM_ARGS%) else (    set USER_MEM_ARGS=-Xms1024m -Xmx1024m -XX:PermSize=512m XX:MaxPermSize=512m )
    • Enabling remote JDBC Connection - Make this argument as true in both .cmd and .sh files to avoid any confusions. 
    • Setting up Timezone - Firstly verify the current timezone in the database from the sqlprompt(by running sqlplus.exe) using SELECT SESSIONTIMEZONE FROM DUAL;Then you can set it to whatever you want using ALTER SESSION SET TIME_ZONE = ‘EST’;. Don’t close this sql prompt window till AIA installation is complete as it is maintained only for a session. Specify the same time zone in the weblogic managed server start too as given in the guide. Don’t specify any timezones like +5:30 to avoid any errors.
    • Configure your node manager properly and Start your SOA server using the Node Manager before installation. Learn How.
    • Go ahead with your AIA installation using the AIA Installer. While installation, at the time of Deployment Configuration step it will say sometimes as Failed due to Unable to reserve space in Heap. Click Retry. Close all open programs and make sure there is enough memory available as specified in the USER_MEM_ARGS. It should solve the error next time.
    • After the installation is successful, go to the WLS console and set the user permissions as shown below.


    • Verify the installation from the AIA Console http://<localhost:soa_server_port_number>/AIA

Wednesday, June 30, 2010

Starting Admin and Managed Servers using Node Manager and WLST

Node Manager is a WebLogic Server utility, independent of domains, that enables you to start, shut down, and restart Administration Server and Managed Server instances from a remote location. You can further use the Node Manager to control Administration Server and Managed Server from a local location also as I used in my case. Below post explains how you can start your Admin and Managed servers from the Node Manager.


Note : I have used Windows Vista OS and Oracle Database 11.2. All the commands for Linux/Unix will change accordingly.


Please follow the following steps for the same.


1.) Firstly configure the Node Manager
2.) Verify the Node Manager
3.) Once you verify and complete the above steps, I recommend, stop and close everything open till now. Then follow the following steps.
Start your Node Manager using <Middleware_Home>\wlserver_10.3\server\bin\startNodeManager.cmd command from the command prompt.

  • Open a fresh command prompt window and run WLST.cmd from <Middleware_Home>\wlserver_10.3\common\bin\WLST.cmd.
  • Next task is to connect to the Node Manager using nmConnect(). In the WLST console window type nmConnect('weblogic','welcome1','neeraj-pc','5556','soa_domain').
  • Once connected to Node Manager the command prompt will change.
  • Now to start your Admin server type nmStart() e.g. nmStart('AdminServer')
  • To start your managed server type nmStart() e.g. nmStart('soa_server1')
  • If it gives the success notification, you are done. Also, you can verify the same from the Weblogic Console.


    Part 2 : How to start the Node manager and Verify that it is running properly

    After the Node Manager is properly configured, you can start the Node Manager by following the below mentioned steps.

    • Open a new command window and go to <Middleware_Home>\wlserver_10.3\server\bin using cd command. Type startNodeManager and press Enter.
    • It starts your Node Manager and gives the output as shown in below image.

    • To verify if the Node Manager is running successfully, start your Admin Server if it is not Running and go to Weblogic Server Console.
    • Navigate to Environment --> Machines --> LocalMachine --> Monitoring Tab --> Node Manager Status. It should display Reachable. See below image.
    • Hence the Node Manager is running properly.




    Part 1: How to configure the Node Manager to start Admin and Managed Servers

    Before you can use the Node Manager utility, you need to configure/verify the Node Manager. 
    • For this start the Admin Server as usual by running the <Middleware_home>\user_projects\domains\soa_domain\startWebLogic.cmd.
    • Go to Weblogic Console and navigate to Machines-->LocalMachine-->Configuration Tab-->Node Manager Tab. Specify the ListenAddress (where Node Manager will run) and ListenPort as per you installation. By default the port is 5556. Be sure to provide the exact URL/Host name in ListenAddress as localhost will disallow starting the servers from remote location. See below image.

    • Go to <Middleware_home>\wlserver_10.3\common\nodemanager\nodemanager.properties. Set StartScriptEnabled=true.
    • Start WLST from <Middleware_home>\wlserver_10.3\common\bin\wlst.cmd in a separate command prompt window. You can double click on the wlst.cmd also to start WLST.
    • Once WLST starts, connect to Admin Server from the WLST console. To connect type the connect() command on the WLST console and press Enter. Accept defaults or provide inputs as required. Once it connects successfully, the WLST prompt will change to wls:/mydomain/serverConfig>.
    • Now type nmEnroll(<Middleware_home>\user_projects\domains\soa_domain). This command enrolls the current machine with the Node Manager and creates some properties file (nm_password.properties,SerializedSystemIni.dat).
    • If the message displays as "Successfully enrolled this machine with the domain directory at", Enrollment is successful. 
    • Exit from the WLST console using the exit() command and shut down your Admin Server and Close the Browser Console window.
    • Node Manager is configured. Further, to start the Admin and Managed Servers from this Node Manager, refer to this post.