Friday, 30 September 2016

SOA11g Q&A

1. Setting syncMaxWaitTime:
This property controls the maximum time the process result receiver will wait for a result before returning for Sync processes.
For SOA 11g R1 PS1 (11.1.1.1.0 to 11.1.1.5):
* Login into EM
* Expand SOA and right click on "soa-infra" and select: SOA Administration -> BPEL Properties
* Click on "More BPEL Configuration Properties..." link
* Locate syncMaxWaitTime and change it.


-- Alternative Method -- For SOA 11g R1 (11.1.1.1.0) ONLY:
* Take backup of bpel-config.xml, located at: /user_projects/domains//config/soa-infra/configuration/.
* Open the bpel-config.xml file.
* Edit the value for the syncMaxWaitTime property.
* Save the changes.
* Restart Oracle WebLogic Server.

Note: Since 11.1.1.2, bpel-config.xml is no longer available into the file system and therefore the only chance for modification is through EM Console.
2. Setting the transaction timeout for BPEL EJBs:
The timeout properties for the EJBs control the particular timeout setting for the SOA application, overriding the global setting specified by the JTA timeout (See step 3).
Note: Prior implement next steps, ensure to shutdown SOA managed server. Otherwise you will get errors, see following document for details Note 1271369.1
* Log into Oracle WebLogic Administration Console.
* Click Deployments.
* Expand soa-infra -> EJBs.
* Following EJBs need to be updated:
BPELActivityManagerBean
BPELDeliveryBean
BPELDispatcherBean
BPELEngineBean
BPELFinderBean
BPELInstanceManagerBean
BPELProcessManagerBean
BPELSensorValuesBean
BPELServerManagerBean
* You can change the parameter in the Configuration tab for the Transaction Timeout setting.
* Click Save.
* Save the Plan.xml to some known location
* Start SOA Managed Server
3. Setting the global transaction timeout at Weblogic Domain Level:
This property controls the transaction timeout seconds for active transactions. If the transaction is still in the "active" state after this time, it is automatically rolled back.
   * Log into Oracle WebLogic Administration Console.
   * Click Services -> JTA.
   * Change the value of Timeout Seconds (the default is 30).
   * Click Save.
   * Restart Oracle WebLogic Server.
How to Check Fusion Middleware and WebLogic Component Versions
Applies to:
Oracle Fusion Middleware - Version: 11.1.1.1.0 to 11.1.1.5.0 - Release: to Oracle11g
Information in this document applies to any platform.
Goal
This document describes how to determine the versions of installed Fusion Middleware Components and Weblogic Server.

Note:
Fusion Middleware components including WebLogic Server, RCU, and components such as SOA, Identity Management, Portal-Forms-Reports-Discover, and JDeveloper must have concordant versions. This affects configuration, but not installation, and can cause a variety of failures, including ClassDefNotFound exceptions when trying to configure a new domain or managed server.
1. To determine the WebLogic Server version. There are several ways to confirm the version:
 Enter this command with the weblogic environment enabled:
$ java weblogic.version
Look in the file Middleware Home/registry.xml, and note the component tag
The exact WLS version can be checked using the following commands:
On Unix:
cat $MW_HOME/wlserver_10.3/.product.properties | grep WLS_PRODUCT_VERSION
On Windows:
type %MW_HOME%\wlserver_10.3\.product.properties | findstr WLS_PRODUCT_VERSION
Use SmartUpdate to check the Product Version:
On Unix:
$MW_HOME/utils/bsu/bsu.sh -view -status=applied -prod_dir=$MW_HOME/wlserver_10.3 | grep ProductVersion
On Windows:
%MW_HOME%\utils\bsu\bsu.sh -view -status=applied -prod_dir=$MW_HOME\wlserver_10.3 | findstr ProductVersion
You should see a result such as this:
ProductVersion: 10.3 MP5
2. For JDeveloper, look in the Middleware Home/registry.xml file for the following:
3. For Fusion Middleware products, use the command Oracle Home/Opatch/opatch lsinventory and note the output:
Installed Top-level Products (2):
Application Server 11g SOA Patchset 11.1.1.3.0
Oracle SOA Suite 11g 11.1.1.2.0
There are 2 products installed in this Oracle Home.
4. For the MDS version, look in the file RCU Home/rcu/log/logdir./mds.log:
REPOS_VERSION CONSTANT VARCHAR2(32) := '11.1.1.56.27' (this is for 11.1.1.3)
To get the schema version from the database, login to the database as sysdba and enter the command as shown (example here for 11.1.1.3):
SQL> select comp_id, comp_name, version from schema_version_registry;
COMP_ID
------------------------------
COMP_NAME
--------------------------------------------------------------------------------
VERSION
------------------------------
IAU
Audit Service
11.1.1.3.0
MDS
Metadata Services
11.1.1.2.0

OID
Oracle Internet Directory
11.1.1.3.0
OIF
Oracle Identity Federation Database Schema
11.1.1.2.0
ORAESS
Enterprise Scheduler Service
11.1.1.2.0
ORASDPLS
SIP Infrastructure Location Service
11.1.1.2.0
ORASDPSDS
SIP Infrastructure Subscriber Data Service
11.1.1.2.0
ORASDPXDMS
Presence
11.1.1.2.0
8 rows selected.
You can also get the schema prefix from the database using the following command:
SQL> select username, created from dba_users order by 2;
USERNAME CREATED
------------------------------ ---------
OE 12-MAY-10
SH 12-MAY-10
BI 12-MAY-10
PM 12-MAY-10
TEST01_MDS 21-JAN-11
TEST01_IAU 21-JAN-11
TEST01_IAU_APPEND 21-JAN-11
TEST01_IAU_VIEWER 21-JAN-11
TEST01_ORAESS 21-JAN-11
ODS 21-JAN-11
ODSSM 21-JAN-11

USERNAME CREATED
------------------------------ ---------
TEST01_OIF 21-JAN-11
TEST01_ORASDPXDMS 21-JAN-11
TEST01_ORASDPLS 21-JAN-11
TEST01_ORASDPSDS 21-JAN-11
Understanding Out of Memory (OOM) in Weblogic
As Fusion or Weblogic  Admin one is supposed to encounter Out of Memory (OOM )issues now and then. Why talk about Fusion or Weblogic admins this issue can be encountered on multiple products like the Oracle Applications EBS, Hyperion, OTM, Oracle Application server and many other products .What seems common across all these products is the use of Application server.  All the above mentioned products use some or the other application server over which the applications are deployed.

