Tuesday, 17 December 2013

DB Adapter Insert error -javax.resource.spi.IllegalStateException in Oracle SOA Env

Hi Folks,

We have been facing a strange issue in SOA Env.

The issue is DB Adapter sometimes failing to insert the data into One table.

I wanted to stress the word "strange" here, bcz this issue is not continuously happening -only sometimes.

Error Message :

Error: Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: JCA Binding Component connection issue. JCA Binding Component is unable to create an outbound JCA (CCI) connection. The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: javax.resource.spi.IllegalStateException: [Connector:199176]Unable to execute allocateConnection(...) on ConnectionManager. A stale Connection Factory or Connection Handle may be used. The connection pool associated with it has already been destroyed. Try to re-lookup Connection Factory eis/DB/ETCfrom JNDI and get a new Connection Handle. Please make sure that the JCA connection factory and any dependent connection factories have been configured with a sufficient limit for max connections. Please also make sure that the physical connection to the backend EIS is available and the backend itself is accepting connections. ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution.

We have been struggled lot and finally figured out the root cause.


There is a disconnection between WLS and JCA connection pool manager.
When we update JCA adapter deployment with new JNDI and redeploy the adapter instance then WLS invalidates all the existing connections and it seems WLS even doesn't know that JCA connection pool is the owner of these connections and it doesn't inform JCA pool manager that it has invalidated the connections.
Now JCA pool manager has no idea of what happened and it still maintains invalid connections in its pool.

Absolutely when client requests JCA connection then JCA manager try to return the dead connection which results above error.

Solution 1 : 

1.Log on to your Admin console and navigate to Domain -> Deployments -> <adapter name> -> Configuration Tab -> Outbound Connection Pools Tab -> Under Groups and Instances expand the javax.resource.cci.ConnectionFactory
2.Locate and select the adapter JNDI and click on the Connection Pool Tab.
3.Please check to see if Shrinking is enabled. If not, please enable it.
4.Please check the value for Shrink Frequency Seconds. The default for some connection pools is as high as 900 seconds. Please reset this to 600 seconds or less.
5.Activate your changes.

We set connection shrink time to 600 sec that means 10 min. 

What does "ShrinkFrequencySeconds" parameter mean? 
"The number of seconds to wait before shrinking a connection pool that has incrementally increased to meet demand. ShrinkingEnabled must be set to true for a connection pool to shrink."

So, after 10 min, connections were returned to database. But just after that, probably a bunch of http requests came into play with the web servers. Most of the case, it needs to establish connection to the database to serve the request. Since these requests were more than the initial connection pool value which is 10 (back to the initial connection numbers after shrinking), jdbc establishes a bunch of new connections again to serve those requests. This is how we had a flood of new connection request after about 10 min on avg.

If this does not improve the situation, please also try increasing the max size of your connection pool.

Solution 2 :

Apply Oracle Patch "11812911"

Desc of Patch:-(11812911)


Solution 1
a. Download the patch 11812911 if it is available.
b. Apply the patch in a test environment.
c. Check if the issue is solved.

Solution 2
This solution updates the weblogic-ra.xml from the adapter without redeploying it 
a. Modify the adapter from the weblogic administration console
b. Save the changes
c. Go to the Deployments page
d. Check the Adapter
e. Click on the Update button
f. Choose "Update this application in place with new deployment plan changes. (A deployment plan must be specified for this option)"
Do not use the default option: "Redeploy this application using the following deployment files"
g. Click finish

An adapter has the following structure:

   | - META-INF
   |       | - MANIFEST.MF
   |       | - weblogic-ra.xml
   |       | - ra.xml
   | - AdapterName.jar
   | - *.jar

Programming WebLogic Resource Adapters 
weblogic-ra.xml Schema 
- Table 9-13 default-connection-properties subelements 

- Table 9-14 pool-params subelements "

I hope this should work.

Happy Learning .....!!!!   Fun Sharing......!!!!!

Friday, 6 December 2013

Set and Get Preferences in Oracle SOA Suite 11G

Hello Folks.

Now we will learn how to set Preference Dynamically in SOA composite.
This will be usable to change the Filename or Email or whatever in any environment run-time. 

       Preference is like a variable, whose value can be changed from EM console requiring no code change. 
      Open "Composite.xml".
        Set the preference in the component tag as a property tag.

       Double click on BPEL process drop an assign activity.
      Double click on assign activity and set result in output as mentioned below.

           Complete the BPEL and Deploy it.

Changing Preferences from EM-Console

       In EM-Console right click on SOA-infra à
