Thank you for visiting! If you liked the site, please add a bookmark, else add a critical comment! Would you like to visit Greece? Traditional Greek flag This real estate site is only available in Greek! The holy mountain

Wednesday, 29 December 2010

Setting up Oracle service registry 11.1.1

db options screen shot

Last time  I attended the Oracle day in Athens, Greece, I was impressed by a presales consultant stating that the real difficulties of SOA projects arise not in the first project, but in the second. That is when there is already a prebuilt foundation of services, on which one needs to base the  new applications of the second project. This is the time to prove whether the initial design is worth of the effort, time and money spent.You have guessed  it right, it is all about agility, adaptability to business, or IT changes, and service reuse!
In this new post the installation traits of  Oracle service registry 11.1.1 will be mentioned. No need to clarify the purpose of existence of a service registry within the scope of SOA in this post. You might consult the current SOA governance literature, take for instance chapter 9 of: http://nickaiva.blogspot.com/2010/12/comments-on-ws-bpel-20-for-soa.html as an introduction. I quote some text: "In addition to reuse, a service registry can also be helpful when we need to migrate services from one server to the other. This can happen because of various reasons,
but one of the most common reasons is the migration between the development, test, and production environments. A service registry is also helpful when we need to version services and manage changes. With a service registry, we can also develop more loosely coupled composite applications, because we do not need to hard-code the service URLs. Rather, the application will resolve URLs at run time.
"
Let's now proceed with the setup. The first  installation attempts failed with rather cryptic error messages. Well, another personality trait which is very important to programmers and pretty scarce to find, is not being too lazy to type a helpful error message, when exceptions occur. So, the technical data follow:

OS is windows 7 64bit, not officially tested by Oracle at present

DB version is 11.1.0.6.0 64bit

Java version 1.6.0_20 64bit

JDBC driver at C:\app\Nick\product\11.1.0\db_1\jdbc\lib\ojdbc6.jar


The log output follows:

Expanding C:\Users\Nick\Downloads\ofm_osr_generic_11.1.1.2.0_disk1_1of1\oracle-service-registry-11.1.1.jar to C:\Oracle\Middleware\registry111 ...
Building scripts ...
Platform is Windows
Preparing 'admin' account ...
Preparing account_list ...
Preparing permission_list ...
Preparing approval management ...
Creating standalone configuration ...

Java returned: 1
Installation failed. If accessible, see "C:\Oracle\Middleware\registry111\log\install.log".
To correct installation parameters and resume installation click Recovery.


Next come the contents of C:\Oracle\Middleware\registry111\log\install.log:
#
#Tue Dec 28 15:42:49 EET 2010
db.system.name.condition=oracle
install.server.operator.name=Oracle
oracle.database.admin.password=***
oracle.database.datafile=uddinode.dbf
oracle.server.host=hera
oracle.database.admin.user=system
install.server.smtp.port=25
oracle.database.password.confirmation=***
install.http.connector=8081
alldb.create.datasource.name=jdbc/registryDS
install.server.smtp.password.confirmation=***
install.server.admin.mail=nickaiva@
install.os.is.win.andcondition=true
create.desktop.icons=no
porting.standalone.http.port=8080
oracle.database.tablespace=uddinode
install.server.smtp.default.sender.name=
install.server.smtp.password=***
porting.https.use=yes
alldb.install.registry.name=Oracle Service Registry
account.backend.type.condition=database
install.server.smtp.title=
install.server.admin.name=admin
alldb.create.datasource.weblogic=no
security.ssl.password=***
alldb.install.demo.data=no
install.server.admin.password.confirmation=***
security.ssl.username=uddiadmin
dist.version=11.1.1
install.server.smtp.default.sender.email=
porting.standalone.https.port=8443
alldb.create.datasource=yes
alldb.jdbc.custom.uribox=no
install.type.condition=standalone
install.server.smtp.host=[ SMTP server hostname ]
alldb.install.demo.data.settings=
create.menu.items=yes
alldb.create.drop.condition=createComplete
oracle.database.name=orcl
install.directory=C\:\\Oracle\\Middleware
registry111
install.server.admin.password=***
oracle.server.port=1521
db.showall.condition=false
alldb.jdbc.custom.urifield=
alldb.jdbc.drivers.paths=C\:\\app\\Nick\\product\\11.1.0\\db_1\\jdbc\\lib
ojdbc6.jar
porting.hostname=hera
security.ssl.password.confirmation=***
porting.type.condition=jetty
install.server.smtp.account.name=
oracle.database.user=uddiuser
install.windows.menu=Oracle Service Registry 11.1.1
oracle.database.password=***
[echo] Expanding C:\Users\Nick\Downloads\ofm_osr_generic_11.1.1.2.0_disk1_1of1\oracle-service-registry-11.1.1.jar to C:\Oracle\Middleware\registry111 ...
[echo] Building scripts ...
[echo] Platform is Windows
[echo] Preparing 'admin' account ...
[echo] Preparing account_list ...
[echo] Preparing permission_list ...
[echo] Preparing approval management ...
[echo] Creating standalone configuration ...

[java] BUILD FAILED
[java] C:\Oracle\Middleware\registry111\etc\setup\database.xml:737: The following error occurred while executing this line:
[java] C:\Oracle\Middleware\registry111\etc\setup\database.xml:339: The following error occurred while executing this line:
[java] C:\Oracle\Middleware\registry111\etc\setup\database.xml:422: The following error occurred while executing this line:
[java] C:\Oracle\Middleware\registry111\etc\setup\database.xml:207: The following error occurred while executing this line:
[java] C:\Oracle\Middleware\registry111\etc\db\oracle\installOracleDB.xml:99: The following error occurred while executing this line:
[java] C:\Oracle\Middleware\registry111\etc\db\oracle\installOracleDB.xml:166: Java returned: 1

[java] Total time: 4 seconds
Java returned: 1
Installation failed. If accessible, see "C:\Oracle\Middleware\registry111\log\install.log".
To correct installation parameters and resume installation click Recovery.


However many times one tries, with the options selected as shown in the db options screen shot, the installation fails due to some build error of the db scripts. Although the installation appears to have failed, the db uddiuser schema has been actually created. On the contrary, some people report that one is better off to create the schema on his own, as you can see in the references. Thus, when one runs installation the next time, having selected an existing db schema "Connect to schema" option, all appears to go well. Well, not everything! If one uses jetty instead of weblogic server, the create data source option does not apply. Therefore, one needs to uncheck the selection, in order to avoid receiving a "Cannot obtain new connection" exception.
The morale of the story is quite obvious, if related to the introduction of the current post: the first time is just the basis, the second time is what matters most. Happy new year to you all!


Further references:
http://www.javamonamour.org/2010/05/trouble-installing-oracle-service.html
OSR - Oracle Service Registry won't create database datasource