For example the latest Oracle SOA Suite 11g uses Weblogic 10.3 Application Server while EBS Release 12 uses Oracle Application Server 10g. The point I am trying to make is the Out of Memory issue is not product specific but is related to Application Servers running Oracle-Sun JVMs. Application servers like Oracle Weblogic, IBM Websphere and Oracle Application Server facilitate running Java Virtual Machines on which the Java Applications can be deployed and executed. Out of memory issue is related to filled up space issues in these JVMs which makes it generic across all the above mentioned application servers.
Before understanding OOM let’s first understand the memory used by the JVM. The Java Virtual Machine (JVM) has the following types of memory:
 Heap memory is the runtime data area from which memory for all class instances and arrays is allocated
Non-heap memory includes the method area and memory required for the internal processing or optimization of the JVM. It stores per-class structures such as a runtime constant pool, field and method data, and the code for methods and constructors.
Native memory is the virtual memory managed by the operating system.
When the above mentioned memory is insufficient for a deployed application, a java.lang.OutOfMemoryError is thrown. There will be different error messages for OutOfMemoryErrors in each type of memory. They are listed below:
-          Heap memory error. When an application creates a new object but the heap does not have sufficient space and cannot be expanded further, an OutOfMemoryError will be thrown with the following error message:
java.lang.OutOfMemoryError: Java heap space
-          Non-heap memory error:When the permanent generation is full, the application will fail to load a class or to allocate an interned string, and an OutOfMemoryError will be thrown with the following error message:
java.lang.OutOfMemoryError: PermGen space

-          Native memory error: The Java Native Interface (JNI) code or the native library of an application and the JVM implementation allocate memory from the native heap. An OutOfMemoryError will be thrown when an allocation in the native heap fails. For example, the following error message indicates insufficient swap space, which could be caused by a configuration issue in the operating system or by another process in the system that is consuming much of the memory:
java.lang.OutOfMemoryError: request bytes for .
Out of swap space?
After having understood the OOM issue the question is why would the code encounter an OOM at all. This could be for more than one reason.
An insufficient memory problem could be due
1.       Either to a problem with the configuration ie the application really needs that much memory
2.       Or to a performance problem in the application that requires you to profile and optimize to reduce the memory use. Configuring memory settings and profiling an application to reduce the memory use are beyond the scope of this post and I would cover them in my forth coming posts.
The issues are mentioned below:
a.       Memory Leaks
The JVM is responsible for automatic memory management, which reclaims the unused memory for the application. However, if an application keeps a reference to an object that it no longer needs, the object cannot be garbage collected and will occupy space in the heap until the object is removed. Such unintentional object retention is referred to as a memory leak. If the application leaks large amounts of memory, it will eventually run out of memory, and an OutOfMemoryError will be thrown. In addition, garbage collection may take place more frequently as the application attempts to free up space, thus causing the application to slow down.

b.      Finalizers
Another possible cause of an OutOfMemoryError is the excessive use of finalizers. The java.lang.Object class has a protected method called finalize. A class can override this finalize method to dispose of system resources or to perform cleanup before an object of that class is reclaimed by garbage collection. The finalize method that can be invoked for an object is called a finalizer of that object. There is no guarantee when a finalizer will be run or that it will be run at all. An object that has a finalizer will not be garbage collected until its finalizer is run. Thus, objects that are pending for finalization will retain memory even though the objects are no longer referenced by the application, and this could lead to a problem similar to a memory leak.
c.       Deadlocks
A deadlock occurs when two or more threads are each waiting for another to release a lock. The Java programming language uses monitors to synchronize threads. Each object is associated with a monitor, which can also be referred as an object monitor. If a thread invokes a synchronized method on an object, that object is locked. Another thread invoking a synchronized method on the same object will block until the lock is released. Besides the built-in synchronization support, the java.util.concurrent.locks package that was introduced in J2SE 5.0 provides a framework for locking and waiting for conditions. Deadlocks can involve object monitors as well as java.util.concurrent locks.
Typically, a deadlock causes the application or part of the application to become unresponsive. For example, if a thread responsible for the graphical user interface (GUI) update is deadlocked, the GUI application freezes and does not respond to any user action.
d.      Looping Threads
Looping threads can also cause an application to hang. When one or more threads are executing in an  infinite loop, that loop may consume all available CPU cycles and cause the rest of the application to be unresponsive.
e.      High Lock Contention
Synchronization is heavily used in multithreaded applications to ensure mutually exclusive access to a shared resource or to coordinate and complete tasks among multiple threads. For example, an application uses an object monitor to synchronize updates on a data structure. When two threads attempt to update the data structure at the same time, only one thread is able to acquire the object monitor and proceed to update the data structure. Meanwhile, the other thread blocks as it waits to enter the synchronized block until the first thread finishes its update and releases the object monitor. Contended synchronization impacts application performance and scalability.
Hope the above article helps you to understand the basics of OOM issues in Application Servers. OOM issues could be a night mare for any admin given the cause is memory leak. But we will discuss methods to resolve such scenarios soon. Also I plan to post on ways to alter JVM settings on Weblogic server.
 Below are URLs to guides/documents that has been used by me for compilation of above article:
Monitoring and Managing Java SE 6 Platform Applications (http://java.sun.com/developer/technicalArticles/J2SE/monitoring/)
Oracle SOA Interview Questions and Answers
1. Explain about Web service?
Web service is type of software system which is used for exchange the data and use information from one machine to another machine through network. Generally Web services based on the standards such as TCP/IP, HTTP, Java, HTML and XML.
Web services are pure xml based which is used for exchange information through Internet to direct application to application interaction. These systems include programs, objects, messages or documents.
Many software applications written in various programming languages and running on various platforms can use web services to exchange data over computer network.

You can develop Java-based web services on Solaris and that is accessible from your V.B Program that runs on windows.
2. Difference Between Oracle SOA 10g and Oracle SOA 11g ?
There are so many changes in oracle soa 11g when compared to oracle soa 10g in business and technically and some new functionality added
In Oracle SOA 11g contains Service Component Architecture where as Oracle SOA 10g having no Service Component Architecture.
ORACLE SOA Suite 10g is based on Oracle AS 10g
It uses Oracle Application Server 10.1.x
OC4J
Sun JVM
Repository tool irca to create the SOA 10g repository
Managed with Application Server Console
Oralce SOA Suite 11g is based on Oracle FMW 11g
It uses the Oracle Weblogic server 10gR3
Sun or JRockit JVM
Repository Creation Utility ( RCU ) to create or delete the SOA 11g repository
Weblogic server console used for managing.
Oracle SOA 11g  all the SOA Components of Project deployed into into Single Server where as 10g each component is deployed into particular server.
In SOA 10g having ESB Console, BPEL Console, Application Server Control these are all individual and not well integrated.
In SOA 11g Provides service monitoring across all SOA Components Such as ESB, BPEL, Human Workflow
SOA suite 11g has the Enterprise Management Console the em console is used for Manage SOA Suite Services, Manage SOA Suite Deployment, Review Logs and Exceptions.
SOA Suite 11g Components
Oracle Adapters
Oracle Mediator
Business Events and Events Delivery Network
Oracle Business Rules
Human Workflow
Oracle Business Activity Monitoring
Oracle Enterprise Manager
Question: Can we set audit level at BPEL level?
Answer: Yes, we can use bpel.config.auditLevel property inside composite.xml file for BPEL process service component to set audit level for BPEL. This property takes precedence over audit level settings at the SOA Infrastructure, service engine, and SOA composite application levels.
Off

1) SOA 11g and SOA 12c: How to configure transaction timeouts for BPEL (Doc ID 880313.1)            To BottomTo Bottom       

