Sunday, December 06, 2009

BPEL thread tuning

Why I write this?

Oracle has been changing the way the threads are increased or decreased from different versions of the SOA stack.

There are quite a number of people who do not read the documentations quite often and the change are put up like a small note some where.

And when you look at any presentations that talks about changing the number of threads, there are different version of the document as it was prepared for a version of the SOA stack.

Here I am trying to capture the thread setting for 10.1.3.4 and for older versions it is different.
For 10.1.3.5 and 11 there are no changes for the thread settings.

What is it with 10.1.3.4 and how it was before that?

In 10.1.3.1.0 there was this concept of dspMaxThreads which has been totally done away with.
The other setting were dspMinThreads and dspInvokeAllocFactor.

All this has been done away with and now there are only 3 different threads that you allocate directly to the server.

These are
dspInvokeThreads
dspEngineThreads
dspSystemThreads

The number of threads you allocate to the domain is directly controlled by these parameter.
There are no more any dspMaxThreads
All that crap calculations that was required with number of threads total in all domain is less that dspMaxThreads has been done away with.

I think oracle has been consistently adding value into the SOA stack and clearing out all that mess.

Best document to read

This document shows what was and what change and how it looks in 11


Saturday, August 29, 2009

How to get Oracle Fusion 11.1.1 into Ubuntu 9.04

Why the hell Ubuntu

Well to be frank windows in a crap to run, no offense but I hate windows to run my servers.
Ubuntu is what i like to use and I am sure some one else would also make use of what I have to share here.

What surprised me!!

I have never seen a installation of Oracle SOA suite go smooth till I came to Oracle Fusion 11.1.1
The installation was smooth as silk. No hiccups. And a cool new GUI for IRCA.

Here is what I started with :)

I have a Oracle database running in Ubuntu
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production

Nothing else to start with.
And don't worry if you are already running 10.1.3.4 as all the schemas a new ones. You can run them in parallel.

Is it supported??

Ubuntu is not officially supported

The steps

Just follow the installation steps in the documentation.
1. Check fusion requirements
2. Run the RCU (Repository Creation Utility) - well this is cool GUI replacement for the old boring IRCA fianlly from oracle.
3. Installation of weblogic server
4. Installation of SOA suite
5. Finally the configuration

What is the catch!

There are a few things that might try to stop you installing, but here is the blog to help you as I helped my self.
As I could find no one has written about this yet.

Upgrade the JDK and JRE

You might need to upgrade the JDK
Fire this and you are ready to go. And don't worry you will both jdk and jrocket after installation.
sudo apt-get install sun-java6-jdk

Follow the link to get JRE upgraded
http://www.ubuntugeek.com/how-to-install-java-runtime-environment-jre-in-ubuntu-904-jaunty.html

And finally you might have to change the default JRE. Get this done from the link
http://ubuntuforums.org/showthread.php?t=87395

During Installation

Now during installation, there are few checks that says this OS is not supported ans few like them. Just ignore them and continue. You should be home.

Just Incase

Just in case you are unable to start the managed server with the command startManagedWebLogic.sh soa_server1
and some strange error like Unable to authenticate, remember to check that the your localhost and are pointing to the same IP address in /etc/hosts file

What was the pain

The pain in the ass was to get the whole thing downloaded. Nothing seems less than a gig.

Word of advice

Don't do the installation in a rush. Read the pre-req and follow each step.

Wednesday, May 13, 2009

BPEL Deployment on highly available SOA cluster server

What is highly available SOA cluster server?

Well this is the standard oracle recommended server configuration were you have say 2 application server, and a single RAC dehydration database.

You can find the details of this here.
http://download.oracle.com/docs/cd/E10291_01/core.1013/e10294/overview.htm

What is the default load balancer mechanism?

The default load balancer does a round robin request routing. Say if this is 2 AS instance, then first request goes to instance 1 and second request goes to instance 2.

Do you deploy on both servers?

Well this is a good question. As you got say atleast 2 Oc4J-SOA instances running.
Do I deploy to both the server or does the server take care when deployed to 1.

Well the answer is, the server takes care when you deploy to 1 server.
It automatically goes into the second server also.

How is load balancer related to deployment?

Well if look at the logs during deployment you would see that once you have some automated process to deploy.

The first process physically get deployed to server 1 and second process to server 2 and so on.

What about Polling processes running on both servers?

Well there are no issues with polling processes, it is taken care internally to do the right thing.
If one OC4J-SOA instance goes down the other picks in up automatically.

Server Configuration

Be sure to do server configuration on all the instaces as this does not get replicated at all.
You need to physically do this, that is logical.

Issue

With deployment plans there is a bug with cluster deployment.
The replacement happens only in the server where the process is deployed, the other servers still seem to get a copy of the non-replaced code.