Tuesday, 21 December 2010

Comments on WS-BPEL 2.0 for SOA Composite Application with Oracle SOA Suite 11g, by Matjaz B. Juric, Marcel Krizevnik


On the bright side, the text is written in American English, formal, well organized and neat, having the last sentence of each paragraph linking to the following one. Although the title sounds pretty familiar, the content of the book is actually about the newer version of BPEL 2.0. That's what makes this particular book unique, as the time of this writing. I quote: "Oracle SOA Suite 11g PS2 supports BPEL 2.0. However, BPEL 2.0 is only supported at runtime and not in JDeveloper. BPEL 2.0 support in Oracle SOA Suite 11g PS2 is not yet production ready, so by default, BPEL version 1.1 is used. However, we can write BPEL 2.0 code in text mode (graphical mode is currently not supported)." This book will help readers utilize BPM suite for integrating BPEL with BPMN. Readers will be able to explore BPEL 2.0 activities, loops, decisions, flow control, variables, scopes and other constructs that will enable them to develop BPEL processes. The authors dig into advanced BPEL topics, such as fault handlers, event handlers, compensation, concurrent activities, links, correlations, message properties, dynamic partner links, process lifecycle, and more. The text is accompanied by two online appendices about the syntax of the BPEL versions 1.1 and the newer 2.0, the  full source code, in addition to a sample chapter and its table of contents, which can be found here. Furthermore, the authors use UML sequence, activity diagrams to describe the composite applications, which is useful to the analysts and designers and scarce to find in competitive books.
On the dark side, there are a few spelling errors, the first 3 chapters are rather tedious to read, since there is no hands on practice, nor questions and answers for the reader to exercise.  The action starts in chapter 4 and forward on. However, there  is only purely descriptive text, with no full, step by step detailed instructions how to build from scratch the application, or how to setup the SOA suite. In addition, parts of the application source code is given as is, i.e. java classes, without any explanation how it was created, or how to deploy it correctly; For example, EmployeeTravelStatus,  in chapter 4, should perhaps be deployed as a shared library, or a stand alone application? 
All in all, the book is a complete and detailed treatise on BPEL 2.0, presenting its origins, other BPEL servers available in the market such as tibco, exotic themes such as Oracle service registry, Business process architect, and so on. Its project is an application about employees travel requests and booking the cheapest available ticket offered by the airline companies,  etc. The book is no introduction to BPEL, but of fairly advanced level, since drag and drop operations are rarely mentioned, the authors prefer to edit the source BPEL and XML code directly, which can be error prone, especially for beginners. Its source code is full of advanced java classes, so developing web services using java, XML basics, look like  prerequisites.
Further references:
You can visit the book page at the publisher's site

Monday, 22 November 2010

SOA: Decoupling the database adapter service from the BPEL process

BPEL process
In this article a common source code reuse problem will be brought to the SOA level, using a small demonstration example based on the SOA 11g Handbook chapter 7 source code. Please bear in mind that in order to fully comprehend the content of this post, one needs as a prerequisite, knowledge of xsd and web services wsdl files. The JDeveloper 11g IDE will be used as in the book, but NetBeans could well be another alternative for your SOA development,  which also supports the 64 bit java JDK, or Eclipse Helios,which is preferred by many big organizations, such as the current European Commission IT projects. So try them all to decide on your own whichever suits you best!


Consider for instance a standard JEE web application which requires access to a database. Using the hard coded jdbc connection string to provide the connection details, requires editing the source code, compiling , testing and redeploying, when a new database is provided or the application needs to become distributed. On the other hand, using a jdbc data source, permits the reuse of the code only with modifying the relevant deployment descriptors by the web administrator.  This analogy exists also in the example SOA application, which requires database access , and will be presented next.


composite.xml
The sample medical examination booking application is about querying a database table based on the   the patient identifier (ID), or the patient names in order to query another table and retrieve its hospital record; as shown in the picture of the BPEL process. The initial BPEL process with direct calls to the Database Adapter Services RetrievePatientIdentifier and RetrievePatientRecord is not presented. The XSD and WSDL created for the Database Adapter Services were tied directly into the BPEL process, which means tight coupling. The text of the SOA 11g handbook only guides to the first step of decoupling one DB adapter. Now, as you can see in the composite.xml image, only one   mediator (purple) exists to decouple the DB from the bpel process, the other DB adapter is rather hastily, directly connected to the   bpel process.
This semi decoupled situation is actually presented as an anti-paradigm or anti-pattern. That is, an example case, that you should avoid by all means, since you must abandon the simple drag and drop operations, you now need to manually edit the xml files to solve the problem of fully decoupling. The  steps necessary to decouple the second db adapter follow in brief. The final bpel process we are to implement  and the final composite.xml is shown:

final form of BPEL process


final form of composite

If you 'd rather not delve into the manually editing details, you can consider the following steps as optional, skip them and jump to the next horizontal line to read the two last paragraphs. This is a very long post after all!

Well, if you insist on going beyond drag and drop operations, here is a way of doing it:
First, start  by creating the XSD definitions for the PatientDataService.xsd:

 <schema targetNamespace="http://stmatthews.hospital.com/patient/PatientDataService"
        xmlns:hospital="http://stmatthews.hospital.com/patient/PatientDataService"
        xmlns="http://www.w3.org/2001/XMLSchema">
  <element name="PatientDataServiceProcessRequest"
           type="hospital:patientIdType" />
  <element name="PatientDataServiceProcessResponse"
           type="hospital:patientType"/>

  <!--Add on the 2 following elements  for decoupling-->
 <element name="PatientRecord"
           type="hospital:patientType"/>
  <element name="PatientIdentifier"
           type="hospital:patientIdType"/>
  ...

Based on those, it is easy to create the Mediator and its WSDL as shown.





Next, you need to edit the PatientRecordProvider.wsdl file, so that you don't get this screen shot when you wire the mediator to the db adapter, to the bpel process and later insert the new assign and   the invoke activities:



old type is now wrong

<?xml version= '1.0' encoding= 'UTF-8' ?>
<wsdl:definitions
     name="PatientRecordProvider"
     targetNamespace="http://stmatthews.hospital.com/patient/PatientDataService"
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:inp1="http://stmatthews.hospital.com/patient/PatientDataService"
     xmlns:tns="http://stmatthews.hospital.com/patient/PatientDataService"
     xmlns:out1="http://stmatthews.hospital.com/patient/PatientDataService"
    >
    <wsdl:types>
      <schema xmlns="http://www.w3.org/2001/XMLSchema" >
        <import namespace="http://stmatthews.hospital.com/patient/PatientDataService" schemaLocation="xsd/PatientDataService.xsd" />
      </schema>
      <schema xmlns="http://www.w3.org/2001/XMLSchema" >
        <import namespace="http://stmatthews.hospital.com/patient/PatientDataService" schemaLocation="xsd/PatientDataService.xsd" />
      </schema>
    </wsdl:types>