In this Document
Goal
Solution
References
APPLIES TO:
Oracle SOA Suite - Version 11.1.1.1.0 to 12.1.3.0.0 [Release 11gR1 to 12c]
Information in this document applies to any platform.
***Checked for relevance on 09-August-2013***
GOAL
During runtime you may be seeing errors in the log similar to the following:
The transaction was rolled back
and / or
java.lang.IllegalStateException: Cannot call setRollbackOnly() current thread is NOT associated with a transaction
and / or
Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out
The solution is typically to increase the transaction timeout for the process. 
How do you configure the transaction timeout for BPEL on SOA 11g and SOA 12c?
SOLUTION
General Considerations:
The EJB Transaction time out should be greater than SyncMaxWaitTime and it can also be larger than the JTA Transaction Time out. This because EJB Transaction Timeout overrides the JTA Transaction Time Out.
SyncMaxWaitTime < EJB > JTA Transaction Time out
SyncMaxWaitTime should always come under the range of the EJB transaction time out else it will get interrupted with EJB Transaction time out once Transaction time > EJB Transaction Time out.
The JTA Transaction Timeout affects the user transaction only (javax.transaction.UserTransaction) which will always be less than the BPEL Process
Note: This recommendation is ONLY applicable to Sync Processes.  Additionally the default timeout setting that comes with the SOA 11g installation does not comply with this rule. You might need to adjust the settings according to your particular business needs.
1. Setting syncMaxWaitTime:
The SyncMaxWaitTime property applies to durable processes that are called in an asynchronous manner.
When the client (or another BPEL process) calls the BPEL process which has durable activity(ex : wait), the wait (breakpoint) activity is executed. However, since the wait is processed after some time by an asynchronous thread in the background, the executing thread returns to the client side. The client (actually the delivery service) tries to pick up the reply message, but it is not there since the reply activity in the process has not yet executed. Therefore, the client thread waits for the SyncMaxWaitTime seconds value. If this time is exceeded, then the client thread returns to the caller with a timeout exception.If the wait is less than the SyncMaxWaitTime value, the asynchronous background thread then resumes at the wait and executes the reply. The reply is placed in the HashMap and the waiter (the client thread) is notified. The client thread picks up the reply message and returns.
Therefore, SyncMaxWaitTime only applies to synchronous process invocations when the process has a breakpoint in the middle. If there is no breakpoint, the entire process is executed by the client thread and returns the reply message.
For SOA 11g R1 PS1 (11.1.1.1.0 and later) and 12c:
* Login into EM
* Expand SOA and right click on "soa-infra" and select: SOA Administration -> BPEL Properties
* Click on "More BPEL Configuration Properties..." link
* Locate syncMaxWaitTime and change it.
-- Alternative Method -- For SOA 11g R1 (11.1.1.1.0) ONLY:
* Take backup of bpel-config.xml, located at: /user_projects/domains//config/soa-infra/configuration/.
* Open the bpel-config.xml file.
* Edit the value for the syncMaxWaitTime property.
* Save the changes.
* Restart Oracle WebLogic Server.
Note: Since 11.1.1.2, bpel-config.xml is no longer available into the file system and therefore the only chance for modification is through EM Console.
2. Setting the transaction timeout for BPEL EJBs:
The timeout properties for the EJBs control the particular timeout setting for the SOA application, overriding the global setting specified by the JTA timeout (See step 3).
Notes: Whenever we use EJB Container Managed Transactions with JTA, the EJB Transaction Timeout overrides the JTA Transaction Time Out.
Internally EJB uses JTA(Java Transaction API)
Enterprise beans that use container-managed transaction demarcation also must not use the javax.transaction.UserTransaction interface
Note: Prior implement next steps, ensure to shutdown SOA managed server. Otherwise you will get errors, see following document for details Note 1271369.1
* Log into Oracle WebLogic Administration Console.
* Click Deployments.
* Expand soa-infra -> EJBs.
* Following EJBs need to be updated:
BPELActivityManagerBean
BPELAuditTrailBean
BPELDeliveryBean
BPELDispatcherBean
BPELEngineBean
BPELFinderBean
BPELInstanceManagerBean
BPELProcessManagerBean
BPELSensorValuesBean
BPELServerManagerBean
CompositeMetaDataServiceBean
* You can change the parameter in the Configuration tab for the Transaction Timeout setting.
* Click Save.
* Save the Plan.xml to some known location - Ensure no other file is named Plan.xml -.
* Update soa-infra deployment.
* Start SOA Managed Server.
3. Setting the global transaction timeout at Weblogic Domain Level:

This property controls the transaction timeout seconds for active transactions. If the transaction is still in the "active" state after this time, it is automatically rolled back.
   * Log into Oracle WebLogic Administration Console.
   * Click Services -> JTA.
   * Change the value of Timeout Seconds (the default is 30).
   * Click Save.
   * Restart Oracle WebLogic Server.

More information available at:
 For Weblogic 12c:
4) "weblogic.application.ModuleException: Cannot convert value" error when saving changes to SOAINFRA (BPEL) Beans while SOA server is running (Doc ID 1271369.1)         To BottomTo Bottom 
In this Document
Symptoms
            Steps to re-produce the issue:
Cause
Solution
            Workaround:
References
APPLIES TO:
Oracle SOA Suite - Version 11.1.1.1.0 and later
Information in this document applies to any platform.
***Checked for relevance on 09-May-2012***
SYMPTOMS
When attempting to make changes to soa-infra (BPEL) EJBs while the SOA server is running and try to activate the changes in the WebLogic console you see the following error:
An error occurred during activation of changes, please see the log for details.
weblogic.application.ModuleException:
Cannot convert value of type [$Proxy196 implementing oracle.bpel.services.workflow.verification.IVerificationService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [oracle.bpel.services.workflow.verification.IVerificationService] for property 'verificationService': no matching editors or conversion strategy found"
Steps to re-produce the issue:
Log in to the WebLogic console http://host:port/console.
Click "Deployments".
Expand "soa-infra"
Click "BPELDeliveryBean" (You can actually change any BPEL EJB to reproduce this issue).
Click on the "Configuration" tab.
For this test case you modify "Transaction Timeout", but this is more likely to happen when you make changes to other properties too.
Click "Save".
Activate Changes.
Once you try to activate the changes you will notice the above mentioned error.
You might also see the following error in the soa_server1-diagnostic.log:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bpmUserAuthenticationServiceImplementation' defined in URL [zip:/soa/modules/oracle.bpm.runtime_11.1.1/oracle.bpm.bpm-services.implementation.jar!/oracle/bpm/services/config/spring-applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy196 implementing oracle.bpel.services.workflow.verification.IVerificationService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [oracle.bpel.services.workflow.verification.IVerificationService] for property 'verificationService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy196 implementing oracle.bpel.services.workflow.verification.IVerificationService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [oracle.bpel.services.workflow.verification.IVerificationService] for property 'verificationService': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 55 more
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy196 implementing oracle.bpel.services.workflow.verification.IVerificationService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [oracle.bpel.services.workflow.verification.IVerificationService] for property 'verificationService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy196 implementing oracle.bpel.services.workflow.verification.IVerificationService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [oracle.bpel.services.workflow.verification.IVerificationService] for property 'verificationService': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 64 more
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy196 implementing oracle.bpel.services.workflow.verification.IVerificationService,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [oracle.bpel.services.workflow.verification.IVerificationService] for property 'verificationService': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 68 more
CAUSE
The cause of this issue is due to an unpublished Bug 9579877 .
Due to the complexity of the fix, a workaround is available. The development team has proposed to fix the issue in a future release.
SOLUTION
As specified above, the issue is planned to be fixed in future releases. Until then the following workaround can be used.
Workaround:
Stop the SOA (soa_server1) Server from the Weblogic console.
Update the required EJBs and activate the changes.

Start the SOA (soa_server1) Server.


weblogic.transaction.internal.TimedOutException:Transaction timed out after 301 seconds – Oracle SOA Suite 11g

weblogic.transaction.internal.TimedOutException:Transaction timed out after 301 seconds – Oracle SOA Suite 11g:

Frequently the Oracle  BPEL instances are getting rolled back with the following exception.
 The root cause of the issue is, JTA transaction getting timeout before completing the execution of the BPEL instance; the JTA transaction should be active to complete the execution successfully.


[2012-04-26T05:15:45.139+00:00] [SOA1] [ERROR] [] [oracle.soa.bpel.engine] [tid: orabpel.invoke.pool-4.thread-23] [userId: ] [ecid: 0000JRh3heOAxGoqwSuXMG1F_qb^000aP5,0:1:100080683] [APP: soa-infra] [composite_name: AM_Invoker] [component_name: AM_Invoker] [component_instance_id: 5977508] The reason was The execution of this instance "5977508" for process "AM_Invoker" is supposed to be in an active jta transaction, the current transaction status is "MARKED_ROLLBACK" . Root cause: null

 [APP: soa-infra] Error while invoking bean "cube delivery": JTA transaction is not in active state.[[
The transaction became inactive when executing activity "5977508-BpInv1-BpSeq9.78-2" for instance "5,977,508", bpel engine cannot proceed further without an active transaction. please debug the invoked subsystem on why the transaction is not in active status. the transaction status is "MARKED_ROLLBACK".

Message handle error.error while attempting to process the message "com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessage"; the reported exception is: Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out after 301 seconds
BEA1-2980B7B48F411EE46991

Solution:

Increase the JTA time out and the BPEL EJB transaction timeout.

Change the JTA transaction timeout:
  1. Log in to Oracle WebLogic Server Administration Console.
  2. In the Domain Structure, select Services > JTA
  3. Increase the JTA transaction timeout value to some higher value like 3600

Change the BPEL EJB transaction timeout settings:

  1. Log in to Oracle WebLogic Server Administration Console.
  2. In the Domain Structure, click Deployments.
  3. Expand soa-infra > EJBs.
  4. Update the following EJBs transaction Timeout value to some higher value like 1200:
            BPELActivityManagerBean
                        BPELEngineBean
                        BPELInstanceManagerBean
            BPELProcessManagerBean
                        BPELServerManagerBean
  1. Click Save.
  2. Restart Oracle WebLogic Server.
There is no standard value for transaction timeout property. We need to trail out and set the value.
If the component still fails with the transaction timeout error then revisit the component design and tune the same.


How to enable SSL debug tracing in Weblogic Server?

Add the following start up options to the start up file startWebLogic.cmd/startWebLogic.sh or startManagedWebLogic.cmd/startManagedWebLogic.sh based on which file is used to start the server to enable SSL debug tracing in Weblogic Server.

JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.debug.DebugSecuritySSL=true -Dweblogic.debug.DebugSSL=true -Dweblogic.StdoutDebugEnabled=true -Dweblogic.log.StdoutSeverityLevel=Debug -Dweblogic.log.LogSeverity=Debug"

Setting the JDBC Connection timeout properties in weblogic server through WLST

There are different timeout properties in JDBC connection, this post explain the approach to set some of the important JDBC Connection timeout properties in weblogic server through WLST script.

Inactive Connection Timeout:
The number of inactive seconds on a reserved connection before WebLogic Server reclaims the connection and releases it back into the connection pool.
You can use the Inactive Connection Timeout feature to reclaim leaked connections - connections that were not explicitly closed by the application.

Connection Reserve Timeout:
The number of seconds after which a call to reserve a connection from the connection pool will timeout.
When set to 0, a call will never timeout.
When set to -1, a call will timeout immediately.

Statement Timeout:
The time after which a statement currently being executed will time out.
A value of -1 disables this feature.
A value of 0 means that statements will not time out.

oracle.jdbc.ReadTimeout:
The property oracle.jdbc.ReadTimeout helps to set read timeout while reading from the socket. 
oracle.net.READ_TIMEOUT for jdbc versions < 10.1.0.5 oracle.jdbc.ReadTimeout for jdbc versions >=10.1.0.5

oracle.net.CONNECT_TIMEOUT:
The property oracle.net.CONNECT_TIMEOUT helps to set the login time out in Oracle.

SetJDBCTimeoutProperties.py
def setJDBCTimeoutProperties():
   dsName='CRM6EAIReference'
   edit()
   startEdit()
       
   server='AdminServer'
   cd("Servers/"+server)
   target=cmo
 
   print '========================================='
   print 'Setting the timeout properties for DataSource....'
   print '========================================='  
           
   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName)
   #cmo.destroyProperty(getMBean('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/oracle.net.CONNECT_TIMEOUT'))
   cmo.createProperty('oracle.net.CONNECT_TIMEOUT')

   #cmo.destroyProperty(getMBean('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/oracle.jdbc.ReadTimeout'))
   cmo.createProperty('oracle.jdbc.ReadTimeout')

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/oracle.net.CONNECT_TIMEOUT')
   cmo.setValue('10000')

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCDriverParams/'+dsName+'/Properties/'+dsName+'/Properties/oracle.jdbc.ReadTimeout')
   cmo.setValue('20000')

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCConnectionPoolParams/'+dsName)
   cmo.setInactiveConnectionTimeoutSeconds(120)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCConnectionPoolParams/'+dsName)
   cmo.setConnectionReserveTimeoutSeconds(30)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCConnectionPoolParams/'+dsName)
   cmo.setStatementTimeout(120)

   save()
   activate()

   print 'Timeout settings for the datasource '+dsName+' has been completed'
 
 
def main():
     
    adminURL='t3://localhost:8000'
    adminUserName='weblogic'
    adminPassword='welcome1'
    connect(adminUserName, adminPassword, adminURL)
    setJDBCTimeoutProperties()
    disconnect()

     

main()

Execute the script:
cd %WLS_HOME%\common\bin
wlst.sh SetJDBCTimeoutProperties.py

Restart the server after successful execution.



Tuesday, April 29, 2014

Setting the XA Transaction timeout values for a datasource in weblogic server through WLST script

This post explain the approach to set some of the important timeout properties for XA datasources in weblogic server through WLST script.

Set XA Transaction Timeout:
Enables WebLogic Server to set a transaction branch timeout based on the value for XaTransactionTimeout.

When enabled, the WebLogic Server Transaction Manager calls XAResource.setTransactionTimeout() before calling XAResource.start, and passes either the XA Transaction Timeout value or the global transaction timeout.

XA Transaction Timeout:
The number of seconds to set as the transaction branch timeout.
If set, this value is passed as the transaction timeout value in the XAResource.setTransactionTimeout() call on the XA resource manager, typically the JDBC driver.

When this value is set to 0, the WebLogic Server Transaction Manager passes the global WebLogic Server transaction timeout in seconds in the method.

If set, this value should be greater than or equal to the global WebLogic Server transaction timeout.

XA Retry Duration:
Determines the duration in seconds for which the transaction manager will perform recover operations on the resource. A value of zero indicates that no retries will be performed.

XA Retry Interval:

The number of seconds between XA retry operations if XARetryDurationSeconds is set to a positive value.

SetXATimeoutProperties.py

def setXATimeoutProperties():
   dsName='SOADataSource'
   edit()
   startEdit()
       
   server='AdminServer'
   cd("Servers/"+server)
   target=cmo
 
   print '========================================='
   print 'Setting the timeout properties for DataSource....'
   print '========================================='  
           
   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCXAParams/'+dsName)
   cmo.setXaSetTransactionTimeout(true)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCXAParams/'+dsName)
   cmo.setXaTransactionTimeout(3000)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCXAParams/'+dsName)
   cmo.setXaRetryDurationSeconds(300)

   cd('/JDBCSystemResources/'+dsName+'/JDBCResource/'+dsName+'/JDBCXAParams/'+dsName)
   cmo.setXaRetryIntervalSeconds(60)

   save()
   activate()

   print 'Timeout settings for the datasource '+dsName+' has been completed'
 
 
def main():
     
    adminURL='t3://10.30.34.216:8000'
    adminUserName='weblogic'
    adminPassword='reuters123'
    connect(adminUserName, adminPassword, adminURL)
    setXATimeoutProperties()
    disconnect()

     

main()

Execute the script:
cd %WLS_HOME%\common\bin
wlst.sh SetJDBCTimeoutProperties.py

Restart the server after successful execution.

Weblogic Managed server status struck in STARTING

We faced the issue while starting the weblogic managed server, the status of the server struck in STARTING.

W could not able to find a valid error messages in the log files

Managed Server Log File:

<30-oct-2013 11:13:29="" clock="" gmt="" o="">  

No logs are getting printed after this.

Node Manager Log File:
<30-oct-2013 11:09:44="">
<30-oct-2013 11:09:44="">
java.io.IOException: Server failed to start up. See server output log for more details.
      at weblogic.nodemanager.server.AbstractServerManager.start(AbstractServerManager.java:200)
      at weblogic.nodemanager.server.ServerManager.start(ServerManager.java:23)
      at weblogic.nodemanager.server.Handler.handleStart(Handler.java:604)
      at weblogic.nodemanager.server.Handler.handleCommand(Handler.java:121)
      at weblogic.nodemanager.server.Handler.run(Handler.java:71)

      at java.lang.Thread.run(Thread.java:662)

The root cause of this issue is somehow the ldap directory of the server got corrupted.

To resolve this issue:
  •  Kill the managed server 
  •  Remove the ldap folder from the following location  <>/servers/<>, this file will be auto generated while restarting the server.

  • Restart the server

Saturday, April 26, 2014

A timeout occurred while interacting with sever. Limited information is available - Weblogic

 

 We were getting the error "A timeout occurred while interacting with Server. Limited information is available" while accessing the Server Page from the admin console in clustered weblogic environment and the health of the server is shown as empty but the state is shown as running.
Login to the admin console and accessing the Server page also was taking more time
But the individual servers and the node managers are running fine in all the nodes.

The issue seems to be because of the delay in the communication between the node manager and the managed servers.

To Resolve the issue:
  • Stop all the managed servers from all the nodes.
  • Kill the node managers from all the nodes.
  • Stop the Admin server.
  • Start the node manager in all the nodes.
  • Start the Admin server.
  • Start all the managed server.

Login to admin console and verify the servers,  now the state and the health of the server will be displayed properly

SOA-INFRA app is not starting up - Oracle SOA Suite 11g

SOA-INFRA app is not starting up - Oracle SOA Suite 11g:

When we restarted the soa server, the soa server came up properly except the SOA-INFRA app.

The status of the SOA-INFRA app in weblogic console is failed and also the SOA node in the em console is not displayed.


We could not able to find any particular error from log files including diagnostic log except schema mismatch error with some of the composites.It  seems due to some reason the status of the soa-infra application is failed and the server is restarted without fixing the actual issue then even after fixing the issue and restarting the server the soa-infra app is not Active.


We have tried deleting the following folders from 
$DOMAIN_HOME/servers/AdminServer
data
temp 
cache 

unfortunately even after deleting the above folders the SOA-INFRA app did not come up. 

Tried starting the SOA-INFRA app manually from weblogic console, this time the SOA-INFRA app came up and we could able to see the SOA in em console.



ResourceLimitException : No resources currently available in pool to allocate to applications – Oracle SOA 11g

You could have observed the below exception frequently in the weblogic server log file, weblogic server throws the below exception when there is not enough database connections in the pool to serve the incoming requests reporting increasing the connection pool count. This will affect the overall system  performance

java.sql.SQLException: Internal error: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool SOADataSource to allocate to applications, please increase the size of the pool and retry..
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResourceInternal(ResourcePoolImpl.java:577)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:342)
at weblogic.common.resourcepool.ResourcePoolImpl.reserveResource(ResourcePoolImpl.java:329)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:417)
at weblogic.jdbc.common.internal.ConnectionPool.reserve(ConnectionPool.java:324)