Administrator à system MBEAN Browser.

       Go to oracle.soa.configàServer : AdminServer à SCA Component à select your project à SCAComposite.SCAComponent.

    Double click on your BPEL process displayed à Go to the properties in attributes tab.

       In this, you can change the preferences whatever you want in run-time.
There is no code change, No server restart required.

If you restart the server the preference value reset to old one, To be on the same value even after your server restart, you can do one step below.

After clicking "Apply" click "Return".
       Go to the "Operations" tab and click on the "Save" operation. Click "Invoke" and "Return".

Now if you restart the server you will get the same old value.

In case if you are working in cluster environment you should change the preference value in both the Nodes and do the above step in both the nodes.

Happy Learning......!!!!!!!!!!!!      Fun Sharing..............!!!!!!!!!!!!!!

Truncated Error while starting the WebLogic server - Database error -ORA-01033: ORACLE initialization or shutdown in progress

Hi Folks .

Recently I had a problem while starting the webLogic server .Its repeating truncated error and I tried to connect the DB and it is showing the below error.

Environment is my Windows local box - Server SOA

From Log:- 
Errors in file C:\ORACLEXE\APP\ORACLE\diag\rdbms\xe\xe\trace\xe_ora_8020.trc  (incident=60191):
ORA-00600: internal error code, arguments: [kcrfr_resize2], [4093640192], [67100672], [], [], [], [], [], [], [], [], []
Incident details in: C:\ORACLEXE\APP\ORACLE\diag\rdbms\xe\xe\incident\incdir_60191\xe_ora_8020_i60191.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details. 
ora-00600 internal error code

While connecting DB below exception:- 

ORA-01033: ORACLE initialization or shutdown in progress.

I had struggled and found the issue with the WL_LLR_ADMINSERVER table in SOAINFRA schema.
When you start the server without nohup you should shutdown the server before closing the server screen(CMD screen) ,If you directly close the CMD window without shutting down the server .it will create some dead threads in the mentioned table in SOAINFRA schema.

Description of  WL_LLR_ADMINSERVER is as follows the below screen.

So Run the script in DB or execute these lines in DB then problem will be solved.



JDBC LLR Domain//Server
JDBC LLR Domain//Server

JDBC LLR Version
JDBC LLR Version


2 rows deleted.

SQL> select * from WL_LLR_ADMINSERVER;
no rows selected

SQL> commit;
Commit complete.

Now start you server .It will be working fine this time.

Remember don't close the server start up screen without shutdown.

Happy Learning......!!!!!!!!!!!!!!!     Fun sharing......!!!!!!!!!!!!!!!!

Thursday, 21 November 2013

Oracle SOA Suite 11g Translation Error - Error while translating. Translation exception. Error occurred while translating content from file.

Recently we have faced a translation error in PRODUCTION as below.

"" Error while translating. Translation exception. Error occured while translating content from file /home/ftp/prod/in/invoices/Sample.xml Please make sure that the file content conforms to the schema. Make necessary changes to the file content or the schema. ""

All files are getting processed except this file. I have checked in all the ways , everything looks pretty well .
 I have tried multiple times pushing the same file in FTP location but the same error is repeating.

I have struggled 5 hours to find the Issue root cause - Finally I got it as the file Encoding Style is in UTF-8 not the ANSI as UTF-8.

The translation errors will come with the Encoding style fault.

Usually Oracle SOA Adapters supports only ANSI as UTF-8 formats .If the file coming with UTF-8 format it will not be processed by Composite as it can not translate to the native schema in the adapter .
While configuring the Adapters in Oracle SOA Suite by default it will take the ANSI format. So the incoming file format should be in ANSI as UTF-8 format .

To check the above case open the error file with Notepad++ and observed the below issue.

And the I opened the success file with Notepad++ i could see the difference in Encoding style  as shown below.

So Guys please be careful about the Encoding style in the files .It will make you MAD in some cases.

Happy Learning - Fun Sharing.

Tuesday, 12 November 2013

Exposing BPEL Service as HTTP service In Oracle SOA 11g

Hi Folks .

Now I am going to explain about BPEL service expose as a HTTP service.

Actually the BPEL service would invoke from SOAP service .It can not accept REST request or HTTP request because it does not contains the SOAP headers etc. So we will go in another approach to expose the BPEL service as a HTTP service to accept the request from HTTP client.

Below are the steps to expose the BPEL service as HTTP service:-

1.Create an empty BPEL process
2.Create the desired schema.

2.Drag n drop a HTTP Binding Adapter into Exposed services.

3.Give service name.

 4.Give interface as "Define from operation and schema(specified later)"

5. Select the options as shown below.

6.Browse the Request Message schema  and Reply Message schema from the Type chooser

7.Once you completed the configuration of HTTP binding you can see the below screen.

