Friday, August 6, 2010

JDeveloper: TODO

Problem:
Adding Tasks to JDeveloper to keep track of development code

Thoughts:
We always need some kind of Task handler/reminder for our tasks during development so that if that is present in the source code, we can refer that in future (just like Reminder) viz. Need to add a Variable, Delete this variable, Temporary variable, Handle the error etc.

Solution:
Jdeveloper comes with a very good utility - "TODO".
You can write simply TODO as comment (Note: this should be in Caps always) in the source code.
Below picture depicts the same:



Just you need to write //TODO followed by your comments in the source code.

Later through View -> Tasks, you can view all the TODO's in your project. Below picture depicts the same.



So at later point if you want to revisit the code, just double click on the Task line of your interest, it will navigate you to the desired line of code.


Happy Learning.

Wednesday, June 16, 2010

Timeout for Partnerlink

Problem:
How to set timeout for Partnerlink or web service in BPEL?

Solution:
Timeout property is set in bpel.xml file under PartnerLinkBinding tag. Just you need to add a property as timeout.

It is shown below as follows:(Suppose name of the web service you are using is abc)

<PartnerLinkBinding name="abc">
<property name="timeout">30</property>
<!-- other PartnerLink properties -->
</PartnerLinkBinding>

Wait wait...is it that evrything you need to do for having Timeout for Partnerlink? The answer to this is NO. This property cannot work alone. You need something more to be added to it. In order to achieve this you have to add another property called "optSoapShortcut to false" in the bpel.xml for that partner link.

Now it will look like:

<PartnerLinkBinding name="abc">
<property name="timeout">30</property>
<property name="optSoapShortcut">false</property>
<!-- other PartnerLink properties -->
</PartnerLinkBinding>

optSoapShortcut : This property instructs 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.
Timeout property works on soap stack. Suppose a BPEL proces is calling another BPEL process then the call will change from Soap stack to local binding call.

Deployment with Verbose

Problem:
What is the importance of using verbose in your project?

Solution:
Verbose entry appears inside your BPEL project under build.properties file. When you add verbose=true to build.properties file then it gives us 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 more information being written to the log. To accomplish this, follow below mentioned steps:

1) Goto any BPEL Project
2) Open build.properties available under Resources in your application navigator
3) Goto the bottom and add verbose=true
4) Save and Re-deploy
5) Check the Apache-Ant Log Window in your Jdeveloper.

Resetting Console login Password

Problem:
How do you change the password for BPEL Console user 'oc4jadmin'?

Solution:
Follow the below mentioned steps to accomplish this:

1) Connect to SOA Suite EM Console (Application Server Control)
2) Click on appropriate container name. (Home or oc4j_soa, depending upon where your BPEL is available)
3) Click on Administration tab
4) Then click and Goto Task icon for Security Providers task
5) Click Instance Level Security
6) Click Realms
7) Click number under Users
8) Now search for 'oc4jadmin' in list
9) Now click it to change the password for BPEL Console and you are done

ORABPEL-02182

Problem:
ORABPEL-02182

JTA transaction is not present or the transaction is not in active state.
The current JTA transaction is not present or it is not in active state when processing activity or instance "4260005-BpInv5-BpTry7.13-1". Please consult your administrator regarding this error.

Some Thoughts:
You can encounter this error if response time of adapter is greater than the predefined waiting time for a BPEL instance.As a result process does not get dehydrated on time and fails by throwing this error.

Solution:
A better solution for above problem should be to increase the transaction-timeout values in order to make the BPEL instance to wait more time until a response returns from the adapter.

Following are the steps you should follow to acheive the result:

1) Stop SOA Server

1) Goto SOA_Home\j2ee\config\transaction-manager.xml, serach for transaction-timeout and set transaction-timeout for e.g. to 7200 or more (default value is 30).

2) Goto SOA_Home\j2ee\application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xml and set all transaction-timeout to 3600 or more. The value passed here should be always less than the value which is mentioned in step 2.

3) Goto SOA_Home\bpel\domains\config\domain.xml and set syncMaxWaitTime to 240 or more. The value passed here should be always less than the value which is mentioned in step 3. (Default value is 45)

4) Start SOA server and run the process again. Process should work fine.

Importing libraries for using Java Exec

Problem:
Want to use Java Exec, is it resulting in error?

Solution:
Add following libraries to your .bpel code:
<bpelx:exec import="java.util.*"/>
<bpelx:exec import="java.lang.*"/>
<bpelx:exec import="java.math.*"/>
<bpelx:exec import="java.io.*"/>
<bpelx:exec import="com.collaxa.common.util.Base64Decoder"/>
<bpelx:exec import="com.collaxa.common.util.Base64Encoder"/>

Monday, March 29, 2010

MCF Property in WSDL

MCF stands for "Managed Connection Factories". When configuring a Database Adapter using Adapter Configuration Wizard, a Database Connection is required to configure the adapter. This connection you create inside connection Navigator->Database.

Once the adapter is created, a WSDL file is automatically created that includes the adapter definition. This includes the Managed Connection Factory (MCF) properties as well as the Java Naming and Directory Interface (JNDI) name (which you create on Enterprise Manager side), as shown below:


<service name="UpdateEmpTable">
<port name="UpdateEmpTable_pt" binding="tns:UpdateEmpTable_binding">
<jca:address location="eis/DB/MyDBHR" UIConnectionName="MyDB" ManagedConnectionFactory="oracle.tip.adapter.db.DBManagedConnectionFactory" mcf.DriverClassName="oracle.jdbc.OracleDriver" mcf.PlatformClassName="oracle.toplink.platform.database.oracle.Oracle10Platform" mcf.ConnectionString="jdbc:oracle:thin:@//159.67.4.3:1521/orcl" mcf.UserName="hr" mcf.Password="8498F4AC99532042CRECC296529B23E6" />
</port>
</service>

If you are using JNDI then manually remove MCF properties from your code once development is complete.

Email to multiple Recipients

Problem:
Sending Email from BPEL to multiple recipients

Solution
It might just be the smallest topic I have ever blogged about, just thought to share it with you all.
EmailPayload of the Notification Service takes a String. If that String contains a comma separated list of email-addresses, it will send emails to each of the adresses in that list.
For example:
To: abhi@xyz.com,abhishek@abc.com

Friday, January 8, 2010

BPEL:Cannot find partnerLinkType 2

Problem:
Cannot find partnerLinkType 2.
PartnerLinkType "{http://xmlns.oracle.com/pcbpel/adapter/ftp/pl_get/}Get_plt" is not found in WSDL.
Please make sure the partnerLinkType is defined in the WSDL.

Solution:
If you get such kind of error while deploying project, the simple solution is to clear the WSDL Cache in the BPEL console.
Step to reach there:
1) Login to Oracle BPEL Console (for 10.1.3.4)
2) Goto Administration Tab -> Click on Actions tab
3) Click on Clear WSDL Cache.
4) Try deploying project.

Tuesday, January 5, 2010

OPMNCTL command

Problem:
Running OPMNCTL commands on Windows and Linux servers.

Solution:
For running OPMNCTL command on Windows:

Ensure that before running you be at opmn\bin folder
To Start:
>opmnctl startall

To Stop:
>opmnctl stopall

To check the status:
>opmnctl status

To know opmnctl command:
>opmnctl

For running OPMNCTL command on Unix/Linux:

Connect to server using Telnet. Ensure that before running you be at opmn/bin folder
To Start:
>\.opmnctl startall

To Stop:
>\.opmnctl stopall

To check the status:
>\.opmnctl status

To know opmnctl command:
>\.opmnctl