The above exception is due to there is not enough connections available in the pool to service the requests.
To identify which datasource / connection pool requires more connection do the following.
  • Go to Weblogic Admin console
  • Go to Environment -> Servers
  • Select the server on which the connection pool needs to be monitored
  • Go to Monitoring -> JDBC
  • Customize the table to add the below two properties
This page will list all the datasources/ connection pools targeted to that particular server and how many connections are waiting to get the connection. If more number of connections are waiting, that is not a good which will cause performance impact and also cause stuck threads on the server if the wait time is going to be beyond the thread stuck time (By default it's 10 mins).

(This screen shot taken by reducing the max capacity to 5 for blogging purpose, unfortunately I did not captured the actual screen shot)
Above screenshot shows SOADataSource state is "Overloaded" and also the current wait is 19. There are 19 resources waiting for connection . The above setup is definitely a problem which will result database calls performance issue.

If the connection pool count is not increased with respect to the invoker thread count, then it will cause this kind of contention cause lot of calls to be waiting for connection.

Solution to the above problem is to increase the number of connections in the connection pool.

Steps:
  • Go to WLS Console
  • Select Services -> Datasources -> select the datasource you want to change the pool size
  • Go to Configuration -> connection pool
  • Change the Maximum Capacity to the count which is required for your environment.


Monday, January 30, 2012

Oracle SOA Suite 11g - Changing the service endpoint URL dynamically through EM console

Sometimes we may need to change the default endpoint location of the Oracle SOA Suite composite service through the EM console.
The below steps help us to change the endpoint URL’s of the references through the EM console.
  • In EM console click on the Composite
  • Scroll down to Service and References section

  • Click on Reference link and properties tab
  • Change Endpoint Address to the desired location and click apply

The new request will be send to the new endpoint location configured through the EM console.
The new endpoint configuration can be removed to send the request to the default endpoint location configured in the WSDL.

Webservice invocation failed, Unable to access the following endpoint(s) – Oracle SOA Suite 11g


Webservice invocation failed, Unable to access the following endpoint(s) – Oracle SOA Suite 11g:

Some of the time we used to receive the following exception while invoking the webservice endpoints in Oracle SOA 11g. There could be a multiple reason behind this exception.

This blog explains the different ways to narrow down the issue and to fix the issue.

An exception occured while invoking the webservice operation. Please see logs for more details.
oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Unable to access the following endpoint(s): http://hostname:50000/XISOAPAdapter/MessageServlet?channel=:SalesForce:CC_Out_Soap_SFDC_order

Steps:-   

Ping the host name: 
    • If the host is alive then the connectivity looks fine

    •  If we received Unknown host error then verify whether the host entry is available in the server host  file for the host.


    •   If the host is configured to lookup by DNS server then verify the DNS server configuration.

Telnet to the server with the corresponding port:
    • If the telnet is success then the connectivity looks fine.
    •  If the telnet is failed then check the network connectivity between the server and the webservice host in that particular port

Check the webservice status:
    • If the network connectivity between the two servers are looks fine then check whether the webservice is up and running.
    • Some cases the status of the service in the target system shows as up and running but due to some internal errors with the service the source system may not able to connect to the target service . For e.g. sometime the client will not be able to connect to the Siebel services due to some internal table locking but the status of the service will be shown as up and running in Siebel system. 
Check the webservice authentication configured properly:
    • If the webservice up and running properly then check whether the service is protected with username/password. If the service is protected with username/password then check the username/password configuration in the composite.xml file. 
                    You will be receiving the same exception if the username/password is not configured properly.

Sometimes we used to get the exception in the em console

oracle.fabric.common.FabricInvocationException: Unable to access the following endpoint(s): https://sap.int.com/XISOAPAdapter/MessageServlet?channel=*:Markets_Siebel_QA:CC_Out_Soap_SalesOrder

But the actual exception in the server log

Caused By: javax.xml.ws.WebServiceException: javax.xml.soap.SOAPException: javax.xml.soap.SOAPException: Message send failed: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target


Verify the certificate installed properly in the server and also the certificate not expired.

Modifying the DVM’s and Business Rules using SOA Composer


Oracle SOA Suite Composer is a J2EE application deployed into the weblogic server that help us to edit the DVM’s and the Business Rules after the deployment  to the Oracle SOA Suite server during the runtime.

The SOA Composer application can be accessed using the following URL
http:// Server Host>:/soa/composer/

To modify the DVM’s or the Business Rules the weblogic user must have the SOADesigner role.

When using Oracle SOA Composer, you can save your customizations in a sandbox environment without applying them to a running instance and later return to the sandbox to make additional customizations. These customizations are only applied to the running instance when you click Commit.

Modify DVM:

  • Login to SOA Composer
  • Click on open and then click on Open DVM, this will list all the DVM’s deployed to MDS




  • Select the DVM that needs modified and click on Open.


  • Click on Edit


  • Click on Add or Edit based on the requirement


  • Change the values accordingly and click on ok
  • Click on Save.


  • Click on Commit then Click on yes.


  • The changes are applied to the running instance.


Modifying the Business Rules:

  • Click on Open Rules


  • Select the rule that needs to be modified and click on open.


  • Modify the rules as required and Click on Save and Commit.

       The changes will be applied to the running instance.

Thursday, August 9, 2012

EM console hangs After Entering Username and Password (javax.el.ELException: java.lang.IllegalArgumentException: Illegal id) – Oracle SOA Suit 11g


In Oracle SOA Suite 11.1.1.5.0 in Solaris server, while accessing Enterprise Manager Control the screen just hangs after entering username and password.

The following exception is thrown in the admin server log.

07-Aug-2012 19:37:52 o'clock GMT> <[ServletContext@1860343256[app:em module:/em path:/em spec-version:2.5]] Root cause of ServletException.
javax.faces.FacesException: javax.el.ELException: java.lang.IllegalArgumentException: Illegal id:
at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:261)
at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:513)
at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:782)
at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1354)
Truncated. see log file for complete stacktrace
Caused By: javax.el.ELException: java.lang.IllegalArgumentException: Illegal id:
at javax.el.BeanELResolver.getValue(BeanELResolver.java:266)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:173)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:200)
at com.sun.el.parser.AstValue.getValue(Unknown Source)
at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
Truncated. see log file for complete stacktrace
Caused By: java.lang.IllegalArgumentException: Illegal id:
at org.apache.myfaces.trinidad.component.UIXComponentBase._throwBadId(UIXComponentBase.java:1564)
at org.apache.myfaces.trinidad.component.UIXComponentBase._validateId(UIXComponentBase.java:1540)
at org.apache.myfaces.trinidad.component.UIXComponentBase.setId(UIXComponentBase.java:384)
at oracle.sysman.core.view.menu.MenuComponentsUtil.populateRichMenu(MenuComponentsUtil.java:247)
at oracle.sysman.core.view.menu.MenuComponentsUtil.populateRichMenu(MenuComponentsUtil.java:127)
Truncated. see log file for complete stacktrace