<!--replace RequestMessage with patientRecordRequestMessage
    and refresh the variables in the assign and invoke windows
    to get the patientIdentifier appear instead of the older patientQualifier -->
    <wsdl:message name="patientRecordRequestMessage">
        <wsdl:part name="request" element="inp1:PatientIdentifier"/>
    </wsdl:message>
    <wsdl:message name="replyMessage">
        <wsdl:part name="reply" element="inp1:PatientRecord"/>
    </wsdl:message>
    <wsdl:portType name="patientDataServices_ptt">
        <wsdl:operation name="getPatientRecord">
            <wsdl:input message="inp1:patientRecordRequestMessage"/>
            <wsdl:output message="inp1:replyMessage"/>
        </wsdl:operation>
    </wsdl:portType>
</wsdl:definitions>

Next you declare the new patientRecordRequestMessage type to be used, so:





Thus, you now get to this screen shot instead of the old, wrong one, which shows the patientIdentifier (ID):


The process goes on, you delete the old wire, the old invoke and assign activities, insert new as shown in the final form of the bpel picture, and edit their properties to define the parameters correctly, to avoid such failing build messages:
...
     [scac] FATAL_ERROR: in PatientDataService.bpel(168): wrong messageType
     [scac] messageType "{http://stmatthews.hospital.com/patient/PatientDataService}requestMessage" of variable "Invoke_PatientRecordProvider_getPatientRecord_InputVariable" does not match the expected     messageType "{http://stmatthews.hospital.com/patient/PatientDataService}patientRecordRequestMessage" in <invoke>
     [scac] Make sure the correct variable is used in invoke

BUILD FAILED

that is, if you follow the screen shots:

new invoke properties
Create the mediator xsl files:


Delete the old transform, insert a new one and edit as shown:



Create the xsl mappings:


You end with deployment and testing  the composite, as shown:



The question surely arises: is it really worth bothering to edit  all those xml files, is it not error prone? I quote: "The Mediator has several functions that all help promote decoupling and agility. It maps from the canonical data structure to the potentially very specific schema for the adapter service, possibly including any value conversions that may be required. When the Database Adapter Service is replaced by a different service implementation, hence with new WSDL and XSD definitions, the BPEL process is unaffected, because the Mediator shields it from these changes. When the data is for some reason distributed over multiple databases, and based on some patient property we have to determine which of those databases to access, the Mediator will take care of this content-based routing. In addition, the Mediator can handle problems with availability of the database service, retrying calls or taking alternative steps. Moreover, the Mediator may present what is a synchronous service through an asynchronous interface, which allows a client such as a BPEL process to continue with other, parallel activities or to be dehydrated altogether to free up resources after the call is made, instead of blocking the thread waiting for the reply, which could take fairly long."
Finally, the gist of this post is:  BPEL processes should never call to adapter services directly. There should always be a Mediator in between. Sooner or later the need to decouple will arise, if you design correctly straight from the beginning, you won't waste your time and effort. So, next time you are about to wire a database adapter, think twice!

Further references

http://oracle-fusion-blogs.com/oracle-fusion-osb-mediator/

Wednesday, 27 October 2010

Comments on Oracle SOA Suite 11g Handbook, by Lucas Jellema

On the bright side, the book offers a plethora of web resources, apart from the textbook itself. The online supplements are actually a way of previewing it by studying the material mentioned, before buying the book. The text is well organized with a few spelling errors.  It delves deeply into XML code details, such as creating the xsd files and editing them. The historical review serves well as an introduction, presenting both the evolution of technologies and relevant acronyms, such as SLA, SCA and so on. Moreover, the step by step guidance offered, is most of the times, easy to understand and follow. Furthermore, some parts  of the source code is available online, including the intermediate steps. The chapter about complex event processing is remarkable, however one needs Eclipse Galileo, not Helios, to follow the hands on guidance.
On the dark side, some sections are too long to read. Once you are done with the printed text, the online supplements must follow. Besides, the huge volume of information is often hard to manage, therefore rather messy. Some parts of text are duplicated,  some others missing. For instance, on page 74 it reads: "Details for the configuration of JMS, JDBC, and UMS can be found online in Appendix C." which has been actually until recently missing. In chapter 7  some errors are reported, due to missing steps, or xsl files and a misleading image, but not yet confirmed. In addition, parts of the source code are missing, like the XML file SimplePatient.xsd mentioned on page 109. Moreover, some spelling errors are critical, omitting an 'a' from 'asynchronous', surely changes the meaning! Some crucial xpath expressions have typographical errors as well. Web services presented in the text such as ConsultWithHealthInsurers in chapter 11, are not implemented. Furthermore, in chapter 13, page 448: "The wiki provides configuration details for setting up a local e-mail server with these domains and accounts based on the JavaEmail project" but  no such details actually existed until recently. Such errors, or missing information prevent the reader from completing the practice, build the necessary self confidence and continue. Unfortunately, the source code for chapters 10 and above has not been  available until recently,  due to broken links.The code for chapter 15 is still missing. Although most times  the known bugs of soa suite are mentioned, this is not true for the ADF service data objects examples of chapter 20.
All in all, the text is of average quality, the author has striven to equally balance the theoretical and practical  views of the subject. It offers an introduction to XML, XPath too, some of hands on practice. Hence, the book is definitely among the top choices for the reader who would like an introductory book, but clearly inferior to  the Getting started with SOA 11g, as far as quality and precision of hands on practice is concerned. As far as quantity, the difference in number of pages speaks for itself!

Monday, 18 October 2010

JDeveloper 11g: Making use of Http Analyzer for testing and debugging

Anyone who has  developed a JEE or SOA application, sooner or later faces some kind of unexpected, or strange behaviour  of the system under development. However helpful the audit process screens of the weblogic server, once you enter and submit the sometimes numerous input values, one is not allowed to tamper with the request values anymore; you just wait  until you get hopefully a response, or an error. An interesting , but often overlooked, alternative is  Http Analyzer. It lets you save some time, by copying the request so that you don't have to enter all values from scratch, you can edit the value of interest and resend your modified request. Let's see some specific examples.

Setting up the browser

In order to quickly set it up, you go to "Tools" menu and click on "Preferences" in JDeveloper 11g as shown in the image. You need to copy the "Listen on port" value, which is 8099. Next,  you need to setup the browser of your choice. The images below show the screen shots for Mozilla Firefox, I suppose finding your way in IE or other browser won't be such an onerous task!

Again click on "Options", then on "Advanced", "Network" and lastly on "Settings" to reach the connection settings window as shown . You need to select "Manual proxy configuration", enter your computer name, and paste the port number you copied before, i.e 8099. The "No proxy for" section must not contain any entries, such as localhost, nor 127.0.0.1, because in that case Http Analyzer will only analyze your internet requests! When you are done with debugging, you might need to  reenter here your old values. That means you need to save them, i.e in a new back up text file! For an alternative more elegant configuration using profiles, you can consult the JDeveloper documentation, by searching for"Configuring External Web Browsers"



Testing a trivial ADF form
Next, you start the  application, using the "Run project" button, and click the "Start HTTP analyzer" button. The small  form of the ADF ejb bidding application window appears. You should now see the output in the log window. If you enter the form values and submit, the HTTP analyzer captures all submitted values. You can now copy the request,  edit only the bidder's name for instance, and resend.

Testing a plain SOA component
For the second example, you need to reenter your old settings to your browser(i.e. No proxy). The request values will be submitted by JDeveloper itself, by right clicking on the service, as shown.
Here a US stock exchange price in dollars, i.e. for OTE or GE, is converted into a different currency, i.e. EUR or GBP for British pounds.  You can see the request and response values as well. As mentioned before, you need to copy the request, modify only where necessary and resubmit.
Although the  examples given are deliberately simple, a small relevant quotation will be given, concerning the importance of retaining the input parameters, and another alternative as well. I quote from the Oracle SOA Suite 11g Developer's guide: "If you have a very complicated interface, you may not want to have to enter the parameter values every time you test the composite. In 10g, there was a facility to set a default input to a BPEL process. Unfortunately, there is no such facility for 11g composites. In order to avoid retyping complex inputs, the input can be saved to a file and then pasted into the test dialog every time...". Finally, if your needs are bigger, you might consider another alternative testing tool like SOAPUI which is  available online.

Wednesday, 6 October 2010

JDeveloper 11g: Using assert() for testing and debugging

Assertions are a very useful feature for testing and debugging, but are rather neglected. Instead of using loggers to provide continuously diagnostic messages in critical programme  flow points, or even worse if- else - System.out.println() constructs, assert statements can only be enabled only when necessary. Thus, you avoid wasting valuable resources. In addition, you do not need to add any jar libraries to your IDE  project, or application server to use it. In order to use assert, you need to  pass the -ea argument, call a non void java method and check a Boolean  condition. For instance: assert(Month < 13). Nonetheless, you can not  use an assert statement to check the values passed to public methods. Consider for example the following code snippet, from an business components, employees entity object:
              
