Problem scenario :
I was in the process of replacing a particular table in the database with a new table (table name and attribute names changed). Correspondingly this involved creating new Entity Object, View Object, Entity Associations and View Object links. This meant replacing the old associations that are present in any of the VOs with the new ones.
As part of this, all required attributes from the EO need to be shuttled properly to be present as part of the VO. The catch here is, if the EO has any transient or calculated attributes, then these should not be shuttled into the VO. If you happen to do this, you are bound to hit the above exception when testing the VO:-
(oracle.jbo.AttributeLoadException) JBO-27022: Failed to load value at index 19 with java object of type java.lang.Long due to java.sql.SQLException.
Solution :
Remove the extra transient attributes (in the VO) that were added from the EO.
The VO test should now pass fine. The number of attributes in the Select clause of the VO object query and the number of attributes in the VO should potentially be the same!
The below link provides some more useful information on the same front :-
http://oracle-hack.blogspot.com/2009_05_01_archive.html
Saturday, May 21, 2011
Sunday, April 24, 2011
Removing hard coded set-attribute in EOImpl
I was faced with the below issue and posted it on several forums :-
Some EO's in my application have hard-coded setAttribute in order to get around an ADF issue where we have these transient attributes for EO assocations, but they don't show up on newly created rows.
For example:
protected void create(AttributeList attributeList) {
super.create(attributeList);
this.setAttribute("TransientAttribute1","SOME_LITERAL_VALUE1");
this.setAttribute("TransientAttribute2","SOME_LITERAL_VALUE2");
this.setAttribute("TransientAttribute3","SOME_LITERAL_VALUE3");
}
Our requirement is to get away with this method and instead achieve the above using either groovy expression or derived from sql expression. Using this, the values of the Transient attributes show up as null currently. We need to have the literal values show up on creating a new row.
Finally, what worked for me was :-
I had the setAttribute in the EOImpl file removed.
Instead I had the literal values set in the 'Literal' window and the 'Derived from SQL expression' window.
The test cases for most entities passed fine.
I added tests in entity unit tests to test the default values for common association attributes in case of new row creation as well as fetch row from DB. They worked perfectly fine in both cases
Some EO's in my application have hard-coded setAttribute in order to get around an ADF issue where we have these transient attributes for EO assocations, but they don't show up on newly created rows.
For example:
protected void create(AttributeList attributeList) {
super.create(attributeList);
this.setAttribute("TransientAttribute1","SOME_LITERAL_VALUE1");
this.setAttribute("TransientAttribute2","SOME_LITERAL_VALUE2");
this.setAttribute("TransientAttribute3","SOME_LITERAL_VALUE3");
}
Our requirement is to get away with this method and instead achieve the above using either groovy expression or derived from sql expression. Using this, the values of the Transient attributes show up as null currently. We need to have the literal values show up on creating a new row.
Finally, what worked for me was :-
I had the setAttribute in the EOImpl file removed.
Instead I had the literal values set in the 'Literal' window and the 'Derived from SQL expression' window.
The test cases for most entities passed fine.
I added tests in entity unit tests to test the default values for common association attributes in case of new row creation as well as fetch row from DB. They worked perfectly fine in both cases
Monday, April 11, 2011
Recursively copying files along with directory structure in linux
Although this is something relatively simple, sometimes doesnt work correctly especially if you're trying it after a long time. You could be faced with errors like :
cp: cannot create symbolic link , etc.
If you wanna copy say, multiple files along with directory structure from
/ab/cd/ef/gh/ij/kl/mn/op/qr/st/uv/*
to
/aba/cdc/efe/ghg/iji/klk/mnm/opo/qrq/sts/uvu/*
then typically
cp -R /ab/cd/ef/gh/ij/kl/mn/op/qr/st/uv/ /aba/cdc/efe/ghg/iji/klk/mnm/opo/qrq/sts/uvu/
should work good for you.
The entire list of files along with the directory structure, gets copied at the destination location. It is important here to give the complete paths for source as well as destination instead of trying to use relative paths!
cp: cannot create symbolic link , etc.
If you wanna copy say, multiple files along with directory structure from
/ab/cd/ef/gh/ij/kl/mn/op/qr/st/uv/*
to
/aba/cdc/efe/ghg/iji/klk/mnm/opo/qrq/sts/uvu/*
then typically
cp -R /ab/cd/ef/gh/ij/kl/mn/op/qr/st/uv/ /aba/cdc/efe/ghg/iji/klk/mnm/opo/qrq/sts/uvu/
should work good for you.
The entire list of files along with the directory structure, gets copied at the destination location. It is important here to give the complete paths for source as well as destination instead of trying to use relative paths!
Thursday, March 24, 2011
Installing and using ScrumWorks on Linux
ScrumWorks is an agile management software by CollabNet meant for an enterprise and comes in 2 flavors : ScrumWorks Pro and ScrumWorks Basic.
To run Scrumworks on your linux box, you need to install the server.
a. Download the ScrumWorks Basic Linux distribution file from the download site.
b. Extract the file in the directory you want to install ScrumWorks Basic to.
c. Change to the directory that was created during extraction.
d. Run ./setup.sh to configure your server and get instructions for starting it.
A pre-requisite to do the above installation is to have JDK already installed on your machine. However, right now, apparently, Scrumworks Basic only supports JDK2. Higher versions are not supported yet. So, you need to have version 2 necessarily installed for sure!!
To run Scrumworks on your linux box, you need to install the server.
a. Download the ScrumWorks Basic Linux distribution file from the download site.
b. Extract the file in the directory you want to install ScrumWorks Basic to.
c. Change to the directory that was created during extraction.
d. Run ./setup.sh to configure your server and get instructions for starting it.
A pre-requisite to do the above installation is to have JDK already installed on your machine. However, right now, apparently, Scrumworks Basic only supports JDK2. Higher versions are not supported yet. So, you need to have version 2 necessarily installed for sure!!
Sunday, February 27, 2011
Error 46 initializing SQL*Plus HTTP proxy setting has incorrect value SP2-1502: The HTTP proxy server specified by http_proxy is not accessible
I hit the above error when I was trying to startup the zipdb installed on my linux box, after a system reboot. What I precisely did to get rid of this error and successfully start the Db is:-
1. Unset the environment variable http_proxy
2. Set / Export the variable http_proxy to http://localhost.
That worked and....the zip db was UP and RUNNING!!
1. Unset the environment variable http_proxy
2. Set / Export the variable http_proxy to http://localhost.
That worked and....the zip db was UP and RUNNING!!
Friday, February 18, 2011
Installing sqldeveloper on a linux box
To install sqldeveloper on a linux 64 bit machine, follow the below steps:-
1. Download the sqldeveloper rpm.
2. Install the rpm using the command 'rpm -ivh'
3. If you're not logged in as root user, you could encounter an error like
error: can't create transaction lock on /var/lib/rpm/__db.000. In this case log
in as root used and retry the installation.
4. The sqldeveloper mostly gets installed at location
/opt/sqldeveloper/sqldeveloper and can be invoked using the command :-
/opt/sqldeveloper/sqldeveloper.sh
5. A pre-requisite to install and run the sqldeveloper in your linux box is to
have jdk installed. At the time of invoking sqldeveloper you might come across a
warning message which reads :-
'Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will
be stored in ~/.sqldeveloper/jdk'.
6. In such a case you need to quit and put in the path of the jdk install location
in the 'SetJavaHome' variable inside a file called sqldeveloper.conf.
(Sqldeveloper software or other softwares meant for linux boxes are packaged in the rpm file format. RPM typically stands for Red Hat Package Manager / RPM Package Manager)
1. Download the sqldeveloper rpm.
2. Install the rpm using the command 'rpm -ivh
3. If you're not logged in as root user, you could encounter an error like
error: can't create transaction lock on /var/lib/rpm/__db.000. In this case log
in as root used and retry the installation.
4. The sqldeveloper mostly gets installed at location
/opt/sqldeveloper/sqldeveloper and can be invoked using the command :-
/opt/sqldeveloper/sqldeveloper.sh
5. A pre-requisite to install and run the sqldeveloper in your linux box is to
have jdk installed. At the time of invoking sqldeveloper you might come across a
warning message which reads :-
'Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will
be stored in ~/.sqldeveloper/jdk'.
6. In such a case you need to quit and put in the path of the jdk install location
in the 'SetJavaHome' variable inside a file called sqldeveloper.conf.
(Sqldeveloper software or other softwares meant for linux boxes are packaged in the rpm file format. RPM typically stands for Red Hat Package Manager / RPM Package Manager)
Friday, February 4, 2011
My first look at Soa Composite Applications
The basics of a Soa-composite application :-
A composite.xml is a file that is automatically created when you create a SOA project. This file describes the entire composite assembly of services, service components,references, and wires that make up a Soa composite application.
The following are the four basic components of a Soa-composite application
* Service Components - Once you create your application, often the next step is to add service components that implement the business logic or processing rules of your application. You can use the Component Palette from the SOA Composite Editor to drag and drop service components into the composite.
* Service Binding Components - You add a service binding component to act as the entry point to the SOA composite application from the outside world.
* Reference Binding components - You add reference binding components that enable the SOA composite application to send messages to external services in the outside world. (The reference binding components should be services with wsdl's created either by you or someone else on a local or a remote machine which can be given a reference to, from your application)
* Wires - You wire (connect) services, service components, and references. For this example, you wire the web service and service component. You cannot wire services and composites that have different interfaces. For example, you cannot connect a web service configured with a synchronous WSDL file to an asynchronous BPEL process

The adjacent figure shows a diagrammatic view of a bpel process

This figure shows a diagrammatic view of the composite.xml file
Oracle SOA Suite Service components:
*Oracle Mediator
*Oracle BPEL process
*Human workflow (using a human task)
*Oracle Business Rules
*Spring
*Oracle User Messaging Service
*Oracle Business Activity Monitoring
*Oracle Metadata Repository
A composite.xml is a file that is automatically created when you create a SOA project. This file describes the entire composite assembly of services, service components,references, and wires that make up a Soa composite application.
The following are the four basic components of a Soa-composite application
* Service Components - Once you create your application, often the next step is to add service components that implement the business logic or processing rules of your application. You can use the Component Palette from the SOA Composite Editor to drag and drop service components into the composite.
* Service Binding Components - You add a service binding component to act as the entry point to the SOA composite application from the outside world.
* Reference Binding components - You add reference binding components that enable the SOA composite application to send messages to external services in the outside world. (The reference binding components should be services with wsdl's created either by you or someone else on a local or a remote machine which can be given a reference to, from your application)
* Wires - You wire (connect) services, service components, and references. For this example, you wire the web service and service component. You cannot wire services and composites that have different interfaces. For example, you cannot connect a web service configured with a synchronous WSDL file to an asynchronous BPEL process

The adjacent figure shows a diagrammatic view of a bpel process

This figure shows a diagrammatic view of the composite.xml file
Oracle SOA Suite Service components:
*Oracle Mediator
*Oracle BPEL process
*Human workflow (using a human task)
*Oracle Business Rules
*Spring
*Oracle User Messaging Service
*Oracle Business Activity Monitoring
*Oracle Metadata Repository
Subscribe to:
Posts (Atom)