The cause of this exception is the Environment variables are not set properly.

Solution:

We have followed the following steps to resolve the issue (the steps are specified in the metalink note 1399244.1).


Following Environment variables should be set for Solaris in the .profile file:
  • Set ORACLE_COMMON_HOME   ORACLE_COMMON_HOME=$MWHOME/oracle_common;export ORACLE_COMMON_HOME
  • Set LD_LIBRARY_PATH to
           $ORACLE_HOME/lib32
  • Set LD_LIBRARY_PATH_64 to
          $ORACLE_HOME/lib
  • Ensure that PATH has reference to
         $ORACLE_COMMON_HOME/common/bin
        $ORACLE_COMMON_HOME/bin
  • set CLASSPATH to include this:
            $ORACLE_HOME/lib:$MW_HOME/jdk1.6.0_24/lib
  • Restart the services and access Enterprise Manager.

Wednesday, July 18, 2012

Undeploying SOA Composite while soa-infra is down in Oracle SOA Suite 11g.

Undeploying SOA Composite while soa-infra is down in Oracle SOA Suite 11g.:
Recently we had an issue with soa-infra start-up, soa-infra application won’t come up due to corrupt composite. 

We have followed the Meta link note 1380835.1 to un-deploy the corrupted composite and bring up the soa-infra application.

