Wednesday, July 27, 2011

How to Remove Contents from MDS Repository

In 11g we can publish artifacts and commonly used schema, wsdl's in a meta data store to acccess across processes.

Often we realize that sometime we need to clean up and remove unnecessary and unwanted files from the repostiory.

There are two ways you can remove contents from MDS offline mode and online mode. I will explain both the options below

Option 1: Offline Mode


Step 1: Execute wlst.sh
Goto YOUR_MIDDLEWARE_HOME/Oracle_SOA1/common/bin and execute wlst.sh
Step 2: Run Command
At wlst command prompt (wls:/offline>) execute the following

sca_removeSharedData('http://yourhost:yourport', 'directory', 'adminuser', 'adminpassword')

To remove a folder named "common" folder and all it's sub-directories and files.

sca_removeSharedData('http://localhost:8001', 'common', 'weblogic', 'weblogic1')


Option 2: Online Mode


Step 1: Execute wlst.sh
Goto YOUR_MIDDLEWARE_HOME/Oracle_SOA1/common/bin and execute wlst.sh

Step 2: Connect to SOA server
At wlst command prompt (wls:/offline>) execute the following

connect('adminuser', 'adminpassword', 't3://hostname:port')

ex:
connect('weblogic', 'weblogic1', 't3://localhost:8001')

Step 2: Remove Content from MDS

deleteMetadata(application='soa-infra',server='soa_server1',docs='/apps/common')

Friday, May 06, 2011

Using Preferences / Deployment Descriptors in 11g

About this post
In 10g most of us used Deployment Descriptors in bpel processes. In 11g those are still available but their implemenation and definition places changed due to composites and weblogic applicaiton server. This post talks about how to use and manage these preferences in 11g.

Step 1: Add preferences property to composite.xml


Open composite.xml in source mode

Add the property "bpel.preference.kalyanpref"

Take a look at the above property closely it has 3 sections 1) bpel 2) preference 3) Name of the preference.

When you access in bpel you would access like ora:getPreference('kalyanpref')

Following code snippet shows how you add this property in composite.xml

<component name="DemoPreferencesBPEL"version="1.1">
<implementation.bpel src="DemoPreferencesBPEL.bpel"/>
<property name="bpel.preference.kalyanpref">kalyan</property>
</component>


Step 2: Where to Access / Update this preference


Access to this preference is available on Descriptor tab in 10g, but in 11g it's available in MBean browser.