protected void doDML(int operation, TransactionEvent e) {
                if (operation == DML_UPDATE) {
    ...
               histStartDate = row.getEndDate();
              /*Check whether end date equals current date*/
              /*if (histStartDate.equals(new Date(Date.getCurrentDate()))){
                  System.out.println("End date equals current date!");
                  }*/
               assert(histStartDate.equals(new Date(Date.getCurrentDate() ) )) :
                          "End date equals current date! ";

Another trivial example from an ejb client follows:

public class PlaceBidClient {
    public static void main(String [] args) {
...
                     Bid bid = placeBid.addBid("Lila",  Long.valueOf(100),  2001.50);
                     System.out.println("Bid Successful, BidId Received is:" + bid.getBidId());
                     assert(bid.getBidId() == 502):"BidId Received is "+bid.getBidId();
  }
}
Finally, when run, the log output reads:

-javaagent:C:\Oracle\Middleware\jdev_11gR1\jdeveloper\..\modules\org.eclipse.persistence_1.0.0.0_2-0.jar -Duser.language=en -Duser.country=US -ea actionbazaar.buslogic.client.PlaceBidClient

Exception in thread "main" java.lang.AssertionError: BidId Received is 393
    at actionbazaar.buslogic.client.PlaceBidClient.main(PlaceBidClient.java:24)
Bid Successful, BidId Received is:393

Sunday, 3 October 2010

A free site for sports funs: http://www.woop.gr/

This is a new free online Greek sports channel covering both national and international soccer, basketball matches, motorcycle racing events and so on. Since Eurosport channel now asks for subscription and payments, this could be an interesting alternative, in case your spouse insists on watching that boring soap opera. Most text is in Greek, but you can find your way around. Try clicking on "Live" links, in order to find something interesting to watch. So, this is it: http://www.woop.gr/
Finally, if you would like to try other online tv channels there is http://2onlinetv.com.

Saturday, 25 September 2010

JDeveloper 11g: Using Log4j in ADF view object

Just like the entity object instance, covered here, the process for an ADF view object, goes like this. First, you add the library as shown in the image on your left hand side. Second, you create a log4j.properties file in:

C:\...\Model\src

 similar to the following example:


# Set root logger level to INFO and its only appender to ConsoleOut.
log4j.rootLogger=INFO, ConsoleOut


# ConsoleOut is set to be a ConsoleAppender.
log4j.appender.ConsoleOut=org.apache.log4j.ConsoleAppender


# ConsoleOut uses PatternLayout.
log4j.appender.ConsoleOut.layout=org.apache.log4j.PatternLayout
log4j.appender.ConsoleOut.layout.ConversionPattern=%-5p: [%d] %c{1} - %m%n


log4j.logger.org.apache.jsp=DEBUG
#Addon for
com.sun.faces.level=FINE






Third, if you want to use logging in several view objects, you need to edit your view object super class code like that:

package tuhra.model.framework;

import oracle.jbo.server.ViewRowImpl;

import org.apache.log4j.Logger;

public class TuhraViewRowImpl extends ViewRowImpl {
  protected Logger logger = Logger.getLogger(this.getClass());
}


and your view object code like that:

public class AllEmployeesRowImpl extends TuhraViewRowImpl implements AllEmployeesRow {...
     public void defineDefaultImage(Number newDefaultImageId){
 ...
                      if (logger.isDebugEnabled())
                         logger.debug("Default Image has been defined!");


 }
}

Next your diagnostic message appears in the log output window:

INFO : [2010-09-25 11:55:18,739] AllEmployeesRowImpl - DefaultImage has been defined!
Finally, if you need more tips about appenders:
http://www.mobilefish.com/developer/log4j/log4j_quickguide_appenders.html

The full source code is available on line:
http://code.google.com/p/nickaiva-blogspot/downloads/list

and is given without any guarantee of support whatsoever.

Thursday, 23 September 2010

Estimate the taxi fare for your routes in Athens, Greece

Many people and mostly tourists, protest about the exorbitant fares paid to taxi drivers, especially in Athens, in greater Attica and other areas. In order to help the passengers in estimating beforehand their fare, I shall publish about  a Greek site, that is it has some text in Greek, I am afraid! So, you can visit the following blog url: http://www.zee.gr/taxi/ and click on taxi estimator to enter your starting point and destination, just by clicking on the map!

Thursday, 16 September 2010

JDeveloper 11g:Using Log4j in an ADF application module

This is another concise instance for using Log4j in  an ADF application module, that is  in a  model project. The steps are quite similar:
starting with adding the log4j library, as shown in the image on your left hand side.
Next,  you need to create a log4j.properties file, within:

C:\...\Model\src

just  like the following:


# Set root logger level to INFO and its only appender to ConsoleOut.
log4j.rootLogger=INFO, ConsoleOut
# ConsoleOut is set to be a ConsoleAppender.
log4j.appender.ConsoleOut=org.apache.log4j.ConsoleAppender
# ConsoleOut uses PatternLayout.
log4j.appender.ConsoleOut.layout=org.apache.log4j.PatternLayout
log4j.appender.ConsoleOut.layout.ConversionPattern=%-5p: [%d] %c{1} - %m%n
log4j.logger.org.apache.jsp=DEBUG
#Addon for
com.sun.faces.level=FINE



Third, you need to edit your code just like that:

...

import org.apache.log4j.Logger;

...

public class TuhraServiceImpl extends TuhraApplicationModuleImpl implements TuhraService {

  private Logger logger = Logger.getLogger(this.getClass());

...

public void createNewImageForEmployee(Number employeeId, String imageName){

...
   if (logger.isDebugEnabled())
      logger.debug("New image has been created!");   

    }

}


Finally,  you should see your logger message appear in the log output window;


INFO : [2010-09-16 10:26:16,517] TuhraServiceImpl - New image has been created!

Would you like to refactor?

Moreover, you could move the code line below:


private Logger logger = Logger.getLogger(this.getClass());


 to the super class:


package tuhra.model.framework;
 

import oracle.jbo.server.ApplicationModuleImpl;
import org.apache.log4j.Logger;

public class TuhraApplicationModuleImpl extends ApplicationModuleImpl {

  protected Logger logger = Logger.getLogger(this.getClass().getName());

}



Once more, your custom  logger message should appear in the log output :


INFO : [2010-09-16 15:20:02,247] TuhraServiceImpl - New image has been created!

Finally, if you need more tips about appenders:
http://www.mobilefish.com/developer/log4j/log4j_quickguide_appenders.html  

Tuesday, 14 September 2010

International Herald Tribune edition is now available in Greece, by Kathimerini

For those interested in learning news from the inside, about Greece: 
http://www.ekathimerini.com/

Comments on Oracle SOA Suite 11g R1 Developer's Guide, by Matt Wright and Antony Reynolds

On the bright side, the text is well written in British English,  and neatly organized as well. It is based on the successful recipe of the previous book about 10g SOA and it's  divided in three parts: the first is a short introduction to the Oracle SOA Suite and its various components, and will give you an fast-paced, but limited hands-on, introduction to each of the key components. The second section provides a brief best-practice guide to applying the various components of the SOA Suite to implement a real-world SOA-based solution; it illustrates this through the development of an auction site (oBay) whose source code is actually missing! The final section covers other subjects, such as the packaging, deployment, testing, security, and administration of SOA applications.
On the dark side, some hands on practice although realistic, require a permanent connection to the internet, since currency rates conversion and stock exchange quotes are necessary for testing your BPEL process. These are not always available (I got many "Server too busy" messages) and this might hinder you from completing your practice correctly. Besides, the source code offered publicly, contains only the final solution, but no solutions for the intermediate steps, nor sample inputs for testing, i.e. EUR for the euro currency. Furthermore, the code for oBay application is actually missing and so is its installation guide, mentioned in the text. I think the approach about self contented practice taken by the other competitor: Getting started with Oracle SOA 11g suite is by far better. In fact, its step by step instructions are more exact and easier to follow.
In summary, the book offers a sound theoretical basis better than its competitor, but it is so much weaker in guidance  and in hands on practice. Moreover, some chapters, such as 18 about business rules, are rather purely descriptive and hence difficult to follow. Whether you need such a book which resembles the free on line Oracle Fusion SOA developer guide manual, it is up to you. It targets developers or  technical architects who work in the SOA domain. Of course there are some prerequisites, I quote: "You need basic understanding of the concepts of SOA, as well as some of the key standards in this field, including web services (SOAP, WSDL), XML Schemas, and XSLT (and XPath)". Finally, you need a fast computer, preferably with more than 4GB of memory, to setup the SOA suite.

Sunday, 12 September 2010

JDeveloper 11g:Using Log4j in ADF business components projects

In case you prefer using  ADF business components in your Model project, the procedure for using log4j logging is almost identical with the EJB way. You might also read an example on using logging within an ADF application module as well.
First, you need to add the library, by double clicking your Model project, as you can see on your left hand side.
Second, you need to create a log4j.properties file within:
C:\...\Model\src

just  like the following:


# Set root logger level to INFO and its only appender to ConsoleOut.
log4j.rootLogger=INFO, ConsoleOut

# ConsoleOut is set to be a ConsoleAppender.
log4j.appender.ConsoleOut=org.apache.log4j.ConsoleAppender

# ConsoleOut uses PatternLayout.
log4j.appender.ConsoleOut.layout=org.apache.log4j.PatternLayout
log4j.appender.ConsoleOut.layout.ConversionPattern=%-5p: [%d] %c{1} - %m%n

log4j.logger.org.apache.jsp=DEBUG
#Addon for
com.sun.faces.level=FINE



Third, you edit your entity object code like that:
...
import org.apache.log4j.Logger;



public class ImagesImpl extends TuhraEntityImpl {
...


    private Logger logger = Logger.getLogger(this.getClass());
  ...


    private void adjustImageUsages(RowSet newImageUsagesBeforePost) {
   ...

      if (logger.isDebugEnabled())
             logger.debug("ImageUsages has been adjusted");
        }

...
}

Finally the message you created appears in the log output window:
INFO : [2010-09-12 09:56:32,593] ImagesImpl - ImageUsages has been adjusted

Would you like to refactor?

Furthermore, if you use logging within multiple entity objects, you could move the declaration code line:

private Logger logger = Logger.getLogger(this.getClass());

to the super class:

package tuhra.model.framework;

import oracle.jbo.server.EntityImpl;
import org.apache.log4j.Logger;

public class TuhraEntityImpl extends EntityImpl {
  protected Logger logger = Logger.getLogger(this.getClass());
}



Upon commit, the logger output appears once more:

INFO : [2010-09-16 10:28:07,288] ImagesImpl - ImageUsages has been adjusted

For dynamic changes of logging levels, one can consult for example:
dynamically-changing-log-level-with-weblogic-log4j-jmx-and-wlst/


Finally, if you need more tips about appenders:
http://www.mobilefish.com/developer/log4j/log4j_quickguide_appenders.html

Saturday, 11 September 2010

JDeveloper 11g:Using Log4j in a JSF backing bean

Another example which might prove useful to JSF or ADF developers,  is logging within a backing bean.
First, you need to add the Log4j.jar by double clicking the ViewController project. You can see the library window on your left handside, showind the jar already added. Note that you can use logging via log4j in combination with ADFLogger, that is if you are using ADF, or even without it.

Second, you need to create the log4j.properties file in ViewController/src. Another  log4j.properties sample file is given here, for your convenience:


# Set root logger level to INFO and its only appender to ConsoleOut.
log4j.rootLogger=INFO, ConsoleOut

# ConsoleOut is set to be a ConsoleAppender.
log4j.appender.ConsoleOut=org.apache.log4j.ConsoleAppender

# ConsoleOut uses PatternLayout.
log4j.appender.ConsoleOut.layout=org.apache.log4j.PatternLayout
log4j.appender.ConsoleOut.layout.ConversionPattern=%-5p: [%d] %c{1} - %m%n
log4j.logger.org.apache.jsp=DEBUG
#Addon for
com.sun.faces.level=FINE



Third, you need to code! The example bean code follows:
...
import org.apache.log4j.Logger;
...
public class ImageUploadBean extends TuhraBackingBean implements Serializable {
  private Logger logger = Logger.getLogger(this.getClass());
 
...
 private void insertRows() {
...
    if (logger.isDebugEnabled())
       logger.debug("Succeeded in adding new image!");
    }
}

Finally, your message appears in the log window:

INFO : [2010-09-11 21:47:52,005] ImageUploadBean - Succeeded in adding new image!

Would you like to refactor?
Furthermore, if you use logging in several beans, you could move the declaration code line:

private Logger logger = Logger.getLogger(this.getClass());
 


to the super class TuhraBackingBean:

package tuhra.view.framework;

import oracle.adf.model.BindingContext;

import oracle.binding.BindingContainer;

import org.apache.log4j.Logger;

/**the purpose of this framework class is to
access the commonly used properties.
 */
public abstract class TuhraBackingBean {
   
    protected Logger logger = Logger.getLogger(this.getClass());
 
  /**the purpose of this framework method is to
  access the bindings programmatically.
   */
    public BindingContainer getBindings() {
        return BindingContext.getCurrent().getCurrentBindingsEntry();
    }
}

Then the log outputs once more:
INFO : [2010-09-16 09:46:37,767] TuhraServiceImpl - New image has been created!
INFO : [2010-09-16 09:46:37,767] ImageUploadBean - Succeeded in adding new image!


where the first info message comes from the application module code (this could be another example I suppose!), while the second from the aforementioned backing bean. You could follow more or less the same steps for JDeveloper 10g too.
Finally, if you need more tips about appenders:
http://www.mobilefish.com/developer/log4j/log4j_quickguide_appenders.html

Beware of Greeks Bearing Bonds Business: vanityfair.com

This is an article written by a journalist, who actually visited Greece to see for himself. He saw quite a lot, even if he only stayed for a while, unlike the Greek politicians who have been ruling for decades! Go ahead: Beware of Greeks Bearing Bonds Business: vanityfair.com

Thursday, 9 September 2010

Comments on Project Management Body of Knowledge, PMI

On  the bright side, the text is well written,  in American English and  neatly organized, without any misspellings or errors. Its style is formal and actually contains all there is to know, in order to sit for the project management institute examinations. Its scope is by far more general than the compTIA Project + exam guide, which  focuses mainly on IT projects. The forth edition is revised and now includes new additions, such as requirements gathering.
On the dark side, some of the paragraphs can be so long that studying it, might become a drudgery. Moreover, there are no questions and answers, exercises or problems for the reader to solve. in order to reinforce learning.
All in all, this is the bible of the manager, full of information, but its formal structure resembles more of  a reference manual, not a course book to prepare for the exam.


Comments on Mesoscale Meteorological Modeling, 2nd Edition Volume 78 By Roger A. Pielke, Sr.

On the bright side, the text is well organized, without many misspellings or typographical errors. The book aims to graduate level readers and researchers. It offers a wealth of information, bibliography references and chapter notes.
 On the dark side, the thermodynamics chapter has been reported to have some ambiguities about i.e.  conservation of heat.  During my postgraduate studies I was assigned to study the 1rst edition of the book, so as to be examined orally. Thus, in the absence of exercises or questions,  I had to write my own, corresponding to each paragraph of text. I suppose having spent such a large amount of time and effort made me wonder, whether the newer edition offered such supplements. I am afraid it doesn't!
All in all, the book is advanced text and the reader is assumed to have perfect knowledge of several topics, especially statistical physics. Its second edition proves its success, but as far as  the student  is concerned, adding some sort of practice would mean great help.

Wednesday, 8 September 2010

JDeveloper 11g:Using Log4j in stateful EJB

Since the use of log4j has proven to be a very popular subject for the readers, another code snippet for your Model project will be  given as an example. In case you prefer ADF business components, you can find an example too. If you 'd also like an example for a backing bean for your ViewController project this time, you  can have it here
First, one has to double click the project, so that the window of the libraries appears, in order to add the Log4j jar library. 
Second, navigate to C:\...\Model\src to create the log4j.properties file:

# **Set root logger level to DEBUG and its only appender to A.
log4j.rootLogger=DEBUG, A
# ***** A is set to be a ConsoleAppender.
log4j.appender.A=org.apache.log4j.ConsoleAppender
# ***** A uses PatternLayout.
log4j.appender.A.layout=org.apache.log4j.PatternLayout
log4j.appender.A.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n


Finally, if one 'd like to use log4j within a  stateful EJB class, the source code is similar:

...
import org.apache.log4j.Logger;

@Stateful(name = "PlaceOrder", mappedName = "ejb3inaction-Model-PlaceOrder")
@Remote
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)  
public class PlaceOrderBean implements PlaceOrder {
    Logger logger =Logger.getLogger(this.getClass().getSimpleName());
...
    @Remove                                                          
    @TransactionAttribute(TransactionAttributeType.REQUIRED)         
    public Long confirmOrder() {
      ...
      em.persist(order);            
      if (logger.isDebugEnabled())
         logger.debug("******************Order confirmed!**************");
      return order.getOrderId();
    }
...
}
Thus, one gets the following log output from the integrated Weblogic server:

Run startup time: 9656 ms.
[Application ejb3inaction deployed to Server Instance IntegratedWebLogicServer]
<2010-09-08 16:00:18.4--ServerSession(1576505)--EclipseLink, version: Eclipse Persistence Services - 2.0.2.v20100323-r6872>
<2010-09-08 16:00:18.416--ServerSession(1576505)--Server: WebLogic Server 10.3.3.0  Fri Apr 9 00:05:28 PDT 2010 1321401 >
<2010-09-08 16:00:18.837--ServerSession(1576505)--file:/C:/Users/Nick/AppData/Roaming/JDeveloper/system11.1.1.3.37.56.60/o.j2ee/drs/ejb3inaction/ModelEJB.jar/_Model login successful>
0    [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] INFO  PlaceOrder_i7ibfi_Impl  - ******************Order confirmed!**************


In case you prefer working with Eclipse, the process is quite similar. See for example:
http://snippets.dzone.com/posts/show/3248
Finally, if you need more tips about appenders:
http://www.mobilefish.com/developer/log4j/log4j_quickguide_appenders.html

Sunday, 5 September 2010

Comments on Teach yourself JavaScript in 24 hours by Michael Moncur, 4rth Edition

On the bright side, the text is clear, well structured without any spelling errors. Its chapters are structured in such a tidy and concise way, so that its title actually corresponds to its content exactly; a series of timed tutorial lessons, a do it yourself learning course. Each chapter has its questions and answers sections, quiz questions and relevant answers and finally exercises. Its source code is complete and available. The lesson about debugging, DOM and forms validation is valuable as a reference.
On the dark side, the reader has to know  beforehand, some programming essentials,  since the text does not analytically present some subjects in great length and depth, i.e. some complained about the coverage of  loops.
All in all, the book is a success, now in its 4rth edition, offering an introductory course in JavaScript for experienced programmers. Moreover, it is very useful as a reference, offering a wealth of information in its appendixes: other JavaScript resources, tools etc.

Saturday, 4 September 2010

Comments on Oracle Application Server 10g: J2EE Deployment and Administration, by Michael Wessler, Erin Mulder, Rob Harrop, Jan Machacek, Apress

On the bright side, the text is very well organized, tight, well written, without spelling errors. It describes  thoroughly all the options available in each screen shot. There are also some tips and  hints about performance tuning, such as using web cache. Its source code is available online as well.
On the dark side, the text resembles more of a manual than a learning course. It has no tutorials, nor end of chapter step by step exercises for the reader to implement on his own, in order i.e. to actually measure any performance gains. The book was published back in 2004 and I quote an interesting paragraph of its presentation text, which can be found at: http://apress.com/book/view/9781590592359
"Oracle Application Server 10g: J2EE Deployment and Administration focuses on the latest version of Oracle's fully J2EE-certified application server (previously called Oracle9iAS). Oracle Corp. is aggressively attacking this market with a new lost-cost version of the server, as well as a program to move BEA customers onto Oracle free of charge. Adoption interest is growing rapidly amidst favorable reports regarding performance and reliability."
All in all, the book might be of use to web administrators with old J2EE 1.3, already running servers. Today, its content is mostly deprecated, as OAS end of life is approaching.

Wednesday, 1 September 2010

JDeveloper 10g: Deployment of JHeadstart application to OAS 10.1.2


A common demand by customers in the public sector, is keeping their usually many years old, existing application server installations intact and rarely upgrade to newer versions. Others say that buying new hardware is far too expensive. Sometimes compatibility reasons, i.e. simultaneous use of older Oracle forms applications, tie you up. Furthermore, why should one mess up a smoothly up and running   1.3 JEE application server, after all?
Developer's nightmare
The sad thing is that customers usually inform you of such requirements, only when you have already finished testing at the current version of the J2EE container of the Oracle Application Server or OAS, the one embedded in JDeveloper (that is in our case: 10.1.3) and the contemporary stand alone J2EE 1.4 OC4J instance!
Whatever the extra cost of effort, time and money, the developer is to conform to the customer rules. The integrated scope changes control process mentioned in the Project Management Body of Knowledge are vastly considered purely theoretical in Greek software houses. In practice, the competition is very hard, no manager can afford a displeased customer. On the other hand, bear in mind that plain programmers are dispensable. I only wonder what are the working conditions abroad? Please respond, with as many details as possible!
So, if you are finally stuck to the older version of OAS, you might consult a brief deployment guide to a test server at :
http://code.google.com/p/nickaiva-blogspot/downloads/detail?name=DeployToOAS_v2.pdf&can=2&q=
Perhaps reading it, might save you some time and frustration...

Further critical references concerning ADF:

Tales from the trenches by Dr. Dorsey. Coauthor of JDeveloper 10g hanbook.

Tuesday, 31 August 2010

Comments on SCWCD Exam Study Kit Second Edition Java Web Component Developer Certification Hanumant Deshmukh, Jignesh Malavia

On the bright side the text is well written, with few spelling errors. The text goes far beyond the scope of purely helping the reader to prepare for the exam. The exam questions are advanced and most are difficult to understand. Although Javascipt is clearly not a prerequisite for the exam, there are some tricky examples i.e. in forms, which could be used as a reference.
On the dark side, the text is sometimes not easy to understand. This is definitely no book for beginners, such as the one offered by the Head First series. The catalog of the errata page is quite long too, especially for the first prints.
All in all, the book which was published in 2005, is surely not a primer. It could also be used as a reference later in your career, but you might initially need a lower level text to read, before actually attempting to sit for the exam.

Monday, 30 August 2010

Comments on Fusion Developer Guide. by F.Nimphius, Lynn Munsinger

On the bright side, the text is well written most of the times, presenting in great detail the theory behind ADF. The book is advanced, and the reader is supposed to have previous experience in J2EE development, in order to follow the use cases mentioned in the text. Some of them offer valuable solutions to reuse in your projects.
On the dark side, the full source code of the book is not available for download, with only a few exceptions. The errata page has vanished for a while, so an older version perhaps incomplete, is available here. The book has not a tutorial step by step, practice on your own form, like the one by D. Mills. Sometimes, the paragraphs are so long and purely theoretical, that reading becomes tedious.
All in all, the book seems like a brief printed synopsis, of the official Oracle fusion Developer guide pdf file, available online for free in OTN. Whether you would like to have a printed version of it as well, is only up to you!

Further critical references concerning ADF:

Tales from the trenches by Dr. Dorsey. Coauthor of JDeveloper 10g handbook.
Performance  and scalability criticism  by several authors

ERRATA: "Oracle Fusion Developer Guide - Building Rich Internet Applications with Oracle ADF Business Components and ADF Faces" (ISBN - 978-0-07-162254-7)

Chapter 01:



Page
27
Addition
to using scope prefixes in EL when reading memory scope attributes



The
book has it correct. However, we want to make sure memory scope
prefixes are understood correctly and that there is no question left
open in regards to managed beans:







Accessing a managed bean in a standard servlet scope like sessionScope
or requestScope using the scope as a prefix fails if the bean instance
does not exist. Thus, bean reference like #{sessionScope.myBean} may
fail while #{myBean} always succeeds. The reason for this is that
#{sessionScope….} and #{requestScope…} reference
a Map in
memory and not the JSF framework.







Managed beans must be instantiated before they become available in the
memory scope, which means they need to be accessed through JSF.
Luckily, JSF does not allow to configure two managed beans with the
same name in different scopes. So even without a scope prefix, there is
no risk that application code accidentally accesses the wrong object..
Note that using ADFc specific scope, like viewScope and pageFlowScope,
you always need to use the scope name as  a prefix in the EL.




Chapter 03:



Page
100
Use
Case; Using af:subform in ADF Forms - new sample provided


A complimentary sample is posted on ADF Code
Corner implementing this use case: See it here






Chapter 05:



Page
168
Creating
and Registering a custom Exception Handler


The custom exception handler example extends
AdfcExceptionHandler, which is a class in an internal package. The risk
associated with classes in internal packages is that changes may be
made by Oracle without further notice. Oracle updated the upcoming
version of the product documentation, "Oracle Fusion Middleware Fusion
Developer's Guide for Oracle Application Development Framework 11g"
with a sample that explains how to configure custom exception handlers,
following our example in the book. They corrected the use of
 AdfcExceptionHandler by using ExceptionHandler, the class
that is good to use with no strings attached. The sample thus would
look like





import javax.faces.context.ExternalContext;



import javax.faces.context.FacesContext;



import javax.faces.event.PhaseId;



import oracle.adf.view.rich.context.ExceptionHandler;






public class CustomExceptionHandler extends ExceptionHandler {







    public CustomExceptionHandler() {



  
super();



    }







   public void handleException(FacesContext
facesContext, Throwable throwable, PhaseId phaseId) throws Throwable



   {



     String error_message;



     error_message = throwable.getMessage();



     if (error_message != null
&&



  
error_message.indexOf("ADF_FACES-30108") > -1)



     {



 
ExternalContext ectx = facesContext.getExternalContext();



 
ectx.redirect("faces/SessionExpired.jspx");



     }



     else



     {



       throw
throwable;



     }



   }



}





Note that using ExceptionHandler,
the handleException

method does not call super.handleException(...) but throws the
exception so it is handled by the next registered exception handler,
which most likely then is the internal AdfcExceptionhandler instance.
The ExceptionHandler,
class does not implement the handleException
method itself and only acts as a template for defining ADF task Flow
exception handlers.





Chapter 06:



Page
199
Accessing
the Task Flow Binding from Java


The code example casts the Task Flow Binding to DCTaskFlowBinding,
which is an internal class used by the ADF framework. To avoid using
internally packaged classes, yu can cast the region binding to
DCBindingContainer, which is the public framework class that DCTaskFlowBinding
extends.






BindingContext bctx = BindingContext.getCurrent();



BindingContainer bindings =
bctx.getCurrentBindingsEntry(); 




DCTaskFlowBinding taskFlowBinding = null;



DCBindingContainer
taskFlowBinding = (DCBindingContainer)
bindings.get("dynamicRegion1");


The primary use of accessing the region binding is to
get
a hold of the referenced binding container and its defined bindings,
which you can also do using the DCBindingContainer.
There is some more infromation available using DCTaskFlowBinding,
but these you can get from other APIs, like ControllerContext as well.








Chapter 09:



Page
309
Note
says: If the table is a child of the af:panelCollection component, then
an implementation of the multiple column sort use case already exists
using the PanelCollection View | Sort | Advanced menu option


The book has it correct and the functionality exists.
However, you need to set
the table column selection to either single or multiple. This is not
apparent because within the chapter, the column selection
is enabled at the beginning
to handle a different use case. The requirement to enable column
selection has nothing to do with sorting but exists in the current
JDeveloper 11g release. A
bug has been filed to lift this requirement.


Page 309 Selection Event


The example
shows you how to synchronize the table component row selection with the
current row in ADF binding layer using Exression Language. If you
prefer a pure Java solution, we released a generic Java handler example
on ADF Code Corner: read more.


Page 296 How to navigate in specific
row in table.


ADF Code Corner has an improved version of the sample in
the
book that is worth looking at. The sources are available for dwenload
as well. See
here.



A related sample is here.


Page 281 "invokeMethodBinding"
should be "invokeMethodExpression"


Chapter 9 uses a helper method to invoke method
expression.
The main method "invokeMethodExpression" has a overloaded method with a
simplified signature. Unfortunately the name of this method in the book
is "invokeMethodBinding". It should however look as shown below to work
with the samples given in the book






/**


* overloaded method as a convenience for the common case in which only



* a single argument is passed



*/  



public Object invokeMethodExpression(String
methodExpression,



                         

  Object event,

                           

Class eventClass){



  //call method shown below


  return invokeMethodExpression(methodExpression,

                       

new Object[]{event},

                       

new Class[]{eventClass});


}








So please put a note on the first method name that the
name has changed as shown above.    


Page 311 What You Should Know About
the Data That Is Exported to Excel
In this
section of the book we provide a hint of how to add an Excel fomular to
the exported table cell data so that it gets propery formatted when
opened in Excel.This hint stopped working in the latest release of
Oracle JDeveloper, which is Oracle JDeveloper 11g R1 PS2 (build number
is Build JDEVADF_11.1.1.3.PS2_GENERIC_100408.2356.5660) because of a
bug fix that prevents the export of hidden output text content.

 We assume that it requires a new enhancement request to properly
implement the option to add excel formulars (adn some users
unfortunately already started suffering from the side effect this bug
fix has  - including this book).


Chapter 15:



Page 483 Typo "exiting" instead of "existing"


Luc Bors from Amis in the Netherlands found this
interesting typo in the book: “A standard JSF component that
is built from exiting ADF Faces
Components …” . This of course should be "A standard
JSF component that
is built from existing ADF Faces
Components ..."




Chapter 19:



Page
601
Registering the
adf-js-partition.xsd Schema


The adf-js-partitions.xsd schema has been moved
to
<wls_jdev_install>\oracle_common\modules\oracle.adf.view_11.1.1\adf-richclient-api-11.jar


Page
601
Creating te
adf-js-partitions.xml file


The custom adf-js-partitions.xml file structure has a
typo and wrong xml tag. The correct XML is shown below



<?xml version="1.0" encoding="utf-8" ?>
<partitions xmlns="http://xmlns.oracle.com/adf/faces/partition">
 <partition>
 <partition-name> ... </partition-name>
 <feature></feature>
 ...
 </partition>
 
 <partition>
 <partition-name> ... </partition-name>
 <feature>...</feature>
 ...
 </partition> 
</partitions>