Thought of sharing the same here, it may help whoever facing the same issue.

The SOA composites can’t be un-deployed when the soa-infra application. The below steps will help you to un-deploy the SOA composites when the soa-infra application is down.
  • First check the soa logs and identify which composite is causing the problem
  • Download and copy the ShareSoaInfraPartition.ear file to $MWHOME/Oracle_SOA/common/bin
  • Execute $MWHOME/Oracle_SOA/common/bin/wlst.sh
  •  connect()
             Provide username, password and server URL
  • Run the below command to deploy ShareSoaInfraPartition.ear
                 deploy('ShareSoaInfraPartition','ShareSoaInfraPartition.ear',upload='true')
  • Now run the below command by changing the "toLocation" ('/fmw11g/Middleware' is some location path on SOA machine)
   exportMetadata(application='ShareSoaInfraPartition',server='AdminServer',toLocation='/fmw11g/Middleware',docs='/deployed-composites/deployed-composites.xml')
A deployed-composites folder will be created at "toLocation" path with deployed-composites.xml in it
  • Delete the composite which is causing the problem from deployed-composites.xml and save the file
          for example FormatDate composite like below
           
                 
                
               
           
  • Now run the below command by changing the "fromLocation" (this should be the same location as previous)
            importMetadata(application='ShareSoaInfraPartition',server='AdminServer',fromLocation='/fmw11g/fmw1115/Middleware',docs='/deployed-composites/deployed-composites.xml')

 Now bounce your server and the composite will not be deployed by SOA when it comes up and hence that should bring your soa-infra up.

Oracle SOA Suite 11g - Changing the service endpoint URL dynamically through EM console

Sometimes we may need to change the default endpoint location of the Oracle SOA Suite composite service through the EM console.
The below steps help us to change the endpoint URL’s of the references through the EM console.
  • In EM console click on the Composite
  • Scroll down to Service and References section

  • Click on Reference link and properties tab
  • Change Endpoint Address to the desired location and click apply

The new request will be send to the new endpoint location configured through the EM console.
The new endpoint configuration can be removed to send the request to the default endpoint location configured in the WSDL.

Monday, June 4, 2012

Restrict the access to SOA Composite Service based on the User Role (Authorization to the SOA Composite Service) – Oracle SOA Suite 11g


Restrict the access to SOA Composite Service based on the User Role (Authorization to the SOA Composite Service) – Oracle SOA Suite 11g

Sometimes we may need to restrict the access to the SOA composite service based on the user role.
HTTP basic authentication and an authorization policy can be used to ensure that access is only granted to users who are members of a particular role.

This blog will explain the steps to enable authorization to our composite service. 

Configure the Users and Group:
  • Login to the Weblogic console ('http://:/console')
  • In the left menu select 'Security Realms'
  • Select the realm where you want to create the users and groups.  The default is 'myrealm'
  • At the top select the 'Users and Groups' tab
  • Select User tab and Click 'New' and enter your user name and pwd.  Here am creating the user albin and albin1, create as many users as you want
  • Select ‘Groups’ tab and create a new group.  Here I am creating  ‘IntegrationGroup’
  • Go back to the users and click on  'Albin'
  • Select the 'Groups' tab and add ‘IntegrationGroup’.  The user albin1 will not be part of this group.