8.Drag n drop a BPEL component to Components and select the options like below screen.
   Do not expose as a SOAP service

9.The Composite looks like the below.

10.Drag n drop a Webservice in External References -Give the Concrete WSDL on which BPEL process           you are going to expose as a HTTP service.

11.Finally the composite design is completed.Looks like the below screenshot.

12.Open the BPEL-Add a Invoke activity in between Receive and Reply.

13.Edit Invoke as below.

14.Wire it to Reference web service.

15.Add transformations to Transform the Request and Response message from SOAP  to HTTP vice-versa.

 16.Edit the transformation like below.

 17.Map the corresponding elements to the desired format.

18.Yooo--- The BPEL design is completed successfully.
 19.Finally Deploy it to WebLogic server .Test it from UI or Adavnced REST Client - Its a Google chrome         extension which  allow you to test the Webservice.

Done... Happy learning.-----

Thursday, 7 November 2013

How to start BAM server in Weblogic 11 g

Hi Folks,

Today we will learn how to start BAM server in Weblogic 11g.

When you login into http://localhost:port/em you can see the following screen.

After you start the Admin server from $Oracle_Home/user_projects/domains/soadomain/startWebLogic.cmd (or) startWebLogic.sh -based on your OS running on your machine.

The above screenshot shows you that the BAM server is down .
You can start the BAM server in 2 ways.

Way 1:- If your node manager is up n running then you can start BAM server like below screenshot.

If your node manager is not up n running then you can go for way 2 .

Way 2:-
1.Open CMD.
2.go to C:\Oracle_Home\\user_projects\domains\soa_domain\bin\startManagedWebLogic bam_server1
(This location may vary as per you installation way-Check the location in your machine)
3.Enter Username to boot WebLogic server
4.Enter Password to boot WebLogic server
After this you BAM server starts up.

Instead of entering the username and password every time you can create boot.properties under security folder.
The path would be

If the file or folder doesn't exist you need to create them manually.
The content of the boot.properties file is here.

When you starts the server next time it will take the credentials from boot.properties file then starts.

This procedure will be applicable to all Managed servers and all servers .

Happy Learning Folks.....

Friday, 27 September 2013

Creating a sample Data Source in WeLogic server.

Creating a sample Data Source in WebLogic server.

1 .Log on to weblogic  admin colsole.
2 .Go to Servicesà Data Sources or in main page you can see the Data Source tab under services as shown below.

Click on NEW, select Generic Data Source out of 3 options .
Data Sources description:-
·         Generic Data Sources—Generic data sources and their connection pools provide connection management processes that help keep your system running efficiently.You can set options in the data source to suit your applications and your environment.
·         GridLink Data Sources—An event-based data source that adaptively responds to state changes in an Oracle RAC instance. See Using GridLink Data Sources.
·         Multi data sources—A multi data source is an abstraction around a group of generic data sources that provides load balancing or failover processing.

    Select Database Type is Oracle.

Don’t change anything let it use XA driver, If you need any other driver you can select as per your requirement unless use the default one.

Click Next
Enter DB connection properties

Click “Next” and Click “Test Configuration” you can see the test success result, then only the connection will take the action or else connection may not be created. Click “Next”.

Now a New JDBC data source will be created .Select a server (Admin Server).

Data Source creation done. You can see the data source in the list.

Now you have to create a connection factory for an outbound.
Go to Domain Structure à Deployments à Click on DB Adapter à Configuration à Outbound connection pools. Expand list.

Click “NEW” enter JNDI name that you have to create for outbound connection.
(Note:-Remember you should not use the same JNDI name while creating the data source. Use another JNDI name.
You have to use this JNDI name in DB Adapter configuration while design in JDeveloper.)

Finish. Then go to outbound connection pools that you have created recently .
Go to properties à Go to xADataSourceName  --property Value enter the JNDI name that you have given while creating the data source. Press Enter (Mandatory press enter save button will not work here).
(Note:-Here you have to enter only the JNDI name that you have given while creating the data source then only it will point to the data source.)

Go to deployments, select DB Adapter click on update.
Then the plan.xml file will be updated. Then you will the below success message.

Now you have created a data source successfully.

Remember  when you create a data source use one JNDI name ,this you have to enter in xADataSourceName ,When you are creating the outbound connection in deployments use another JNDI name , this you have to use this JNDI name in design time while DB Adapter configuration in JDeveloper.

Happy Learning.

Thursday, 26 September 2013

How to Create a Simple JMS Queue in Weblogic Server - Configuring JNDI connection for JMS Adapter- JMS Adapter Tutorial Part 1

Hi Guys

