Tuesday, 29 April 2008
Transferring files to vmware image
A workmate of mine told me that I should start using vmware server to be able to test several Oracle products. In this blog I will blog about my first steps on this path.
First of all I had to install the vmware software. Well that wasn't that difficult. Simply go to http://www.vmware.com/products/server/ register yourself and download the software.
Next step: install the software. This is not difficult as well. Just press [next] at lot of times. From the workmate I got an image with windows xp (and winzip!) on it. I started the image (double clicked the .vmx file) and pressed: Start this virtual machine. After a while the virtual machine was started. Then I faced my first problem. I wanted to install the Oracle SOA-suite. The day before I downloaded the software from otn.oracle.com. The zipfile was on my host machine (my laptop) but could not be accessed from the virtual machine. I could download it again of course but I thought there should be a better way. I had no internet connection as well at that moment. Installing a program like Filezilla is probably the smartest way of doing things like this, but no option at this moment because I had no internet connection.
Than I saw an option called CD-ROM on the VMWare Server Console. Double clicking on it gives you the option to select: [Use ISO image]. I pressed on the [browse] buttom after the option and I saw that I could browse to the file system on my laptop.
This was the solution. Using Nero I 'burned' an iso image from the dowloaded SOA-suite zip-file.
After that I started the vmware image with the iso file as cd-rom drive. This drive was available in the windows explorer on the virtual machine. I could unzip the SOA-suite zipfile and started installing the SOA Suite!
Wednesday, 2 April 2008
My vision on SOA
In the end of 2006 I've been asked to give a presentation on SOA in the Public Sector. There are many publications on SOA. They're all talking about (web)services, orchestration (BPEL) and maybe ESB. But at that presentation stated that I think SOA is really about one basic wisdom:

Tomorrow night I'll explain at our companies technite. But I'm happy to elaborate on this at your organization as well. Please contact us via www.darwin-it.nl.
Thursday, 20 March 2008
Leveraging your XWindows
So either you have to reroute the graphical output of your application to your XServer or you have to use a remote desktop application like VNC.
If you server does not support a VNCServer you are stuck to the first option (having to reroute the x-output to an xserver on your desktop). On a windows-machine you have to use an X-Windows emulater like cygwin. But on Linux you could do with your native XServer.
But I whished it would be as simple as that. In fact it is quite simple, but it turned out not by default. There are a few prerequisites to be met.
1. Your remote-server, which actually is the X-Client, should be setup to forward X.
You can verify this in the file /etc/ssh/sshd_config. There you should find the option:
X11Forwarding yes
In the wiki http://gentoo-wiki.com/HOWTO_X-forwarding you can find more info about that. But unfortunately you might not have the rights even to look into the file. So you probably need to consult your system's administrator.
2. Now you could try to log on to the server with a terminal session from your Linux (or XWindows emulator).
Run:
ssh -X user@remote-host
or
ssh -Y user@remote-host
The difference is that -Y is not secure while -X is. Be aware that -X is capital. Using the lower-case -x turns the X-forwarding off on your ssh-tunnel. To speed things up you could put a C after -Y or -X.
3. Verify your DISPLAY.
Step 2 actually should do the trick. But trust everything though verify your trust, by:
echo $DISPLAY
This should give you a line like:
localhost:10.0
The -X or -Y option should have set the DISPLAY for you. To test it you could run xclock on the terminal. It should display a graphical clock on your desk.
If your DISPLAY is not set then set it using the following:
export DISPLAY=your-desktop-ip:0.0
The ip of your desktop can be found by running
who am i
in the terminal. Also you could find it by opening a terminal on your local desktop and running ifconfig.
Retry running xclock.
4. Shields up eh.. Shields down
You might turn in to an error like:
Error: Can't open display:
Or another message that denotes that it can't get a connection to your Display.
The latter is simply solved by issuing:
xhost +
This allows all incomming X-requests. In stead of the '+' you could narrow it down by specifying the particular host-name.
Mark that when "ssh -X yourname@remotehost" did set your Display right, your working with X over an ssh tunnel and you should not need to have 'xhost +' issued.
5. Hey, put this shield down
I encountered that this still did not work in my case. I use a Ubuntu distibution using Gnome. And for distributions counts that the [xdmcp] functionality is turned off. XCMCP is the protocol that allows remote login via X. This is recommended since normally you do not want to have 'bad guys' hacking into your XServer. So every X-request is denied.
I solved this by editing my /etc/gdm/gdm.conf by:
sudo gedit /etc/gdm/gdm.conf
Find [xdmcp] and modify the Enabled property:
Enable=true
Then you need to restart GDM, either by logging off or restarting your machine.
Please do not forget to turn it to false after your finished your job!.
Try to do the ssh -X and set your display on your-ip-address:0.0.
Then xclock should work.
6. Hey, I said: put this shield down
After this it worked for me. But I turned of login-security in an earlier stage. So in Ubuntu (7.10 Gutsy Gibbon) goto System/Administration/Login Window. Go to the Security tab and switch of 'Deny TCP connections to Xserver' and the related checkboxes. This did not do the trick for me in the first place. But maybe this was because I did not restart GDM.
Also for this point counts: for your own safety please recheck the boxes afterwards.
Conclusion
At the end I got it working with a little help of my Google-friend. And then it turns out to be simple. So for your convenience and mine I put these steps together in one article.
Tuesday, 4 March 2008
Configuration of the FTP Synchronous Get and FTP Put adapters
But what if you don't know the filenames at run-time? Well then you can use the Adapter Header variable. But it turns out that the FTP Header does not provide means to give in the host, port, username and password at run-time. At default BPEL PM or ESB assumes that an adapter listens or writes to a fixed location.
Luckily it is possible to provide these at runtime. Doing so, you can create a generic FTP process. For Get-purposes you'll have to use the Synchronous get. The regular get is only usefull for polling adapters or when using Correlation-Sets.
I'll explain the configuration of the Synchronous Get service first. Then I'll explain the Put-service..
Synchronous Get
Create a partnerlink for a FTP Adapter. Accept the default JNDI name. Give it a proper service name, for instance: “FTPSynchGet”.
For the file-type choose “binary”, for the operation type choose “Synchronous Get File”.
For the directory name give a dummy directory, for instance “/tmp”. Uncheck the checkbox for deleting the file afterwards. (Probably we'll have to check it in the end solution, but for now I don't want it. It might be a good idea to have a deleting adapter and a non-deleting one if it is necessary to choose between these options).
Give the filename a dummy value, for instance “tmp.txt”.
Check the box “Native formatting is not required (Schema is Opaque)”.
Since it is a synchronous get, you have to invoke it, so use an invoke activity, and not a receive activity. The adapter wizard should have created a ftpAdapterOutboundHeader.wsdl. This is because the synchronous get is to be invoked having a header variable that specifies which file to get. By default the schema type that is created in it only contains a “fileName” element:

Copy the fileName element and name it “directory” to have it a directory entry also:

This seams to be a bug, the wizard won't create this element.
At the adapter-tab of the invoke activity properties define a header-variable based on the message-type in this wsdl. This variable can be used to define the input file and directory.
The FTPSynchGet.wsdl has a service with a jca:address that is based on a JNDI-location:
Replace this one to have it based on a ManagedConnectionFactory with mcf properties:

This way you can specify the the hosname, username and password on runtime with an assign statement.
To do this add an assign activity before the invoke. Add copy-rules to it for the host-name, username and password, where these values are fetch from a variable with an expression. This expression is based with on a bpws:getVariableData() statement within a string() function. The bpws:getVariableData() statement returns a XML-Node, but it needs to be serialized to a string using the string() function. The target should be the FTPSynchGet partnerlink with a bpelx:property. This bpelx:property should be one of:
jca.mcf.Host
- jca.mcf.Port
- jca.mcf.Username
- jca.mcf.Password

Then add an assign activity to copy the values for the filename and directory to the header variable.
FTP Put
The configuration of the FTPPut partnerlink is mainly the same as the configuration of the FTPSynchGet. Create a partnerlink, accept the JNDI location, choose File Type “binary”, Operation “Put”, give in a default directory and filenaming convention. It is then important to uncheck the “Number of messages equals” box. If you don't, the wsdl wil contain the attribute 'NumberMessages="1"' in the jca:operation element. This will lead into the error:
ORABPEL-11061
Batching is not allowed if dynamic directories are specified.
Batching is not allowed if dynamic directories are specified.
Please ensure that parameters such as NumberMessages, ElapsedTime or FileSize are not defined in the case of dynamic directories.
Removing the attribute will solve this.
Finish the wizard, with choosing an opaque schema.
Also in the FTPPut.wsdl the jndi-location in the jca:address should be replaced with the ManagedConnectionFactory like in the FTPSynchGet.
Add an invoke activity for the FTPPut partnerlink, and define a header variable on the adapter-tab, based on the message type in the ftpAdapterOutboundHeader.wsdl.
Then you can add comparable assign statements for the Hostname, username, password, filename and directory as described with the FTPSynchGet.
Don't forget to assign the Base64-encoded value to the input variable of the invoke of the FTP Put. For example the value of the outputvariable of the invoke of the FTPSynchGet.
Excuse me for the small screendumps. The Blog has some difficulties with XML-fragments.
Thursday, 28 February 2008
VMNet1 not up after Hibernate
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 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="0.0.0.0" request="0.0.0.0"
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
Ias.properties
I also edited the ias.properities in
But that did not do the trick.
There is also a setting IASname. Since I'm renaming my AS, I changed that one too.
ohstarget.xml
In the
Also it had a attribute "AssocTargetInstance" with the application servername. Changed that one too, conform the ias.properties.
opmn.xml
Since I'm changing my AS also, I also have to change the ias-name in the opmn.xml.
collaxa-config.xml
In
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
ESB
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.
Conclusion
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
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.