Configure the Application Role:
  • Login to EM console
  • Right Click on WebLogic Domain -- >Select Security and Click on Application Roles

  •  Click on 'Create' to configure a new Application Role


  •  Select 'soa-infra' in the 'Application’ drop down and enter the Role name as ‘IntegrationRole’
  • Click on Add Group in the Member section

  •  Select the group – IntegrationGroup, we created earlier as shown below and Click on OK
 


  • Click on OK
Create the Application Policy:
  • Right Click on WebLogic Domain from Em console -- > Select Security and Click on Application Polices
  • Click on Create button

  • Click on the Add button in the Permissions section to configure the Permission details.


  • In the Customize section enter the Permission Class as oracle.wsm.security.WSFunctionPermission and enter '*' for both Resource Name and Permission Actions (In the actual implementation instead of “*” you have to specify the exact value) and Click OK.
  • Click on the Add Application Role button in the Grantee section to add grantees for the Policy.
  •  Select the IntegrationRole created above as shown below and Click on OK.


  • Click on OK, the configured policy details will be displayed as shown.
 

 Configure the Authentication/Authorizations policy to the Composite Service:
  • Open the composite.xml 
  • Right click on the client service and click on Configure WS Polices


  • Add the security Policy oracle/wss_http_token_client_policy and oracle/binding_permission_authorization_policy for authentication/authorization in the security section.

Deploy the composite to the server. The same policy configuration can also be done through EM console after the deployment of the composite.

Testing From SOAP UI:

First try with the user ‘albin’; we will receive the success response message from the server.
 

Try with the user ‘albin1’; we will receive the Authorization error response message from server.
 
 
Showing posts with label SOA. Show all posts
Showing posts with label SOA. Show all posts

Sunday, June 3, 2012

Invoking a web service from the composite with HTTP Basic authentication – Oracle SOA Suite 11g


Sometimes we may need to invoke the HTTP Basic authentication enabled web service from the  Oracle SOA Suite composite.
This blog will explain the steps to invoke the web service with the HTTP basic authentication enabled.

Configure the credential store:

The credential should be configured in the credential store to invoke the web service with the HTTP Basic authentication enabled.

If the credential store is not configured already then follow the below steps to do the same.

  • Login to EM
  • Right Click on WebLogic Domain -- >Select Security and Click on Credentials


  • Click on Create Map
   
  • Enter the map name as 'oracle.wsm.security' and click OK



  • Select the new Map and click on Create Key


  • Enter the key name as 'basic.credentials'
  • Enter the user name and password; I am using the admin user 'weblogic' (we can use the different user)

  • Click OK



Configure the Authentication policy to the Composite Service:

  • Open the composite.xml   
  • Right click on the External reference service for which the HTTP Basic authentication is required for the invocation.

  •  Add the security Policy oracle/wss_http_token_client_policy for authentication in the security section.



Deploy the composite to the server. The same policy configuration can also be done through EM console after the deployment of the composite.


Testing From SOAP UI

No need to provide any username/password while invoking the service, the username/password configured in the credential store will be used to call the reference service.The success response will be received from the web service if the credential configured in the credential store is correct.


Recovering the Oracle BPEL instances from the Recovery Queue – Oracle SOA Suite 11g

 
Recovering the Oracle BPEL instances from the Recovery Queue – Oracle SOA 11g :
Sometimes the BPEL instances may go to the recovery queue, the instances in the recovery queue can be recovered manually to continue the processing.
Below are the some of the reasons the instances to go to manual recovery.
  1. There are not enough threads or memory to process the message.
  2. The server shuts down or crash before it finishes processing the BPEL message
  3. The engine could not finish processing the message before reaching the time-out as dictated by the transaction-timeout configuration

Recovering the BPEL instances:-
  1. Login  to EM console
  2. Right click on soa-infra  ,Click on Service Engine --> BPEL
  3. Click on Recovery tab
  4. Change the Type accordingly(Invoke,Activity,Callback) and the Message state to “Undelivered”  and click on search
  5. All the recoverable messages that match the criteria will be displayed.
  6. Select the required messages and click on Recovery button.
 






Tuesday, May 8, 2012

Proxy Configuration in Oracle SOA Suite 11g


Proxy Configuration in Oracle SOA Suite 11g:

If we are invoking any web services and it needs to be passed through Proxy then the proxy server details should be configured on soa11g server. In SOA11g we have two ways of configuring the proxy. The first way is to configure the Server Level and the second level is Composite level.
Configuration can be done using Enterprise manager/JDeveloper
1) Server Level from EM console:
 Login to the em console
Navigate to SOA Infrastructure->SOA Administration->Common Properties -> More SOA Infra Advanced Configuration Properties...
Enter the HttpProxyHost, HttpProxyPort, HttpProxyUsername and HttpProxyPassword
Click on Apply and then restart Server


 
2) Composite service Level from EM console:
If we want to configure the configure proxy only to a particular composite the can be configured in composite Level.
Navigate to the Process in EM and in the dashboard click on the Service (Adapter used to invoke the web service to which the proxy is required) under the Services and References section.
Click on the properties tab and you can find the different properties as shown below where you can fill the Proxyhost, ProxyPort.




3) Setting Composite service Level from JDeveloper:
Open the Composite.xml and select the service to which the proxy configuration is required.
Add the binding properties oracle.webservices.proxyHost, oracle.webservices.proxyPort
Click on Save.




Thursday, May 3, 2012

java.lang.ArrayIndexOutOfBoundsException in DB Adapter – Oracle SOA Suite 11g


java.lang.ArrayIndexOutOfBoundsException in DB Adapter – Oracle SOA Suite 11g:

The DB Adapter insert were intermittently failing with the following exception in our Oracle SOA Suite environments. 

Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'update' failed due to: DBWriteInteractionSpec Execute Failed Exception. update failed. Descriptor name: [Update_Interfacebuffer.InterfaceBuffer].
Caused by java.lang.ArrayIndexOutOfBoundsException. Please see the logs for the full DBAdapter logging output prior to this exception. This exception is considered not retriable, likely due to a modelling mistake.

It is caused by using a non-synchronized class instead of a synchronized class. Read the Metalink Note 1332114.1 for more details about this.

Oracle suggested us to apply the below patch to resolve the issue.

Patch 11866793: DBADAPTER INSERT OPERATION IS FAILING INTERMITTENTLY WITH NPE

The issue is observed in the following versions 11.1.1.3.0, 11.1.1.4.0 and 11.1.1.5.0 and Fixed in the version 11.1.1.6.0.

The issue got resolved after applying the patch.


1 comment: