extract() function gives a ‘problem’ whith spaces and lines in XML

I was developing a dequeue function for an XML file and I wanted to check if a certain returned value from the xml file was correct.
To retrieve the value of a tag I used this=>
v_text := v_record.extract(‘/record/Fruit/text()’,’xmlns=”http://www.example.org”‘).getStringVal();

Ones I captured this record I wanted to check if the content of this tag was equal to, for example, some fruit, let’s say ‘Lemon’.
In most of the cases I received the correct result, but there were some xml files which didn’t gave me the correct result. Nevertheless I was pretty sure that the value in my xml file was ‘Lemon’.
So what happened? I did some checks and then I found out that the syntax of this specific xml file was something like this:

When extracting the content out of the Fruit tag he also took the spaces, tabs and lines with it, and that was the reason why he thought that this wasn’t a ‘Lemon’

Conclusion, always use trim for the spaces and put some replace clauses for lines and tabs round the value. So you should use something like this:
v_text := replace(replace(replace(trim(v_record.extract(‘/record/Fruit/text()’,’xmlns=”http://www.example.org”&#8216;).getStringVal()),chr(10),”),chr(13),”),chr(9),”);

How to find the Oracle Application Server version number

I remember that I was searching a few years ago for a way to find the exact version of the Oracle Application Server, but I didn’t found it.

Today I had to search for this again and now I found a file that contains the exact version and even will be updated when the iAS is patched.

The file to look for is ias.properties, in this file you have to look for the line that begins with Version, next to this you will find the correct number.

You can find this file in iAS-home\config

How to enlarge the disk size of a VM drive?

For a client of ours we had to create a test in VMWARE but at a certain moment we noticed that the VM was running out of space, so we had to try to enlarge the disk size of the VM.

It is rather simple if you know it. In fact it is just an .exe file that you will have to run.

The steps:
Look in your VM for the VM that you want to enlarge.
Select it and double click on the disk that you want to enlarge.

Now you get the properties of this disk, remember the disk file and go to your explorer window and go to the directory of this VM, just to make sure that this file really exists.

If you are working on windows open a dos cmd(Start -> Run)
For the solution read more…

Now go to the VMWARE program directory in windows this is something like C:\Program Files\VMware\VMware Workstation
In this directory you will have to start the script that will enlarge the disk space of your VM-drive.

The command will look like: vmware-vdiskmanager.exe -x 19GB “F:\VMWare\Webcenter\test.vmdk” where 19GB will be the new size of your VM-drive.
You will see an indicator with the percentage of growth.

With this exe file it is also possible to shrink, create, defragment, rename, … VM-disks

ESB error [TOPLINK-3001]

This is an error where I have been working on for too long.
And in fact it has a very easy solution.
I was building my application that I already mentioned in a previous post.
When I tested the xsl file(in the xsl file right click and choose test), everything looked fine and no problem occurred.
But when I deployed the application into my application server and I wanted to upload the content of the csv file into the database, I always received an error.

For the solution read more…

This was the error I received:
nested exception is: ORABPEL-11616 DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [DBTank.PersonFuelCosts]. Caused by Uitzondering [TOPLINK-3001] (Oracle TopLink – 10g Release 3 ( (Build 070608)): oracle.toplink.exceptions.ConversionException Omschrijving uitzondering: Het object [50,1], van klasse [class java.lang.String], kon niet worden geconverteerd naar [class java.math.BigDecimal]. Interne uitzondering: java.lang.NumberFormatException. at oracle.tip.adapter.fw.wsif.jca.WSIFOperation_JCA.executeRequestResponseOperation

Reading this error message I believed that there was something wrong with the translation from my csv content into the database, and that this was caused by a declaration in one of the xsd files. The type of the variable in the xsd file in the csv file was a ‘String’, but for the xsd file for the database adapter the type was ‘decimal’.
I replaced the types in the xsd files with different kinds of other types, but this didn’t changed a thing, I still received the error message.
After a lot of searching and testing I found out that, when I changed the value in the csv from 56,2 into 56.1 everything worked fine.
Strange thing is that my DB reads ‘,’ and not ‘.’ .
Ones I found this, the workaround was rather easy to find.
On my xsl file I used a function to replace the ‘,’ by a ‘.’
This function can be found in the ‘Component Palette’ where you have to choose ‘String Functions’ and select the ‘translate’ function.
Ones this was done I managed to get the data correct into my database.

Empty error message for instance in ESB

Yesterday I was creating an ESB that we wanted to use in a demo.
I was using a DB schema that I exported from a DB that was used in one of our internal applications.

The ESB itself was in fact a very simple example with just a file adapter to get the content of a csv file and a database adapter for inserting the content retrieved from this csv into the database.
I also checked the option to remove the csv when it was successfully retrieved.
Everything looked fine and I registered the application onto the application server.

So far, so good…

The application was registered without any problems and I wanted to test my application.
So I created a test csv file and copied it in the directory, waited 5 seconds until the file was removed, so I tought that everything worked correctly. I looked in the database, but my records where not inserted in the table.

Time to take a look at the ESB controller…
And indeed the status of my instance was invalid, so the next step to do is to take a look at the error message….
Strange, the error message was completely empty, no error, no trace, nothing…
This made it off course a bit more difficult to find out what the problem was.

So I took a closer look on this and tried to find out what I missed. I changed some things here and there, but did not found a solution, I always got the empty error.
Then I looked a bit closer to the table where I wanted to insert the data into and compared it with the content of the csv file. All the values of my csv for the primary, foreign, not nullable columns looked ok.

So why did he gave me that empty error message?
Then I tried to insert a record manually into the table, and I found out that this didn’t work either. Seemed that there existed some insert triggers on this table that would insert some data in a column when this field was empty and that these triggers used a packaged that was invalid(because it was using another schema that I didn’t imported). So just for testing I enabled all these triggers and tried to execute my esb process again. And it worked, so the problem I had was caused by a trigger on the table who was calling a procedure in an invalid package…

So, if you ever get an empty error message, the best thing to do is to check your database first…

Oracle Webcenter technical workshop (part 2)

As promised here is the continuation of the technical workshop we have followed.
In this text I will talk about how we created a little appliciation in Webcenter with some build in features of webcenter. In most part of the exercise we used ADF to build this, but we have also build in some out-of-the-box portlets of webcenter such as the Omniportlet and the Rich Text Editor Portlet but this will be discussed later.

I will go into detail on the real webcenter development and I will not go into detail about the not really webcenter related issues(this is not a step by step guide)

If you want to know more about this, you will have to read further

First thing we had to do of course is to open Jdevelopper, since this is the (free) tool which is used to create the webcenter portlets – portals. The version we need for using Webcenter is jdev (or later).

Then we had to create a new application. If you want to create a porlet application you have to select Webcenter Application(Portlet, content Repository,JSF) as application template.
This will not only create a new application for you, but it will already contain some structure to build your pages – portlets in. The structure contains 3 ‘directories’: Model, ViewController and Portlets. As we have already mentioned webcenter uses the MVC ADF framework. The next thing was creating a portlet. We had to right click the portlets ‘directorie’ in the application navigator and then choose the option below Web Tier -> Portlets which was ‘Standards based Java Portlets(JSR-168) the other option is the Oracle PDK-Java Portlet (this is based on the Oracle portal API’s).

Next thing we had to do in the creation wizard was to select the web application version. We had the choice between j2ee 1.3 and J2ee 1.4

We also had to give in some names, titles, keywords,… and we had to make a choice which portlet modes we wanted to use(possibilities are: help, about, config, preview, print, view, edit and edit_defaults), for this exercise we only choose view, edit and edit_defaults. For each of these 3 modes a different jsp will be build.

In this wizard you will also have to create the parameters if you want to use some in your portlet.

Once finished, our first portlet was created. But before deploying this we had to create a link to an application server and a deployment file.

In this version of jdev there is a preconfigured OC4J for webcenter. So we used this container to deploy our application on, we didn’t had to install the webcenter suite for testing our portlets. You first have to start this container, this can be done by clicking the green light on the top right of the menu in Jdev.

Hint, when creating a connection you should use 22667 as RMI port, this is the default RMI port for the webcenter container.

Once your portlet is deployed into your OC4J you can find the WSDL URL by using http://localhost:6688//portlets/wsrp2?WSDL.
We have now created a portlet but we don’t have a page to publish it on. Therefor we had to rightclick the Viewcontroller ‘directorie’ in the Application navigator and choose New. Once again you will have to choose a technology, in this case we had to choose JSF JSP(Web Tier -> JSP) .
A wizard opens and we choose jspx (xml version of a jsp page). In the wizard we selected the needed libraries(adf faces components,adf faces html,customizable components, jsf core, jsf html) since we were going to use some parts of all these libraries we selected them all.

So now we have a portlet and a page, but how do we have to include this portlet into the page? Well we have to register the portlet into the oracle Webcenter framework. Go to the Application Navigator and right click the Viewcontroller and click new. Select WSRP Producer Registration(Web-Tier -> portlets). In the next wizard you will have to give in the WSDL URL(see above). Once you have selected all the other attributes you click finish and your portlets is registered.

Now you just have to drag and drop the portlet into the jspx file. Therefor you have to open your jspx file and then select your producer in the Component Palet and drag and drop your portlet into the application.

Conclusion: I believe that there is a good future for this product it has lots of options and lots of potential, but you have to get used to all the possibilities of it and where you have to select what… But I believe that you really can create some nice working portal pages after a few days. If you want to learn more about ADF or webcenter there is only one option, start using it! I really got interested in it maybe you do too…

Oracle Webcenter technical workshop (part 1)

On the 17th of april we where invited to join a technical workshop about Oracle Webcenter for partners at Oracle DeMeern near to Utrecht (Holland).

We wanted to know what Webcenter really could do for us, and what the capabilities are, and of course what the next generation of Webcenter would look like.

Well, we came back full of enthusiasm and the will to explore and look deeper in the webcenter technology.

Read further …

What have we seen during that day?
First of all we got an introduction about all the different layers on which the webcenter framework was build.
And we also saw that webcenter uses several known standards like wsrp, jsr168, jsr170, web 2.0 …

They explained that the Webcenter framework uses Oracle Metadata Management (MDS). This is an XML based repository that stores all kinds of application metadata. In the version we use now this is file based, but in future versions the user will have the choice between file and database based storage.
Webcenter is the first tool in the fusion stack that uses MDS but in the next releases this will also be used for other tools.

In Webcenter it is also possible to use existing portlets/pages/… Therefore you will have to use the ‘Federated Portal Adapter’.
The other way round is also possible, by using the ‘JSF Portlet Bridge’. This will make it possible to publish any portlet created in webcenter to a portal (e.g. oracle portal) that supports jsr168.

The main subject of the day was the JSF part. Oracle uses their ADF framework for creating these kinds of applications.
Not being a real java expert, I really enjoyed working with this tool and the fastness of creating little applications with it.
In the webcenter there are already a few build in portlet applications like the rich text editor, omniportlet which we already knew from the oracle portal.

We also saw how the future of webcenter possible would look like.
First of all the UI of the portlets will look much flashier with more use of AJAX, dhtml,…
It will also be possible to change pages on the fly and there will be more drag and drop functionality.

Last but not least, we also discussed the positioning of the product, particularly against the oracle portal. This was a tricky one, but I kind of know now how I have to position it now. If you want to use open standards and you don’t mind to create applications (almost) from scratch (apart from the already build in applications like rte, omniportlet,…) this is a very fast and good development tool!

One of the next days we will handle the practical part of this day, to give you a glimpse on how webcenter works.

To be continued…