Here am going to explain about jms servers, jms modules, connection factory, persistent store, queue &
how to create ..Sample one...

Persistent Store:- It is a physical location for a queue to store its messages.
 There are two types of persistent stores
   1.Database persistent store
   2.File persistent store
JMS Server:-A JMS server acts as a management container for resources within JMS modules. Some of its responsibilities include the maintenance of persistence and state of messages and subscribers. A JMS server is required in order to create a JMS module .
JMS Module:-A JMS module is a definition which contains JMS resources such as queues and topics. A JMS module is required in order to create a JMS queue.
Subdeployment:-JMS modules are targeted to one or more WLS instances or a cluster. Resources within a JMS module, such as queues and topics are also targeted to a JMS server or WLS server instances. A subdeployment is a grouping of targets. It is also known as advanced targeting.
Connection Factory:-A connection factory is a resource that enables JMS clients to create connections to JMS destinations.

JMS Queue:-A JMS queue (as opposed to a JMS topic) is a point-to-point destination type. A message is written to a specific queue or received from a specific queue.
The objects used in this example are:
Object Name
JMS Server
JMS Module
Connection Factory
JMS Queue

1.Configuration of a queue in weblogic console:-
1.1. Create "Persistent Store"
Console -->Services-->Persistent store-->New-->File Store.
1.Go to "Domain structure" and click on Persistent stores under Services.  
2. Click on NEW and select  Create FileStore.  
3. Give FileStore name , Target n Directory click OK.   
4.Persistent store is created.

The following steps are done in the WebLogic Server Console, beginning with the left-hand navigation menu.
1.2 Create a JMS Server
·         Services > Messaging > JMS Servers
·         Select New
·         Name: TestJMSServer
Persistent Store: (none)
·         Target: soa_server1  (or choose an available server)
·         Finish
The JMS server should now be visible in the list with Health OK.
 1.3 Create a JMS Module
·         Services > Messaging > JMS Modules
·         Select New
·         Name: TestJMSModule
Leave the other options empty
·         Targets: soa_server1  (or choose the same one as the JMS server)
Press Next
·         Leave “Would you like to add resources to this JMS system module” unchecked and  press Finish .
1.4 Create a SubDeployment
A subdeployment is not necessary for the JMS queue to work, but it allows you to easily target subcomponents of the JMS module to a single target or group of targets. We will use the subdeployment in this example to target the following connection factory and JMS queue to the JMS server we created earlier.
·         Services > Messaging > JMS Modules
·         Select TestJMSModule
·         Select the Subdeployments  tab and New
·         Subdeployment Name: TestSubdeployment
·         Press Next
·         Here you can select the target(s) for the subdeployment. You can choose either Servers (i.e. WebLogic managed servers, such as the soa_server1) or JMS Servers such as the JMS Server created earlier. As the purpose of our subdeployment in this example is to target a specific JMS server, we will choose the JMS Server option.
Select the TestJMSServer created earlier
·         Press Finish
1.5  Create a Connection Factory
·         Services > Messaging > JMS Modules
·         Select TestJMSModule  and press New
·         Select Connection Factory  and Next
·         Name: TestConnectionFactory
JNDI Name: jms/TestConnectionFactory
Leave the other values at default
·         On the Targets page, select the Advanced Targeting  button and select TestSubdeployment
·         Press Finish
The connection factory should be listed on the following page with TestSubdeployment and TestJMSServer as the target.
1.6 Create a JMS Queue
·         Services > Messaging > JMS Modules
·         Select TestJMSModule  and press New
·         Select Queue and Next
·         Name: TestJMSQueue
JNDI Name: jms/TestJMSQueue
Template: None
Press Next
·         Subdeployments: TestSubdeployment
·         Finish
The TestJMSQueue should be listed on the following page with TestSubdeployment and TestJMSServer.
Confirm the resources for the TestJMSModule. Using the Domain Structure tree, navigate to soa_domain > Services > Messaging > JMS Modules then select TestJMSModule

You should see the following resources

1.7 Create outbound connection for a connection factory:- 

Console --> Deployments -->JmsAdapter-->Configuration-->Outbound connection pool.
click on new and select oracle.tip.adapter.jms.IJmsConnectionFactory
Give JNDI Name , click on e Finish.
Go to the newlay created  Outbound connection properties and enter the JMS Module --Connection factory JNDI in the ConnectionFactoryLocation hit Enter Save.

Goto Deployements and select jmsadapter ear and update the plan file.

The JMS queue is now complete and can be accessed using the JNDI names
jms/TestConnectionFactory and
WoW..Done ..Now you are familiar with JMS servers, Modules, connection factory, queue(topic same as queue)
Happy Learning..........!!!!