This causes issues in deployment with 10.1.3.4 deployment plan.
This is a know bug and oracle has logged a bug to fix this.
A fix might be available soon.

Alternative for now is to while a shell script to do the find and replace for environment specific replacement. Once the fix from oracle is available, deployment plan should take care of the stuff for you.

Monday, April 20, 2009

Deployment Problems-Can't get oracle user password

What happens for deployment?

If you have a wrapper shell script to perform deployment of BPEL processes, you would need to have a user to log in to the box.
Generally such wrapper scripts for deployment of BPEL processes are run as oracle user.

What is the concern?

Generally oracle user is used to run the installation.
Now for installation to run oracle user has every access to do any thing in the system.

Now if the oracle password is given for deployment, there is concern of miss use of it.
Who ever has access to it can mess up the system big time.

Why is this so?

oracle user has sys admin privileges. So generally the DBA would not give this to you.

Alternative option

Create a new user for deployment.
Get this user the following access and you don't need oracle username password.
Only read and execute access in the below list would be enough to get depployment script working.

${ORACLE_HOME}/bpel/bin All files BPEL deployment related files r-x
${ORACLE_HOME}/jdk All files and sub directories set jdk home for deployment r-x
${ORACLE_HOME}/ant All files and sub directories set deployment ant modules r-x
${ORACLE_HOME}/bpel/system/classes All files and sub directories bpel classpath r-x
${ORACLE_HOME}/j2ee/${oc4j_instance}/applications All files and sub directories for j2ee related deployment r-x
${ORACLE_HOME}/bpel/lib All files BPEL libraries to be included for compilation r-x
${ORACLE_HOME}/j2ee/home All JAR files BPEL client jar files r-x
${ORACLE_HOME}/j2ee/home/lib All JAR files BPEL client jar files r-x
${ORACLE_HOME}/lib All JAR files dependent JAR files r-x

Tuesday, April 07, 2009

java.lang.OutOfMemoryError: PermGen space KILLER

When did I see this happen?

I seem to have seen this in 2 different places with in BPEL world so far.

Firstly when I try to use the automated deployment process while deploying to System Test or Use Acceptance Test (UAT) and even in pre-prod some times. I have this whole bunch of about 30+ bpel processes to deploy and have a automated deployment process to do this. In random order in the middle of deployment you get this crap.

Secondly I have even seen this in Development environment, while deploying BPEL process from JDeveloper.

I have never seen this happen any other time at least in the scenarios that I have worked in.

Where do you see this?

If I take this second one first, I mean JDeveloper deployment in DEV, then it is in the JDeveloper logging window.

Now to the first scenario is a bit of a pain. You have a deployment running and all of a sudden the deployment fails. Time to dig into the opmn log file and find these words there.
"java.lang.OutOfMemoryError: PermGen space"

What the hell is PermGen space?

First of all it is NOT PermGem space but it is Perm Gen space.
PermGen stands for Permanent Generation.

How the hell is this related to BPEL?

The answer is both No and Yes.

Why NO?

This weired error is not a BPEL error but a java JVM memory error.

Why YES?

You see this crap come up while deploying BPEL.

So what is the background of PermGen Error?

Well let us dig into java. JVM has this memory called virtual memory. This is the memory that JVM uses to work with what ever it has in hand.
But JVM has 3 different space of it.
The Young, Tenured and Perm.

All the objects that get created are first stored in Young Generation. If the objects survive long enough from garbage collector they get transferred to Tenured Generation.

Now Permanent Generation is special. When there is no space left in Perm you see this error.

So what does Perm Gen contain?

Permanent Generation is special as it contains class definitions.
Objects are in Young and Tenured Generation.

Basically it contains
  • Basic fields of java class
  • Methods of a class (including the bytecodes)
  • Names of the classes
  • Constant pool information
  • Object arrays and type arrays associated with a class
  • Internal objects created by the JVM (java/lang/Object or java/lang/exception for instance)
  • Information used for optimization by the compilers (JITs)
There are a few more pieces in there but this is most of it.

So what causes Perm Gen?

As you are loading BPEL through some ANT task.
ANT runs the java stuff to load BPEL.

The class loader that loads the BPEL fills up the Permanent Generation with the class details of all the classes that you have loaded.

What is the default PermGen?

The default max permanent generation size is 64M, not quite enough.

What is recommended?

1024 is recommended.

How to control this?

Use the following with the command line
-XX:MaxPermSize=1024m

What does
-Xms and -Xmx do to PermGen?

These 2 parameters does nothing to change the Perm Gen space setup by JVM.
You just do want to default Max Perm Gen space to 64 M.

Is this the final solution?

Not really, if you keep loading loads of new processes or huge number of classes this might delay your Out Of Memory Error but will not fix it.

The only solution?

The only solution is to bounce the server once you see this error.

Where else?

This is a general issue faced by all sun java based servers. When huge number if class are loaded as part of an application, this error is expected.

Related Links I liked

http://blogs.sun.com/jonthecollector/entry/presenting_the_permanent_generation
http://forums.oracle.com/forums/thread.jspa?messageID=3344909&#3344909
http://www.jroller.com/agileanswers/entry/preventing_java_s_java_lang

Wednesday, January 21, 2009

hostname with and without domain name issue

Why I write this?

The reason why I write this is as I faced this.
Some kind of a behaviour that I have never seen to known, but yes I did find this.

What did I see?

I was happy developing my BPEL process. everything looks cool and alright.
Now I had BPEL process A and B.

A was calling process B
B was developed happily and deployed

Started developing A, this is when I see this strange error
When I tried to create a partner link for B from the service explorer in partner link wizard
"The WSDL could not be located" error was displayed in the wizard

How can that be?

Yes how can this be, I was actually using the service explorer and making my way to B and selecting it and still WSDL not discoverable
What stupidity, how can this be?

What does the partner link actually not like?

Well, what I found is this. The URL for webservice was causing the issue. The wonderful hostname.

The URL from service explorer did not have the domain name in the hostname.
When I added the domain name there in the WSDL location, the WSDL was working alright.

Strage aint it.

What was the other issue?

The WSDL was alright, but there was some thing else that broke.
When I tried to deploy A it came back with the following error.

Error:
[Error ORABPEL-10902]: compilation failed
[Description]: in "bpel.xml", XML parsing failed because "undefined part element.
In WSDL at "http://hostname.domainname:portnumber/orabpel/domain/B/B?wsdl", message part element "{http://schemas.xmlsoap.org/ws/2003/03/addressing}MessageID" is not defined in any of the schemas.
Please make sure the spelling of the element QName is correct and the WSDL import is complete.
".
[Potential fix]: n/a.


What does the error mean?

When I opened up the WSDL from BPEL console I saw this.
The WSDL from BPEL console was looking like this http://hostname:portnumber/orabpel/domain/B/B?wsdl
With out the domain name.

Also when I opened the WSDL, the ws-addrressing was like this
<schema>
<import namespace="http://schemas.xmlsoap.org/ws/2003/03/addressing" schemaLocation="http://domainname:portnumber/orabpel/xmllib/ws-addressing.xsd"/>
</schema>


The domain name was missing from the import.

What does this mean?

As the domain was missing the server could not locate the import from ws-addressing.
And the namespace that was present right at the taop was
xmlns:wsa="http://schemas.xmlsoap.org/ws/2003/03/addressing"
wsa was refering to wsa:RelatesTo, wsa:MessageID and wsa:ReplyTo
All these should be failing one by one in trial to deploy to the server the BPEL process that tries to partnerlink B.

How to fix this?

The fix is as simple as changing the WSDL to have the complete domain name in hostname.

But how to do that?

The change is as simple as this.
Open up the file ${OracleAS_Home}\bpel\system\config\collaxa-config.xml

Change the following
Property name soapServerUrl

<property id="soapServerUrl">
<name>BPEL soap server URL</name>
<value>http://hostname:portnumber</value>
<comment>
<![CDATA[This URL is published as part of the SOAP address of a process in the WSDL file.<p/> The hostname and port for this URL should be customized to match the hostname of your system and the port of your HTTP gateway.]]>
</comment>
</property>

To
<property id="soapServerUrl">
<name>BPEL soap server URL</name>
<value>http://hostname.domain:portnumber</value>
<comment>
<![CDATA[This URL is published as part of the SOAP address of a process in the WSDL file.<p/> The hostname and port for this URL should be customized to match the hostname of your system and the port of your HTTP gateway.]]>
</comment>
</property>

Also change similarly in the next property
soapCallbackUrl

What caused the problem?

During install the hostname file had the server host name before the hostname with domain name causing all this error.
So be sure to install with care and check the host file before install. Even if you break it, you are sure now how to fix this, aint you!!

Tuesday, January 06, 2009

BPEL 10.1.3.4 Deployment Framework

Why I want to write this?

I wanted to find some quick start material for using BPEL deployment framework in 10.1.3.4
Damn I could not find any. Nothing that looked like a quick start thing.
And the worst part was the closest I could find was oracle documentation about it.

