Written By Archit Bhardwaj
Sometimes we may need to update the preference value for the BPEL component, the below java code will help us to update the preference value. This update is not a cluster-aware,remember that you must repeat the same process for each managed server of your environment.
Before executing the code change the mbeanName accordingly.
import java.util.*; import javax.management.*; import javax.management.openmbean.CompositeDataSupport; import javax.management.remote.*; import javax.naming.Context; public class UpdatePreferenceValue { public static MBeanServerConnection getMbeanServerConnection(String host, int port, String userName, String password) throws Exception { String jndiroot = "/jndi/"; MBeanServerConnection m_connection = null; try { Hashtable jndiProps = new Hashtable(); jndiProps.put(Context.SECURITY_PRINCIPAL, userName); jndiProps.put(Context.SECURITY_CREDENTIALS, password); jndiProps.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,"weblogic.management.remote"); JMXServiceURL serviceURL =new JMXServiceURL("t3", host, port, jndiroot +"weblogic.management.mbeanservers.runtime"); JMXConnector m_connector =JMXConnectorFactory.newJMXConnector(serviceURL, jndiProps); m_connector.connect(); m_connection = m_connector.getMBeanServerConnection(); } catch (Exception e) { e.printStackTrace(); } return m_connection; } private static CompositeDataSupport UpdatePreferenceData(CompositeDataSupport cds,String[] keys,String[] newValues) throws Exception { Map<String, Object> items =new HashMap<String, Object>(cds.getCompositeType().keySet().size()); for (String key : cds.getCompositeType().keySet()) { boolean matched = false; int i = 0; for (; i < keys.length; i++) { String searchKey = keys[i]; if (searchKey.equalsIgnoreCase(key)) { items.put(key, newValues[i]); matched = true; break; } } if (!matched) { items.put(key, cds.get(key)); } } return new CompositeDataSupport(cds.getCompositeType(), items); } public static void updatePreference(String host,String port,String userName,String password, String preferenceName,String value) { String mBeanName ="*:*,j2eeType=SCAComposite.SCAComponent,revision=*,SCAComposite=\"Preference\",name=Preference"; MBeanServerConnection mbsc; try { mbsc =getMbeanServerConnection(host, Integer.parseInt(port),userName,password); Set<ObjectName> mbeans=mbsc.queryNames(new ObjectName(mBeanName), null); ObjectName mbean=(ObjectName)mbeans.iterator().next(); javax.management.openmbean.CompositeData[] properties = (javax.management.openmbean.CompositeData[])mbsc.getAttribute(mbean,"Properties"); for (int i = 0; i < properties.length; i++) { CompositeDataSupport cds = (CompositeDataSupport)properties[i]; if (preferenceName.equalsIgnoreCase((String)cds.get("name"))) { properties[i] =UpdatePreferenceData((CompositeDataSupport)properties[i],new String[] { "value" },new String[] { value }); mbsc.setAttribute(mbean,new Attribute("Properties", properties)); } } } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { updatePreference("localhost", "8000","weblogic", "password","preference.password","password"); } }
Add the weblogic.jar file to the class.
|
Monday, December 17, 2012
Updating the BPEL Component preference value from JAVA – Oracle SOA 11g
Labels: SOA
Migrating the Metadata from SOA 10g to 11g and sharing the common artifacts to MDS Repository.
Migrating the Metadata from SOA 10g to 11g and sharing the common artifacts to Repository:
If
we use the Domain Value Maps (DVMs) or Cross References in Oracle BPEL
Process Manager 10g or Oracle Enterprise Service Bus 10g project, the
Xpath functions used to access the domain value maps or cross references
will be upgraded automatically when the projects are upgraded in Oracle JDeveloper 11g.
However,
a manual upgrade task has to be performed to upgrade the domain value
maps and cross references that are saved in the Oracle Enterprise
Service Bus repository. Also, if we use the common schemas or WSDLs in
10g project the same should be migrated to MDS repository; in 11g all
the common artifacts will be stored in MDS repository.
There is a lot of information for the same topic but thought of sharing my experience.
Below
are the steps for migrating the DVMs and XREFs to 11g and also to
create the project that will have all the common artifacts like DVM,
XREF, WSDL and SCHEMAs that can be stored to MDS repository.
Export the DVM and XREF metadata from 10g server: (Steps should be executed on 10 g server)
Convert the ZIP file to an Oracle SOA Suite 11g archive file (Steps should be executed on 11g server) :
export DomainHome=<<Weblogic DomainHome>>
export OracleHome=<<OracleHome>>
cd $DomainHome/bin
. setDomainEnv.sh
cd $OracleHome/bin
ant -f ant-sca-upgrade.xml upgrade-xrefdvm -Dsource=<<Path to metadata10g.zip>> -Dtarget= <<Target path>>
Create the Metadata project:
Now the metadata application is ready with all the common artifacts, create a metadata archive file and deploy the project to the server, the metadata can be referred in the Composite with the help of oramds protocol. |
Labels: SOA
Oracle SOA 11g - Configure transaction timeout for BPEL.
The timeouts should be configured based on the below condition
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.
Overriding the transaction timeout setting for BPEL EJB's:
The
timeout properties for the EJB's control the particular timeout setting
for the SOA application, overriding the global setting specified by the
JTA timeout
BPELActivityManagerBean
BPELDeliveryBean
BPELDispatcherBean
BPELEngineBean
BPELFinderBean
BPELInstanceManagerBean
BPELProcessManagerBean
BPELSensorValuesBean
BPELServerManagerBean
|
Labels: SOA
Oracle SOA Suite 11g – Advanced Configurations for Database Adapter.
This blog give the insight on the new features in Database Adapter configuration in SOA 11g.
Query by Example:
A
new Operation type 'Query by Example' has been introduced in Database
Adapter Configuration. Query By Example does not require a selection
criteria to be specified at design time like SELECT Operation. A
selection criteria is inferred from an exemplary input XML record for
each invoke. Use queryByExample when you do not want to create a query
using the visual query builder and want the flexibility of
allowing the input record to share the same XML schema as the output
records. The queryByExample operation is will take little more time
compared to SELECT operation because a new SELECT must be prepared for
each execution.
Doing Synchronous Post to BPEL (Allow In-Order Delivery):
In this feature, the entire invocation is in a single thread and global transaction.
By default, initiation is asynchronous and the BPEL process is invoked
in a separate global transaction. With Oracle Mediator, it is generally a
synchronous invoke so this is only specific to an Oracle BPEL process.
Advanced Options:
A
new screen in Adapter configuration wizard for advanced options is
added. This screen shows different options based on the type of
operation selected. The below are the some of the advanced
configurations.
Auto-Retries:
We can set options like no. of retry attempts, interval between retries back-off factor and max interval values.
JDBC Options: This includes options like Query timeout value to specify the timeout for query execution.
Interaction Options: This includes various
interaction options. Get Active UnitOfWork ( advanced setting that
forces all invoke activities in the same global transaction to use the
same SQL connection if going to the same database), Detect Omissions
(allows the MERGE and INSERT operations to ignore empty or missing XML
elements in the input payload), Optimize Merge (should always be set to
true, as it is a general enhancement to MERGE performance)
Native Sequencing (Oracle only):
Allows specifying that the primary key will be assigned from a sequence on any insert.
Polling Options:
For Polling Options the below are the two new configuration parameters added.
Enable Streaming: This option
is used to enable support to stream the payload. The payload is
streamed to a database instead of getting manipulated in SOA run time as
in a memory DOM. This feature is used while handling large payloads.
Schema Validation: When set to true, all XML files produced by the polling Oracle Database Adapter (for Receive activities) is validated against the XSD file. On failure, the XML record is rejected but still marked as processed by the Oracle Database Adapter.
More detailed SQL queries display with sections for Polling SQL and After Read SQL
|
Labels: SOA
Oracle SOA 11g - Changing the service endpoint URL dynamically through EM console
Sometimes we may need to change the default endpoint location of the service through the EM console.
The below steps help us to change the endpoint URL’s of the references through the EM console.
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. |
Labels: SOA
weblogic.socket.MaxMessageSizeExceededException appearing when Managed Server Attempting To Send larger message to Admin Server.
We used to get the following exception in the
managed servers log file frequently
The reason is the managed server tries to send the message
size more than 10 MB and failing with the following exception. It is observed
that every single time this message is observed in the logs, it is followed by
the respective managed server who is sending that message, losing connectivity
with the admin server.
The root cause is the RJVM messages used to get piled up due
to default watches trap events that’s comes installed and it used to grow in
larger size causing the broken communication between managed servers and
AdminServer
The solution to resolve this is to disable the default WLDF
configured in the server.
Follow the below steps to disable the default WLDF configured in the server.
The default message size of all the servers can also be
increased. The configure can be changed in the protocol section of the server
configuration from the weblogic console as shown below
This stabilized the connectivity issue between the managed
servers and the Admin Server.
|
Labels: SOA
Cluster Constraint for the deployment in weblogic server
luster constraint specifies that deployments targeted to a cluster succeed only if all servers in the cluster are running.
|
Labels: SOA