Tuesday, June 16, 2009

SOA Suite's JMS adapter connecting to web logic queue

These are the configuration changes you need to do in order to make your JMS adapter working with weblogic queue.

1.>copy weblogic.jar in the
$ORACLE_HOME/j2ee//connectors/JmsAdapter/JmsAdapter directory

weblogic.jar can be found in following directory of weblogic installation

bea/weblogic92/server/lib

2.>Change Server.xml

It can be found in following location

SOA_HOME/2ee/oc4j_soa/config

Add the property 'environment-naming-url-factory-enabled="true"' in the
server.xml config file for your instance for any application that includes weblogic.jar from WebLogic 9.x

So your server.xml should look like this after making the changes



xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/application-server-10_1.xsd"
localhostIsAdmin="true"
application-directory="../applications"
check-for-updates="adminClientOnly"
deployment-directory="../application-deployments"
connector-directory="../connectors"
environment-naming-url-factory-enabled="true"
schema-major-version="10" schema-minor-version="0"
>

3.>Add connection factory properties in your oc4j-ra.xml as per examples given below

a)FOr queue




b)For Topic




Now we have some unknown properties over here

1>global-jndi-name-of-your-non-XA-jmsconnectionfactory-in-weblogic

2>your-server-name

3>port number

4>username

5>Password

We will take each of them one by one.

1>global-jndi-name-of-your-non-XA-jmsconnectionfactory-in-weblogic

By default the connection factory in a weblogic is xa enabled.

To verify this Go to your JMSModule

Select the connection factory

Click on Transaction tab




Click on lock and edit tab on left most tab and uncheck the xa transaction

SAve the changes and restart the server.YOu need to start your managed server.

so now the transaction is non xa.

Now the conenction factory which have enabled for non -xa we have to choose the jndi name of that particular connection factory as the global-jndi name of connection factory




2>your-server-name

It is obvously the server name or you can also use the ip address for the server.

3>port number

This is confusing.We have to use the port number for managed server and nor Admin server.It is very common question as we are creating the queues in admin server then why we are using the managed server port number.The reason is that if you will choose the target for that queue/connection factory it is managed server only so the port number will be the managed server port number.

4>Username

It will be the user name with which you log in to weblogic console.

5>password

Same for passsword.

so once these steps are comleted all the configuration steps are completed.

now we will go ahead and deploy a simple process from jdeveloper.

How we create a connection with weblogic in jdeveloper i have already covered in my very first post.

So now we will check what all parameters are required in jdeveloper to successfully deploy this process.

We always come across one common issue in jms adapter i.e.

The Adapter Framework was unable to establish an outbound JCA connection due to the following issue: ORABPEL-12141
ERRJMS_CONN_FAC_NOT_FOUND.
Unable to instantiate connection factory. JMS adapter was unable to look up the connection factor NotificationSenderQueueConnectionFactory neither through JNDI nor instantiate it as a Java class


nested exception is:
ORABPEL-12511
Adapter Framework unable to create outbound JCA connection.

If you will follow all the steps as per mentioned you can avoid these errors and finally see your message in JMS queue.

SOA Suite's MQ adapter

In order to create an mq adapter from SOA suite and connect to mqseries queue.You may need to do the following.

Copy the file com.ibm.mq.jar to $ORACLE_HOME/bpel/lib

(You can download the same from IBM site or if you have MQ software it can found in following directory com.ibm.mq.jar - located in the $MQ_HOME/Java/lib)


GO to server.xml

and make an entry for shared library

shared-library name="oracle.mqseries" version="10.1.3">
code-source path="ORACLE_HOME/bpel/lib/com.ibm.mq.jar"/>
/shared-library>


Go to following location

SOA_HOME/j2ee/container name/application-deployment/default/MQSeriesAdapter/oc4j-ra.xml

YOUr oc4j-ra.xml will be having following entry

imported-shared-libraries>
import-shared-library name="oracle.bpel.common"/>
import-shared-library name="oracle.xml"/>
/imported-shared-libraries>

YOu may need to add the following library file in order to have the ma adapter working



So now it should look like

imported-shared-libraries>
import-shared-library name="oracle.bpel.common"/>
import-shared-library name="oracle.xml"/>
import-shared-library name="oracle.mqseries"/>
/imported-shared-libraries>


Now if you will check your oc4j-ra.xml you will find following entries in that

connector-factory location="eis/MQ/MQSeriesAdapter" connector-name="MQSeriesAdapter">
config-property name="connectionFactoryLocation" value=""/>
config-property name="hostName" value="myhost"/>
config-property name="portNumber" value="1414"/>
config-property name="queueManagerName" value="Queuemanager"/>
config-property name="channelName" value="myChannel"/>
config-property name="userID" value=""/>
config-property name="password" value=""/>
config-property name="clientEncoding" value=""/>
config-property name="hostOSType" value=""/>
config-property name="xATransaction" value="true"/>
connection-pooling use="private">
property name="waitTimeout" value="300" />
property name="scheme" value="fixed_wait" />
property name="maxConnections" value="50" />
property name="minConnections" value="0" />
/connection-pooling>
security-config use="none">
/security-config>
/connector-factory>


So this is it you need to make changes in these files and you are good to go.

config-property name="hostName" value="myhost"/>

here in place of myhost you have to specify the name of the system in which mqseries is running.

config-property name="queueManagerName" value="Queuemanager"/>

Queuemanager should be replaced with the name of your queue manager name.

the port number by default is 1414 only

config-property name="channelName" value="myChannel"/>

you have to define your channel name in the myChannel field.

If you don't have a channel you can use the default value as

config-property name="channelName" value="SYSTEM.DEF.SVRCONN"/>

Once these changes are done you may comment out the other connections

After that you need to restart your server in order to make these changes.

now you can create a simple bpel process to enqueue/dequeue message in queues in MQ

provide you have a running queue manager and queue available.


While creating adapter connection through adapter configuration wizard you need to provide the same connection factory as you have specified in oc4j-ra.xml and the name of the queue as in MQSeries.

Deploy the process and invoke it .you can find the message enqueued in Mq queue.

Thursday, June 04, 2009

How to apply MLR ,OPATCH related issue

MLR's are merge level request on top of basic installation.

10.1.3.1 SOA Suite,10.1.3.3 SOA Suite ,10.1.3.4 SOA Suite are patch set.

Applying MLR on top of patch set means applying bug fixes for some issue.

Each MLR contains almost more than 20 bug fixes.

That is why it is always recommended to be on the latest release because it will always provide you bug fixes for many issues.


so if any one want to start i would recommend to use the latest version.

There are few things to note that

it is recommended to have the version of jdeveloper and SOA Suite in sync i.e if you are using 10.1.3.4 version of SOA Suite then you must be using 10.1.3.4 version of jdeveloper also.




Regarding application of MLR
================================

A lot of issues are faced while applying MLR however it can be removed if you will follow all the pre and post installation steps and keep in mind few things.

So the first important thing to keep in mind is

When ever you download a MLAR from metalink ,never extract in a folder which has blank space

e.g if you will extrace the Patch in a folder like "Latest MLR" the opatch will not work.

YOu should extract it in a folder which has no blank space in between so you can use either of the two option

LatestMLR or Latest_MLR

The next important thing to keep in mind is the version of opatch.

YOu might often get some error like

Opatch_java_error=Opatch Exception While Trying To Check For Mini Patchset

This occurs if you don't have the right version of the opatch.

so once you will apply MLR you migh get some error like this and it will point you to a document 224346.1 which can be accessed via metalink.

So follow the document and use the Opatch accordingly.

So if you fulfill these condition you are good to go.

now we will see how to apply MLR
===================================

First of all we will download the MLR in a folder and extract.

then in the command console we will move up to the MLR number

The patches are generic but you need to change the platform id in

following file

Patch/etc/config/inventory

platform id

By default it is set to 0 ,you need to change it according to your Platform id

OPATCH_PLATFORM_ID

Let suppose if i have downloaded MLR#7 then in the command window i will navigate to MLR number like this.




The next step is to set the oracle home and set the oracle Path.

If you are using windows then the commands will be like

set ORACLE_HOME=Path to SOA home

set PATH=$ORACLE_HOME\OPatch;%PATH%

SOA_home is the path up to the directory where opmn folder exists

and if using Linux it will be like this

export ORACLE_HOME=Path to SOA home

export PATH=$ORACLE_HOME/OPatch:$PATH


I have done it diffently and have given the whole path to OPatch.YOu can do it as per your wish

Once completed the path set up you have to do Opatch lsinventory in order to check if the inventory is good or not to apply MLR.



