Friday, September 23, 2011

Configure Transaction Timeout for BPEL on SOA 11g


Applies to:

Oracle SOA Platform - Version: 11.1.1.1.0 to 11.1.1.5.0 - 

Goal

During runtime you may be seeing errors in the log similar to the following:


The transaction was rolled back
or
Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out

The solution is typically to increase the transaction timeout for the process.  

Solution

As a general rule, you should keep the following relation between the timeout parameters:

syncMaxWaitTime < BPEL EJB's transaction timeout < Global Transaction Timeout
Note: This recommendation are ONLY applicable to Sync Processes. Additionally the default Timeout setting that comes with SOA 11g installation does not comply with this rule. You might need to adjust the setting according to your particular business needs.


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.

SOA 11g Configuration Files and Log Files Location


Applies to:

Oracle SOA Platform - Version: 11.1.1.1.0 and later   [Release: 11gR1 and later ]
Information in this document applies to any platform.

Goal


The intent of this note is to list the important configuration and log files used to diagnose SOA 11g problems.

Solution

Throughout this note we will refer to the following:
$ MIDDLEWARE_HOME =
$ DOMAIN_HOME = $ MIDDLEWARE_HOME/user_projects/domains/

Here is a list of files to look for:
1.Domain configuration under $DOMAIN_HOME/config  directory
   - Config.xml
   - jdbc/-Jdbc.xml
   - jms/-Jms.xml files under

2. Adapter configuration under $MIDDLEWARE_HOME//soa/connectors/   directory. ( Oracle_SOA1 is the default name)
  - AppsAdapter.rar
  - DbAdapter.rar
  - FtpAdapter.rar
  - MQSeriesAdapter.rar
  - SocketAdapter.rar
  - AqAdapter.rar
  - FileAdapter.rar
  - JmsAdapter.rar
  - OracleBamAdapter.rar

If you are experiencing problems related to the adapter, please send us the appropriate adapter's rar file.
Also provide the Adapter's deployment plan (Plan.xml).

3. Admin Server log files under $DOMAIN_HOME/servers//logs  directory
 - Access.log
 - -Diagnostic.log
 - .log

4. SOA Server log files under $DOMAIN_HOME/servers//logs  directory
 - . log
  - -Diagnostic.log
  - .log 



Soumya...

Error is: 'weblogic.management.DeploymentExceptiE01on: [J2E49]Error while pro cessing library references

Issue Descriprion:
The ADF code when deployed on an remote ADF server fails with below exception.


Error Log:

#### <[STANDBY] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'> <> <> <402a65ad9b43fa5a:69fd5e4b:12cff20c642:-8000-00000000000002f4> <1293010450094>
in the execution of deployment request with ID '1293010438085' for task '0'. Error is: 'weblogic.management.DeploymentException: [J2EE:160149]Error while pro
cessing library references. Unresolved application library references, defined in weblogic-application.xml: [Extension-Name: adf.oracle.domain, Implementatio
n-Version: 11.1.1.1.0, exact-match: false], [Extension-Name: oracle.jsp.next, exact-match: false].'
weblogic.management.DeploymentException: [J2EE:160149]Error while processing library references. Unresolved application library references, defined in weblog
ic-application.xml: [Extension-Name: adf.oracle.domain, Implementation-Version: 11.1.1.1.0, exact-match: false], [Extension-Name: oracle.jsp.next, exact-matc
h: false].


Cause:
The remote ADF server managed server on which you are trying to deploy your ADF code doesn't have the ADF run time libraries deployed on it. Ask your server admin to deploy it.


Solution:
There are primarily two ways to deploy the ADF run time libraries on a Weblogic managed server(ADF Runtime libraties are supported/installed in the WLS domain).


Method 1: Through EM Console
Method 2: WLST scripts
Method 3: While creating a domain the ADF libraries can be deployed on the managed server.


I will be describing Method 2 here:


You use the custom WLST command applyJRF to configure the Managed Servers or cluster with JRF. To use the custom WLST commands, you must invoke the WLST script from an Oracle home in which the Oracle Fusion Middleware component has been installed



The format of the applyJRF command is:


applyJRF(target={server_name | cluster_name | *}, domainDir=domain_path,
        [shouldUpdateDomain= {true | false}])
You can use the applyJRF command online or offline:


In online mode, the JRF changes are implicitly activated if you use the shouldUpdateDomain option with the value true (which is the default.) In online mode, this option calls the online WLST save() and activate() commands.


In offline mode, you must restart the Administration Server and the Managed Servers or cluster. (In offline mode, if you specify the shouldUpdateDomain option with the value true, this option calls the WLST updateDomain() command.)


To configure a Managed Server with JRF, use the following command:


applyJRF(target='server1', domainDir='/scratch/Oracle/Middleware/user_projects/domains/domain1')
To configure all Managed servers in the domain with JRF, specify an asterisk (*) as the value of the target option.


To configure a cluster with JRF, use the following command:


cd $FMW_HOME/oracle_common/common/bin (eg /orionsap_u01/app_ADF/oracle/product/fmw/oracle_common/common/bin)


applyJRF(target='cluster', domainDir='/scratch/Oracle/Middleware/user_projects/domains/domain1')


An Example:



cd $FMW_HOME/oracle_common/common/bin


sh wlst.sh


wls:/offline/test_domain>connect('weblogic','!Welc0me!','adf1.mycompany.com:8100')
Connecting to t3://adf1.mycompany.com:8100 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'test_domain'.


Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.