Go to Enterprise Manager (http://localhost:7001/em)

Navigate "Farm"->"Weblogic Domain"->Right Click On "Your SOA Domain"->"System MBean Browser"



In the MBean Browser Window click on "oracle.soa.config"->soa_server1->SCAComposite->Demo Preferences->SCAComposte.SCAComponent->DemoPreferencesBPEL


On the Right hand side click on "properties"




You can update the values here and click on Apply to take effect.

Thursday, March 31, 2011

11g : Starting Managed Server with boot.properties

When you start your Managed Server there is a prompt for Weblogic Username and Password. You can avoid this by creating a properties file with the username and password to avoid typing everytime.

Creating boot.properties

Step 1

Create file boot.properties with the following content
username=weblogic
password=welcome1

Step 2

Place the boot.properties under your managed server directory
For ex: /user_projects/domains/kalyan_domain/servers/soa_server1/security
If security folder is not available create one and place the file under that.

Alternative

You can also pass parameter
"-Dweblogic.system.BootIdentityFile=path_to_your_file" to JAVA_OPTIONS variable in your setDomainEnv.sh file

Wednesday, January 05, 2011

Oracle 11g : Problem Restarting Weblogic Servers


Problem Restarting Weblogic Admin and Domain Servers


You may see an error while restarting Weblogic Servers, after a forceful shutdown and sudden system reboot.

In order to restart the server you need to delete the following files

*.lok files
*.DAT files

look under all the directories where weblogic server installed remove these files and restart..

Friday, April 23, 2010

Oracle SOA Suite 10.1.3.4 with MLR #


Download Oracle SOA Suite 10.1.3.1 from otn Link


Download Oracle SOA Suite 10.1.3.4 from otn Link


Download Oracle JDeveloper 10.1.3.4 from otn Link


Download the latest MLR Patches from Metalink:
Login to http://metalink.oracle.comand search for the following patch numbers
8589928 CUMULATIVE MLR#9 04-Sep-2009
8372150 CUMULATIVE MLR#8 17-Jun-2009
8372141 CUMULATIVE MLR#7 20-JAN-2009
8279781 CUMULATIVE MLR#6 06-May-2009
7714967 CUMULATIVE MLR#5 21-Feb-2009
7586067 CUMULATIVE MLR#4 15-Jan-2009
7586063 CUMULATIVE MLR#3 10-Dec-2008
7408340 CUMULATIVE MLR#3 05-Nov-2008
7375086 CUMULATIVE MLR#1 04-Oct-2008


Documentation :
10.1.3.4 Documentation Main Page

Addendum
727068.1 Oracle Application Server Patch Set Notes Addendum 10g Release 3 (10.1.3) Patch Set 4 (10.1.3.4.0)

Wednesday, September 16, 2009

JDeveloper Connection to Weblogic Server


Problem

When Creating Application Sever Connection from JDeveloper to Weblogic you get an exception that "Cannot instantiate class: weblogic.jndi.WLInitialContextFactory" while testing connection.















Resolution

The problem is that JDeveloper is not able find the WLInitialContextFactory in the weblogic.jar you pointed at the time of setup.

Copy the weblogic.jar to \jdev\lib\ext and restart your JDeveloper and retest the connection



Thursday, June 04, 2009

BPEL Process for HA


Purpose

In a HA Deployments, when a bpel process is executed you cannot identify which server is currently executing of a given instance. It's often a requirement to test a BPEL Process in HA Environment and prove that which server is actually executing. As you may be aware when you execute a BPEL Process you cannot tell which node has executed that at any given time.

The following example helps you identifying which server is executing so that you can do some HA testing.


Step 1

Create a Simple Synchronous BPEL Process and name it as "HAHelloWorld"


Step 2

Drag and Drop "Java Embedding" Activity between "receive" and "reply".


Step 3

Drag and Drop "Assign" Activity and Initialize the Variable "result" with some text (Note: anything it doesn't matter all you are doing here is initializing the result variable)


Step 4

Double click on "Java Embedding"Activity and copy the following details


/*Set Title*/
String prop = System.getProperty("server.id");
setVariableData("outputVariable", "payload", "/client:HAHelloWorldProcessResponse/client:result", prop);
setTitle("Server:"+prop);



Step 5

Make sure your BPEL Process looks like below





Step 6

Goto opmn.xml in SOA Installation under opmn\conf directory on Node1 and peform the following.
Edit opmn.xml and add "-Dserver.id=vm104" in the "java-options" of process-type "OC4J_SOA"

It should look like below see the highlighted in red




Perform the same above operations in opmn.xml in SOA Installation under opmn\conf directory on Node2 just make the servier.id=vm105


Step 7

Restart both nodes


Step 8

Deploy the BPEL Process & Test.
When you run the BPEL Test and go to Instances tab you will see below





Download

You can download the complete code Here

Thursday, May 07, 2009

New JDeveloper Plugin for Visual Schema Print


Need

In Jdeveloper we can create schemas using Schema Designer, but there is no option to print the schema. Visual Schema Print will help in design discussions with functional/technical folks as they see the structure in visual rather than looking at source. This will be good for documentation purpose as well..

This Plugin adds this capability.


How to use

Follow the Instructions on
How Install Plugin from Update Center

or

Follow the Instructions on
How Install Plugin Manually


How Install Plugin From Update Center

Install the plugin as you would normally install any plugin in Jdeveloper. If you do not know or this is the first time follow the instruction below.

Steps


Click on "Check For Updates" on Help Toolbar



Select "Open Source adn Partner Extensions" and click on "Next"





Scroll down to find "Print/Save XML Schema", select checkbox and click Next.





Click on "Finish"





Click on "Yes" and restart JDeveloper





How Install Plugin Manually

Download the plugin from below link and save.
http://kalyan.bitra.googlepages.com/com.kalyan.ide.jdev.schema.zip

Steps


Click on "Check For Updates" on Help Toolbar



Click on "Next" on the following page





Select "Install From Local Files" and browse to where you saved the plugin.





Click on "Finish"





Click on "Yes" and restart JDeveloper





How to Use

Open any schema and right click on the designer you will see the "As PDF, As JPG" pr
"As Print" that's it.


Sunday, April 12, 2009

How-To Reload Fault Policy in 10.1.3.4

In 10.1.3.4 you can reload the fault polcies that are changed and does not need a system restart simply access the following JSP page and all the fualt-policies are reloaded.


http://<YourHost>:<YourPort>/BPELConsole/<YourDomainName>/doReloadFaultPolicy.jsp

Wednesday, March 04, 2009

How to Setup AQ With Examples


Create User

Login to SQLPLUS using sys as sysdba
In the following code you are creating user called "fusiondev" and password "fusiondev"

create user fusiondev identified by fusiondev


Setting Up basic Privileges

grant resource, connect, create view to fusion dev


Setting Up AQ Privileges

In the following code you are giving both administrator and user roles to the fusiondev user

grant aq_administrator_role and aq_user_role to fusiondev.


Setting Up Message Type ( Or Object)

In the following code you are setting up an object with a message strcture of
MessageType, and actual Message. This message type can be used further to query the queue to see what message are there etc., but it's not mandatory.

create or replace type OrderMsgType as object (
MessageType VARCHAR2(10),
Message CLOB
);


Create Queue Table

In the following code you are creating a Queue Table called "ORDER_QUEUE_TBL" that there are multiple consumers and the message structure is of "OrderMsgType" which you creaated above.

BEGIN
DBMS_AQADM.CREATE_QUEUE_TABLE(
queue_table => 'fusiondev.ORDER_QUEUE_TBL',
multiple_consumers => TRUE,
queue_payload_type => 'OrderMsgType'
);


Create Queue

In the following code you are creating a Queue Table called "ORDER_QUEUE" and it's tied to ORDER_QUEUE_TBL which you creaated above.

DBMS_AQADM.CREATE_QUEUE (
queue_name => 'FUSIONDEV.ORDER_QUEUE',
queue_table => 'fusiondev.ORDER_QUEUE_TBL'
);
END;


Starting Queue

Here you are starting the queue and ready to be consumed.

BEGIN
DBMS_AQADM.START_QUEUE('fusiondev.ORDER_QUEUE');
END;

Now your AQ is Ready to be published/consumed

Stopping Queue

Here you are Stopping the queue and ready to be consumed.

BEGIN
DBMS_AQADM.STOP_QUEUE('fusiondev.ORDER_QUEUE');
END;


Browse the Queue

Here you are Stopping the queue and ready to be consumed.

select * from AQ$ORDER_QUEUE_TBL


State of the Message

At any given time the message have different states. We will talk about those in detail later.

select MSG_STATE from AQ$ORDER_QUEUE_TBL


BPEL Process - PublishAQOnDemand

This process creates a message and publishes it to AQ. This message is consumed by two recepients identified as ConsumeAQMessage1 & ConsumeAQMessage2.
Download Link


BPEL Process - ConsumeAQMessage1 & ConsumeAQMessage2

These processes consumes the message.
Download Link
Download Link


WoW Factor



Step 1

Now that you have the processes spoon fed to you.. Now create a bpel process consume the message. While defined the adapter in the BPEL Process Designer set the consumer name to "MyAQLearningProcess" and deploy.


Step 2

Then go to BPEL Console and click on the Process "PublishAQOnDemand" go to the Descriptor Page you will see something like below.





Step 3

Now Add your "MyAQLearningProcess" to the end of the recepientList and click on update descriptor button. So it should look like ConsumeAQMessage1, ConsumeAQMessage2, MyAQLearningProcess


Step 4

Then when you execute "PublishAQOnDemand" Process you will see 3 new instances created.

Wednesday, February 11, 2009

Oracle SOA Suite 10.1.3.4


Download Oracle SOA Suite 10.1.3.1 from otn Link


Download Oracle SOA Suite 10.1.3.4 from otn Link


Download Oracle JDeveloper 10.1.3.4 from otn Link


Download the latest MLR Patches from Metalink:
Login to http://metalink.oracle.comand search for the following patch numbers
8589928 CUMULATIVE MLR#9 04-Sep-2009
8372150 CUMULATIVE MLR#8 17-Jun-2009
8372141 CUMULATIVE MLR#7 20-JAN-2009
8279781 CUMULATIVE MLR#6 06-May-2009
7714967 CUMULATIVE MLR#5 21-Feb-2009
7586067 CUMULATIVE MLR#4 15-Jan-2009
7586063 CUMULATIVE MLR#3 10-Dec-2008
7408340 CUMULATIVE MLR#3 05-Nov-2008
7375086 CUMULATIVE MLR#1 04-Oct-2008


Documentation :
10.1.3.4 Documentation Main Page

Addendum
727068.1 Oracle Application Server Patch Set Notes Addendum 10g Release 3 (10.1.3) Patch Set 4 (10.1.3.4.0)

Wednesday, June 04, 2008

Calling Secure Services

There are two most popular ways of securing Webservices, We will talk about them and how to invoke those secured services from BPEL.


Basic Secure Services:

These services are required to send authentication information (username / password) in HTTP Header to access.

WS-Security Services:

These services are required to send authentication information ( username / password) as WS-Security tokens in SOAP Envelope to access.

How to Add HTTP Authentication in BPEL:

Add the following properties in bpel.xml under the partner link for that service.

<property name="httpHeaders">credentials</property>
<property name="httpUsername">kalyan</property>
<property name="httpPassword">welcome1</property>

OR


<property name="basicHeaders">credentials</property>
<property name="basicUsername">kalyan</property>
<property name="basicPassword">welcome1</property>


How to Add WS-Security Tokens in BPEL

Add the following properties in bpel.xml under the partner link for that service.

<property name="wsseHeaders">credentials</property>
<property name="wsseUsername">kalyan</property>
<property name="wssePassword">welcome1</property>

Thursday, April 17, 2008

Oracle SOA Suite Patchsets

Important Oracle Patch sets:

10.1.3.1 : Download From OTN http://otn.oracle.com/soa
10.1.3.3 : Available as a patch from Metalink Patch # 6148874
10.1.3.3.1 : Available as a patch from Metalink Patch # 6492514

10.1.3.3 Addendum : YOU MUST READ THIS
Doc Id: 435108.1 : Oracle Application Server 10g Release 3 (10.1.3.3) Patch Set Notes Addendum

Additional Notes you should read the following notes on metalink if you are installing on Solaris Sparc 64
Doc Id: 460283.1 : Patch 6148874 Does Not Deploy Any OC4J Applications on Solaris
Doc Id: 6330834 : WHEN USING NFS, OC4J 10.1.3.3 DOESN'T START CORRECTLY.

10.1.3.3.1 Bugs FixedLink


10.1.3.3.1 Additional InformationLink

Friday, April 11, 2008

Why timeout property is not working ?

When we call a synchronous webservice we can specify how much we want to wait for the response to come back before the sytem level timeout occurs.

This is acheived with "timeout" property added to the partnerlink binding in the bpel.xml.

ex:
<partnerlinkbinding name="CallCreditService">
<property name="wsdlLocation">http://KBITRA-LAP:7777/orabpel/default/TestHello/TestHello?wsdl</property>
<property name="timeout">30</property>

so you are waiting for this to timeout in 30seconds but does not appear to be working and the system level timeout occurs.

The reason for this is this property works when the invocation happens on soap stack, when bpel calling another bpel process as you know by now automatically switches this soap call to be local binding call. In order to achieve this you have to add another property called "optSoapShortcut to false" in the bpel.xml for that partner link

How to do it: Steps

1. Open BPEL project from Jdeveloper
2. Open bpel.xml look for "partnerLinkBinding" for the partner you are trying to invoke and add the following property tag inside.
false

So here is the changed version:

<partnerLinkBinding name="CallCreditService">
<property name="wsdlLocation">http://KBITRA-LAP:7777/orabpel/default/TestHello/TestHello?wsdl</property>
<property name="timeout">30</property>
<property name="optSoapShortcut">false</property>
</partnerLinkBinding>

Wednesday, March 19, 2008

Using XE as Dehydration for SOA Suite

If you are using XE as your dehydration store for oracle soa suite, often you see a connection issue happening from BPELConsole or ESBConsole or OWSM that server "Cannot fetch a datasource connection". One of the possible reasons after making sure your connection information is correct is to increase the number of sessions/processes for XE.

The default number of sessions / process in XE is 20 each which is not sufficient for SOA Suite, you have to increase that to a minimum of 50.

Here are the instructions on how to do it !

Increase Database Sessions / Processes

Make sure you shutdown your soa suite.
Goto Start->Oracle Database 10g Express Edition ->Run SQL Command Line
At the SQL Prompt enter the following commands.
SQL> connect / as sysdba
SQL> show parameters processes
SQL> alter system set processes=100 scope=spfile;
SQL> alter system set sessions=100 scope=spfile;
SQL> shutdown immediate
SQL> startup
SQL> show parameters processes

Tuesday, October 30, 2007

optSoapShortcut Where is it ?

optSoapShortcut : This property instrucs bpel to make the webservice calls via saop stack or not. When BPEL invokes any partner links if the services its calling is running on the same server/domain then it avoid soap overhead and calls natively.

There may be situations that you want to invoke the services via Soap Stack, then this property helps you do just that...

Usage 1 : You can set this property in domain.xml of the bpel domain so the entire server always communicates via soap stack.

How to do it : Steps
1. Go to "YOUR_APPSERVER_HOME\bpel\domains\default\config
2. Open domain.xml with any text editor
3. Add add the following at the end just before </bpel-domain-descriptor>

<property id="optSoapShortcut">
<name>Make Calls Via Soap Stack</name>
<value>true</value>
<comment><![CDATA[
Make Calls Via Soap Stack.
<p/>
The default value is true.
]]></comment>
</property>

Usage 2 : You can set this property in bpel.xml in your bpel process for a specific partner link only that partner link invocation always happens via soap stack.

How to do it: Steps
1. Open BPEL project from Jdeveloper
2. Open bpel.xml look for "partnerLinkBinding" for the partner you are trying to invoke and add the following property tag inside.
<property name="optSoapShortcut">false</property>

for ex:

<partnerLinkBinding name="CallCreditService">
<property name="wsdlLocation">http://KBITRA-LAP:7777/orabpel/default/TestHello/TestHello?wsdl</property>
<property name="optSoapShortcut">false</property>
</partnerLinkBinding>

Now all the invocations for TestHello Partner Link goes thru the soap stack..

How to Change Transaction Timeout 10.1.3.3

Transaction Timeout allows appserver how much time that the server has to wait before it rolls back the tranactions. By Default oracle application server sets this value to "30" seconds. If you need to change this for any reason. Here are the steps.

Steps:
1. Go to "YOUR_APP_INSTALL_HOME\j2ee\\config\transacton-manager.xml
2. Look for transaction-timeout="30" and change the value of 30 to whaterver you want.

Note: This transaction timeout affects one home if you have more than one oc4j home then you have to change in all.

Getting More Info on Deployment with Verbose

Adding verbose=true to build.properties gives much more information regarding the compile/deploy process of soa projects. Just add "verbose=true" to your build.properties and deploy your process. While Deploying goto "Apache Ant" Log Window and see much more information being written to the log.

Steps :
1. Goto Your BPEL Project
2. Open build.properties under Resources
3. Go to the bottom and add verbose=true
4. Save and Re-deploy
5. Check the Apache-Ant Log Window in your Jdev.

Here is a the visual walk-thru on how to do this.



Oracle Jdev Debug Window

By Default Jdeveloper Creates a shortcut to "YOUR_INSTALL_DIR/jdeveloper.exe" but best way is to change that link to point to "YOUR_INSTALL_DIR\jdev\bin\jdev.exe" this opens a debug window (black window see below) which shows all the exceptions that are happening with JDev.



This helps in debugging your application what is causing it to fail whether its not able to parse the schema or it's not able to reach any of the wsdl's that are referenced within your soa projects.