Please make sure that you are not giving semicolon after setting oracle_home

if you will use semicolon after setting oracle home it will not work

you have to do it exactly as shown in the diagram.

so we will rum opatch lsinventory.

It will give you the details of which OPatch version the installation is currently using and whether Opatch succedded completly or not.








so once opatch lsinventory works fine you are good to go ahead and apply the patch so go ahead and use the command

opatch apply



So now i believe you can go ahead with this because it will only ask you to type yes Y

once done your opatch is applied.

Thats the overall process of applying patch.

There are more issue in opatch but may be i will cover it later.For the time being keep applying patches. ;)

Just one important point about 10.1.3.3.1 bundle patch set

All MLR also include previous Bundle Patches , so you only need to apply the latest MLR on top of the main AS 10.1.3.3.0 Patch Set or any previous 10.1.3.3.1 MLR.the OC4J version is 10.1.3.3.0 so don't confuse you can apply any MLR on top of 10.1.3.3.0.It is not necessary to apply 10.1.3.3.1 bundle patch set and then apply any MLR.


If you want to rollback MLR you can use command

opatch rollback -id patch number.

Yes do follow the readme for pre and post installation task for any MLR

Monday, June 01, 2009

How to configure a two node SOA Cluster(BPEL)-HA

It is really easy to set up a two node cluster if you will follow all the steps which i have followed.However it too me very long time to set up a cluster.I have set up a cluster for bpel and i believe it will be helpul for you.

I have done active-passive mode of clustering.

The basic requirement for cluster is that we should have two nodes and one loadbalancer to route the reuest.

It will be pretty much clear with the screen shots

SO as per requirement we will first of all install two instances of SOA Suite.


Installing SOA instance 1



I am giving the installation directory for first node as Machine1 and choosing advanced installation.

Once you provide these details and say next. A pop up window will come and ask if you want to revert to basic installation.Just say you want to continue with advacned installation only.



When choosing the installation type you have to choose it as j2ee server type because we are basically installing the container only.We will be first doing the container clustering then on top of that we will install bpel and do bpel clustering.




Now in the port configuration option choose the defualt value automatic



Next is the important step.Provide the instance name and password
keep in mind that you have to deselect the option

Configure this as administtation oc4j instance.

this is because we will be using active passive mode of clustering so we will be having only one admin console(em) for monitoring.




Need not set vaules in cluster topology configuration so leave it blank





Say next and install the product




Following screen will come up and finally the installtion wizard will complete succcessfully and end.





and finally





Great one instace is completed.Now we will do the installation of another node

Install SOA Instance 2

This installation is again the same however we will be enabling the application server control on instance two

Once again start the installtion wizard



Choose your installation directory and select advanced installation.



Again check the j2ee server type for installation.




Leave the port configuration page untouched and say next




Now in Administrator setting you need to notice one important thing that you have to configure this as adminsitrataion oc4j instance

so you have to select the option in the installation .Check the screenshot you will understand.



Leave the next screen untouched and say next



Install the product



Just check out the consecutive screen and finally exit screen will come.






AS soon as you will install this a page will be opened automatically and wil show the page oracle container for j2ee now you can go to application server control which you might not have got in installation of node 1.

Now we have the two nodes set up so we will go ahead and install a loadbalancer.

Use the same installation wizard as we are using web cache as load balancer.



In the installation type choose web server as an installation type.



Leave the port configuration page untouched and say next.



Provide some name in instance name list and say next



Leave cluster toplogy page untouched and install the product.













Great so now we have two nodes and a load balancer .Now we will start our clustering

We will be doing our server clustering first of all and for that we will use static node list toplogy.There are other topology also but I prefer to use static node only.

Openup our opmn.xml for all the installation

It will be in the following location

SOA_HOME/opmn/conf/opmn.xml

And here you have to check for the attribure “remote”

This is basically the port for remote listening

So for me the results are


For instance 1(D:\product\10.1.3.1\Machine1\opmn\conf) remote port is 6204
Example




check in the same way


For instance 2 remote port is 6205

For loadbalancer remote port is 6206

Now we have to add each element to each of the server.

That is in node one we have to add the entry for node 2 and node 3 and so on.

We have to add the host name and port number

It will be more clear with the screen shot

See if my initial opmn.xml looks like this