wls:/mmi_domain/serverConfig> applyJRF('test_enc_ms_1','/u01/app_ADF/oracle/admin/test_domain/aserver/test_domain')
Location changed to serverRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainConfig)
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)
Location changed to edit tree. This is a writable tree with
DomainMBean as the root. To make changes you will need to start
an edit session via startEdit().


For more help, use help(edit)


Starting an edit session ...
Started edit session, please be sure to save and activate your
changes once you are done.
Saving all your changes ...
Saved all your changes successfully.
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released
once the activation is completed.
Activation completed
Already in Edit Tree


After this is done,restart the managed server and redeploy your code.

Soumya....
   

ORA-01031: insufficient privileges JBO-28006: Could not create persistence table PS_TXN_seq


Applies to:

Oracle JDeveloper/ ADF server - Version: 11.1.1.0.0 and later   [Release: and later ]
Information in this document applies to any platform.

Symptoms

You developed an ADF BC ("ADF Business Components") application.
It was tested and was working correctly when run from JDeveloper, in the Integrated WebLogic Server.
However, in your Production environment, some users report intermittent errors like:
JBO-28006: Could not create persistence table PS_TXN_seq

When forcing passivation to occur with the parameter jbo.ampool.doampooling=false,
as explained in Note:417546.1 - How To Reproduce Problems Related to AM Passivation / Activation
you get the following errors occurring during the passivation:
(with the Java Options
"-Djbo.ampool.doampooling=false -Djbo.debugoutput=console -Djbo.logging.show.function=true"
set in the Project Properties)
[439] **createTable** created sequence error, sqlStmt=create sequence PS_TXN_seq increment by 50
[440] java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges

at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:942)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1223)
at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1775)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1744)
at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:299)
at oracle.jbo.pcoll.OraclePersistManager.createTable(OraclePersistManager.java:832)
at oracle.jbo.pcoll.OraclePersistManager.queryNextCollectionId(OraclePersistManager.java:1444)
at oracle.jbo.pcoll.PCollManager.register(PCollManager.java:562)
at oracle.jbo.pcoll.PCollection.(PCollection.java:99)
at oracle.jbo.pcoll.PCollManager.createCollection(PCollManager.java:461)
at oracle.jbo.server.DBSerializer.setup(DBSerializer.java:150)
at oracle.jbo.server.DBSerializer.passivateRootAM(DBSerializer.java:283)
at oracle.jbo.server.DBSerializer.passivateRootAM(DBSerializer.java:264)
at oracle.jbo.server.ApplicationModuleImpl.passivateStateInternal(ApplicationModuleImpl.java:5645)
at oracle.jbo.server.ApplicationModuleImpl.passivateState(ApplicationModuleImpl.java:5516)
...
[441] JBO-28006: Could not create persistence table PS_TXN_seq
[442] *** Stack trace for detail exception ***
[443] java.sql.SQLSyntaxErrorException: ORA-01031: insufficient privileges

at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:206)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:455)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:413)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1035)
at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:183)
at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:942)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1223)
at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1775)
at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1744)
at oracle.jdbc.driver.OracleStatementWrapper.execute(OracleStatementWrapper.java:299)
at oracle.jbo.pcoll.OraclePersistManager.createTable(OraclePersistManager.java:832)
at oracle.jbo.pcoll.OraclePersistManager.queryNextCollectionId(OraclePersistManager.java:1444)
at oracle.jbo.pcoll.PCollManager.register(PCollManager.java:562)
at oracle.jbo.pcoll.PCollection.(PCollection.java:99)
at oracle.jbo.pcoll.PCollManager.createCollection(PCollManager.java:461)
at oracle.jbo.server.DBSerializer.setup(DBSerializer.java:150)
at oracle.jbo.server.DBSerializer.passivateRootAM(DBSerializer.java:283)
at oracle.jbo.server.DBSerializer.passivateRootAM(DBSerializer.java:264)
at oracle.jbo.server.ApplicationModuleImpl.passivateStateInternal(ApplicationModuleImpl.java:5645)
at oracle.jbo.server.ApplicationModuleImpl.passivateState(ApplicationModuleImpl.java:5516)
...

Cause

Your DB schema hasn't got sufficient privileges to create the passivation table, sequence and/or
index in the database.

The passivation will store information in a table called PS_TXN and will use a DB sequence
PS_TXN_SEQ


These DB objects will be created
  • in the same DB schema as specified in the Application Module Configuration
    (JDBC connection),
  • or in the schema specified in the parameter jbo.server.internal_connection (recommended).
In order to create these, the DB schema needs to be granted DB privileges that are:
  • CREATE TABLE
  • CREATE INDEX
  • CREATE SEQUENCE
For more information, see "Overview of Temporary Tables Created By BC4J"
and the Oracle Fusion Middleware Fusion Developer's Guide for Oracle Application Development Framework,
Chapter "39 Application State Management"
topic "39.5 What Model State Is Saved and When It Is Cleaned Up"

Solution

We recommend that you create a DB schema specific for the creation of these table.
Ask you DBA to create this schema and grant him the following privileges:
  • CREATE TABLE
  • CREATE INDEX
  • CREATE SEQUENCE
When done, edit your Application Module Configuration, in the "Properties" tab and search for the
property called "jbo.server.internal_connection".
Specify there the value of your JDBC connection to connect to the schema you created.

A fully-qualified JDBC connection URL like:
jdbc:oracle:thin:/@:: 
or a JDBC datasource name like:
java:/comp/env/jdbc/YourJ2EEDataSourceName