Thursday, 28 February 2008

VMNet1 not up after Hibernate

The vmnet configuration of VMWare Server in (Ubuntu)Linux is quite rudimentary. It is done using a script whereas in Windows you'll lucky to have a nice configuration screen.
I regularly just wrap-up my wrap-box (in Dutch I tend to call my notebook 'klapdoos') after work. I configured it such that it will hibernate my Linux.
But after resume I experienced that the VMNetwork is not up. That is quite inconvenient, because I would have to restart my machine and then suspend or start my VMware images. I need the VMNet1 (host only) often because I let several VM's work together and I connect to the machines using jDeveloper, sqlDeveloper, etc. from my host. Or Pl/Sql Developer on another VM.

Luckily I found on an Ubuntu forum a simple command to startup the vmnet's again:
ifconfig vmnet1 up

So I created a simple script VMNetup:
ifconfig vmnet1 up
ifconfig vmnet8 up

I put the script in /usr/lib/vmware/lib and added the command
"sudo /usr/lib/vmware/lib/vmnetup" to my System Tools menu. I set the type on 'Application in Terminal' since I have to give in a password for the sudo command.

Now with a simple menu click and a password my problem is solved.

Thursday, 21 February 2008

SoaSuite in VMWare

I work with VMWare for some years now and I do all my Oracle installations in a VMWare Image. I only have the necessary tools on my Host-OS (which is Ubuntu Linux for a few months now), but I keep my Host-OS clean from larger installations.

I used to work with a jDeveloper in the VM that also contains my SoaSuite installation, but today I tried to connect from a jDeveloper on my Host OS to a SoaSuite in a VM. Somehow it did not work. After struggling with it for some time, I found on a forum the solution.

Although I did not have firewalls on my Host or on my Guest OS (hmmm. apparently I have a security-to-do on my Host) I kept on getting a connection error in my jDeveloper on testing the connection. So it should be something on ip-filtering. And it was. Apparently opmn only accepts connections from localhost. You can however specify another ip-address that it should accept, or leave it open for every ip-address. This is done by editing the opmn.xml.
In there you'll find the tag notification-server, within that element you'll have to add a ipaddr-element:

That is:
ipaddr remote="" request=""

This got me a little further. But since there is a connection then somehow jDeveloper is going to setup an RMI connection with OC4J. And that fails because it tries to connect with the servername within the VM. Since this VM is a clone, this servername is some generic one that I do not have in my host-file. So the connection still fails.

There are few things I tried to solve this.

Apache Servername
In Apache the old servername is also set. Go to Apache/Apache/conf and edit httpd.conf. Search for the setting ServerName and change the servername. In http connections Apache will do url-rewrites with this servername.
I also edited the ias.properities in /config. There you have setting "VirtualHostName". I changed that one.
But that did not do the trick.
There is also a setting IASname. Since I'm renaming my AS, I changed that one too.

In the/Apache/Apache/conf there is also a file called ohstarget.xml. It contains a attribute "HTTPMachine" that contains the hostname. But changing that also did not solve my problem.
Also it had a attribute "AssocTargetInstance" with the application servername. Changed that one too, conform the

Since I'm changing my AS also, I also have to change the ias-name in the opmn.xml.

In /bpel/system/config you'll find collaxa-config.xml. In this configuration you'll also find some occurences of the host name. These are particularly important because they're used to rewrite urls from bpel in HA configurations. But also in our case.

Sever's hostname
One thing I had left: the name of the host itself. I changed that one (in Linux you can do this in the network-settings; in Windows you have to change it in the system properties.) After that you have to reboot (or restart the networkservices, rebooting is easier).

If you have your database on the same server then you should change your listener.ora. You'll probably find it in /network/admin. Change the hostname there, otherwise your tns-listener won't start.

I found that there was still one problem with ESB. When you deploy a routing service, it get's a wsdl with an import. In this import "localhost.localdomain" as an url is inserted. When you try create a partnerlink in BPEL Designer on the wsdl, it will not be able to load and interpret it.

The solution is as often very simple. I looked into about every config-file in the Oracle_home. This did not help me much since the problem was in the database.
Open with an query tool (sqlplus, sqldeveloper, pl/sqldeveloper, toad) the database user oraesb. It contains a table called "ESB_PARAMETER". Contains parameters and one of them is "DT_OC4J_HOST". Change the value of it from "localhost.localdomain" (or whatever the original host name was) to your new host name.

After that you apparently had to re-register your esb-services, since with me it did not change the wsdl's right away. I deleted them first and then re registered them again. Then I was able to create a BPEL PM Partnerlink on it.

I renamed my whole Soasuite Application server and it works! And I can connect to it from outside my VM.

Thursday, 14 February 2008

Search BPEL Instances

In de blog of Clemens Utschig - Utschig he explains how to search for bpel process instances based on the index-columns.

It is possible to fill in one of 6 user-keys in a bpel process. This can be done in a piece of embedded java in BPEL. For this the api call setIndex(1, index1); exists.
The same way you can set the title, with the API setTitle(newTitle); .

I created a sample BPEL project for it with an embedded java step. Follow this link to view it.