At least I could not google any thing even close
But neither of them helped me quick start like a quick list of things to do. :(

I hope this post comes up in google for the help of those who want it.

What is the first thing to do?

The first thing to do is edit your build.xml file
If you open up your BPEL project you will find that in Folder called Resources
If you are looking in the actual physical folder then you will find this in ${process.dir} (the bpel ant terminology)
Basically the top project folder where you find your jpr file.

Why build.xml first?

Fundamentals first, as you are going to use ant to perform deployment automation, you need to edit the build.xml file that ant uses.

Do what in build.xml?

You need to include the ant things that oracle has come up with.
Basically it has 4 things new
generateplan - to generate a brand new plan for you, isn't that cool
attachplan - to attach the plan to your jar while deplyoing
validateplan - to validate the plan, use for developement purpose only and disbale in PROD
extractplan - to extract the plan out from your jar file

Down to business in build.xml

how the hell to use these.
First things first. You need to create plan file as a starting point.
generateplan is the good thing that help you do this.

Stick this piece of code before the </project>

<target name="generateMyPlanFromProjectFile">
<generateplan planfile="${process.dir}/MyPlanFile.xml" verbose="true"
overwrite="true" descfile="${process.dir}/bpel/bpel.xml"/>
</target>


What this does is, generate a file called MyPlanFile.xml in your ${process.dir}

If you want to generate the plan file from jar file, you can stick this piece there as well.

<target name="GenerateMyPlanFromSuitcaseFile">
<generateplan planfile="${process.dir}/MyPlanFile.xml" verbose="true"
overwrite="true"
suitecase="${process.dir}/output/bpel_${BPELSuitcase.BPELProcess(id)}_${rev}.jar"/>
</target>

What this does is, generate the plan fuile from jar file.
Here the use of some things like ${rev} etc can found some where below in build.properties
For now just know that this will pick the correct jar

Basically stick both the pieces there.

If you have not yet complied to generate the jar, do not be surprised to see the GenerateMyPlanFromSuitcaseFile fail

What the hell do I do with this generateplan thing....

Well what else but run as ANT
Right click the build.xml in Jdeveloper, Open up Run Ant Target
Choose generateMyPlanFromProjectFile

JDeveloper should fire up and generate a file for you called MyPlanFile.xml
If you are not able to see that in Resources folder (same place where the build.xml is located) click refresh mate and you should see it

Congrats you have completed the first step easily

Changes in build.properties file

There is a file called build.properties in the same good old folder ${process.dir}
Open that up and see 2 properties called domain and rev
These are commented out by default

uncomment them and change them as below
#if domain name is "commmon" then type in common domain = ${enter the name of the domain yoiu want to deploy}
#if revision is 2.0 then type in 2.0 rev = ${version number of the bpel process}

Good with all this but where is the search and replace thing


Open up the MyPlanFile.xml and you should see some thing there.
Some thing like wsdlAndSchema

There is a element called search and replace

Need to fill this up to search and replace. Read the documentation to find how all to use it. This is the easy part aint it!! Just fill in some strings to test your code.

How to attach the plan

Stick this thing into the build.xml file

<target name="AttachMyPlan">
<echo> -------------------------------------------------------------- | Attaching the plan file ------------------------------------------------ </echo>
<attachplan planfile="${process.dir}/MyPlanFile.xml" verbose="true"
overwrite="true"
suitecase="${process.dir}/output/bpel_${BPELSuitcase.BPELProcess(id)}_${rev}.jar"/>
</target>

What this does is attach the plan file to your jar.

What about extract plan

I am not sure if you want this or not, but here is the piece of code

<target name="ExtractMyPlan">
<extractplan planfile="${process.dir}/MyPlanFile.xml" verbose="true"
overwrite="true"
suitecase="${process.dir}/output/bpel_${BPELSuitcase.BPELProcess(id)}_${rev}.jar"/>
</target>

Ya ya I know that you know what this does.

Now what else?

The last part, add the new target you added to the default target process-deploy

In the depends part of &lttarget name="process-deploy"
Add the target AttachMyPlan after complie

So the new target will look like

<target name="process-deploy"
depends="validateTask, compile, AttachMyPlan, deployProcess, deployTaskForm, deployDecisionServices"/>

Why Am I not adding the generateplan thing in there

Well you do not want to generate the plans always and over write the search and replace that you have read form the documentation and build

If you did then do not be surprised but only thing is I will be laughing ha ha ha :)

How to deploy to other Environments

Well that is for you to discover and explore
Just that you need to run this in dev prompt. Go to the same old ${process.dir} directory and run the ANT as
command promt>ant process-deploy

Congrats mate you have done it.
There are other few things that you can learn from the documentation if you are interested at all

Links that I liked

I could hardly google a lot of stuff for this.
The best is oracle documentation
http://download.oracle.com/docs/cd/E12524_01/relnotes.1013/e12523/bpelrn.htm#BABCEBAA

The next best I could find was
http://blogs.oracle.com/reynolds/2008/11/bpel_deployment_framework.html