Since this is for node 1

We will be adding the following property inside
Tag

Also keep in mind the application server should be up and running at that time.


And now it will look like this




you have to use your own host name and remote port ;)

I have used both the remote and host address as same as I am setting up a cluster in same machine ,if you are using a different machine please change the remote address accordingly.



now restart your server

by stopping



and then starting also check the status



Do the same for other two nodes also



Now for instance 2




we will be adding the other tow nodess



restart second node also

opmnctl stopall



start-opmnctl startall
the check
opmnctl status



Now for node 3

The initial screen is like





after adding the values




So once done setting for node 3 also .

Restart the node 3 also and do opmnctl status @cluster to check if you can see all the three nodes in up and running state





Great now we have configured our oracle AS cluster now we will be modifying our oc4j instacnes so that our routing from loadbalancer to the two nodes is enabled.

We will be using apache Jserv protocol for loadbalancing.For more information on AJP you can refer to the wiki document

http://en.wikipedia.org/wiki/Apache_JServ_Protocol


In order to change we will modify the opmn.xml for machine 1 and machine 2 to use AJP port range and listen for AJP and not for http request.

So for the node1 first

The opmn.xml will initially look like





We will change the http to ajp as shown




After that restart the machine 1 by issueing

Opmnctl stopall
Opmnctl startall

For the second node also we will do the same and restart the server.

Do opmnctl status and open up the console in browser.

You should get a screen like this.You now need to open your em console with loadbalancer url




Now we will be Creating a new group

Log on to em console

IN the group subsection click on create






do the same for other node also and then you should be able to see screen like this



Once group is created ,shut down one of the node and apply bpel process manager stand alone on top of the node which is up and running.

So start installing BPEL 10131 on top of AS

YOu have to run the irca schema first before installing the BPEL because it creates the dehydration store.i have alrready discussed how to run irca schema

Irca schema

Install location/bpel_oc4j\install\soa_schemas\irca


but for continuity i will do it again.

open up a command console and navigate up to Install location/bpel_oc4j\install\soa_schemas\irca

set your oracle home and set your SID



Run the irca schema by typing irca.bat it will ask for the database address




So provide the database details then it will install the three components orabpel,oraesb and orawsm .

It will ask for the password for each instance.In my case however you will find it is asking if you want to overwrite the exisgting schema,it is because i have already ran the irca schema so it is asking for overwriting.

I will say yes and provide the password for all the three schemas.










Once you will give the password for all the schemas it will create the corresponding tables and finally you will get the result like



so now schemas are created so now will isntall bpel on top of our application server.

We will isntall bpel on top of both the application server.

So just start the installation .exe for bpel




We will give the oracle home as the Oracle home of the application server.



Choose oracle application server for middle tier as option




Leave the next page blank





Provide the details of the database



Provide the administrator password and give the http url of the loadbalancer URL


As loadbalancer will now be redirecting to the corresponding console as per load.




now after doing that say next and install




It will isntall the corresponding components on top of application server




Finally end of installtion.




Great in one node bpel is installed ,we will do the same for other node,The only difference will be that the oracle home will be different.



Rest of the steps are same as we have done for the other node.

there are few more configuration we need to check

one at collaxa-config.xml and another is at jgroups-protocol.xml

We define the cluster propery at collaxa-config.xml and the protocols at jgroups-protocol.xml

will explain them in detail later.

Now we will be upgrading 10.1.3.1 to 10.1.3.4

Again start the installation wizard and point the oracle home to the oracle home of one of the node.




Say next and it will summarise the component list




Say next and configuration wizard will come up.




finally end of installation and your bpel and application server is now upgraded to 10.1.3.4





The same steps we have to do for other node also,the only change is the oracle home will be now for the other node.


we have the latest MLR#7 on top of 10.1.3.4.We will apply the same on both the nodes.


Navigate up to the patch number in command prompt.

SEt the ORACLE_HOME and PATH and do opatch lsinventory



once opatch lsinventory runs fine do opatch apply

Once opatch is applied go ahead and follow the post installation task as mentioined in the readme of the patch.

Unfortunately i didn't take the screen shot of opatch apply and its result but i will update it in some later post.

Since we are dealing with bpel only we will upgrade the schema of bpel only.




Once completed for both the nodes.your work is over you have a bpel cluster latest ;)

keep deploying BPEL process on cluster.