The bpel-processes are stored in the table CUBE_INSTANCE in the ora_bpel schema in the database. The indices are stored in the table CI_INDEXES. If your number of processes grows you should put indexes on the columns of this table, since by default there aren't any.

To search for the bpel processes I created a JSP. I did it a little more straight forward then described in Clemens' blog, since I wanted to be able to search on all processes and indexes over all the domains. (And I had some trouble with the api's...). So I did just a query on the tables in the database.

Also I found in some logs of some faults that contained the Correlation-id. So I made my JSP be able to search on that column too.

Follow this link for the jsp-source.

Wednesday, 13 February 2008

Let the panes reappear in jDeveloper

Oh, how I struggled to get my log-messages-pane in jDeveloper to reappear. For some time (actually since I got my new Laptop from my new employer) I'm working with Ubuntu. And one of the problems I had with the move from Windows is to get jDeveloper working as it should: somehow I lost my log-messages-pane. Although I choose view->log many times, it did not reappear. On the jdeveloper forum I found at the end a thread solving this, right after I posted a question about it myself (yes, I did search the forum first, but just not thorough enough):

The solution is:
Search for the windowinglayout.xml. In my case it was found in:

After renaming/deleting it, I could get my log window again.

One remark: jDeveloper saves the file after closure. So first close jDeveloper and then remove the file.

Another: the tilde '~' stands for the current user's home folder under Linux. So under windows search for the jdevhome under 'My Documents' or Application Settings.

Wednesday, 6 February 2008

AIA XSL and Xpath functions in jDeveloper

Using Oracle Application Integration Architecture, you can use some custom xpath and xsl functions that are created for the Oracle AIA foundation package.
To use them it is convenient to have them available in the expression builder of jDeveloper.
To enable this lookup note 550378.1 in metalink. There you can download a zip that has the aia.jar and a setup script to copy that to the right place in your jdeveloper home and register it.

Monday, 4 February 2008

Doing ebMS Ping Pong

The ebXML is an upcoming B2B standard that is supported by Integration B2B. I think it is groing in importance. Check out for more info.
Actually ebXML is a set of standards of which ebMS describes the transport layer. One great feature of the ebXML standard is that it describes a ping functionality. You might think "Oh right, what's so cool about ping? We have that for ages in TCP/IP.". But this is a ping on a different level, since ebMS is a protocol that lies on top of http and uses SOAP. The standard also describes functionality like Multi-Hop, that provides the possibility to send messages to the tradingpartner using intermediate message-brokers. This is especially handy in those setups where a group of tradingpartners have to work together and all have their own security architecture with firewalls, etc. Without an intermediate broker all tradingpartners have to know the ip-addresses and ports of all the other tradingpartners. With an intermediate broker all have to know only the ip-address and port of the intermediate broker and once connected to this broker a tradingpartner is logically connected to all the other connected tradingpartners.

But then it is particullarly handy to check if two tradingpartners can exchange messages without affecting the "business", thus without having to send a "real" message with fictive test-date.
Sending a ping message to a tradingpartner with a B2B gateway that supports the ebMS ping-functionality will let the remote B2B gateway respond with a "pong" message.

Doing the setup in B2B
Each trading partner on both sides have to have a Collaboration Protocol Agreement (CPA) implemented with the same Agreement ID. I won't explain how to do that here, since that is part of the normal B2B course. For Axway/Cyclone that is the whole trick, for Integration B2B a few additional steps has to be done.
First create a new business-action called "Ping". Create a document type "Ping" attached to it, with a revision "1.0". (The name business action is important, the name of the document type and revision is not).
At the document definition fill in the following parameters (without the enclosing double-quotes):
  • Document Routing ID: "EBMS_PO"
  • Service: "urn:oasis:names:tc:ebxml-msg:service"
  • Identification Expression (XPath) for XML Document: "/*[local-name()='Ping']"

Add this business action as a supported business action to the capabilities of the remote tradingpartner. You could add it both for initating and responding actions. Mark that since this is a special message in itself that does not need an acknowledgement, you could set the acknowledgement mode to "none".

Then add the supported business actions as a participant to the agreement and validate and deply that agreement.

Now you could test this by enqueueing a message on the ip-in-queue with dbms_aq.enqueue using the parameters as configured.
The responding pong message is found in the wiremessage-report. Unfortunately the wiremessages report does not show the actions.

Advanced Ping
At my current customer we have a tradingpartner that has actually two endpoints on two different locations. We implemented that as a tradingpartner with two agreements and two separate routing-id's.
We used to have the ping action added to both agreements. But trying to ping this tradingpartner gives the error "tradingpartner agreement details not found". Off course, because B2B does not know what agreement to use for the ping and thus it also does not know which routing id to use.
So I solved this first to remove the ping-participants from one of the agreements.
Then I created a new business action named something like PingACME. I created the document type and document definition just like I described above for the "normal" ping. The document definition has another parameter set however:
  • Action Name: "Ping"
Then add this one also to the capabilities (initiating and responding) of the trading partner and add it to the other agreement as participants (the one from which the normal ping-participants were removed). When the agreement is redeployed than also the second agreement can be used for a Ping, by using PingACME as a business action.

This trick can also be used if you want several business actions with different document type settings but that have to result in the same ebMS-action.