Fusion Middleware
Load balancing with AS 10.1.3 and with Web Cache
I first used Oracle Web Cache which is a 10.1.2 Application Server product. This was pretty easy but very stupid in 10.1.3. ( the second part of this blog I will show you how easy this is in 10.1.3
The first step in Web Cache is to configure the listening ports for the load balancer.
In my case Web cache will listen on port 80 and 7778.
Now we can add the application servers ( original servers)
Define a website url for which you want to load balance, I will use the Enterprise Manager Website /em
The site is /em/
Add a site to server mapping where we connect the site em to the availible AS server
Now we have to make sure that a new web session is always run on the same original server else we cannot log in.
Use for the em website as session JSESSIONID and OC4J-based as binding mechanism. We are now ready with Web Cache. The only thing still to do is to add a virtual hsot to the httpd.conf of the Application Servers. We have to do this else the em website is redirected to one of the application server instead of the load balancer adress.
XPCND7010XMP.work.local:7777 is the application server on port 7777.
NameVirtualHost XPCND7010XMP.work.local:7777
<VirtualHost XPCND7010XMP.work.local:7777>
ServerName XPCND7010XMP.work.local
Port 80
</VirtualHost>
inside VirtualHost we use the adress of the load balancer.
That's all in webcache.
You don't have to do this in 10.1.3. Just install on the load balancer a http server ( custom install in the application server installer ).
Add in every AS Home the following topology lines to the opmn.xml and you have a cluster.
On the application servers you don't need the http servers anymore so you can disable.
<notification-server interface="ipv4">
<port local="6100" remote="6200" request="5003"/>
<ssl enabled="true" wallet-file="$ORACLE_HOME/opmn/conf/ssl.wlt/default"/>
<topology>
<discover list="*233.0.0.2:1500"/>
</topology>
</notification-server>
In this cluster you can have only one Enterprise Manager application so you have to disable it on all the application servers except one. ( server.xml and default-web-site.xml )
That's all in 10.1.3
Starting a new project
Wordle
Oracle Open World Around The Corner...

Oracle Open World starts September 21st... That's just 2 months away! Woot! Goosebumps, I tell you.
The conference last year was a bit chaotic for me... when I'm presenting, I never feel like I have enough time... And with 60,000 attendees, it can get a little crazy. This year will probably be similar. I'm doing a variation on my introduction to integrating with Stellent talk, because it was one of the top ten talks at Collaborate 08 a few months back. Nice... The IOUG folks were kind enough to score a spot for me, and I'm gonna soup up the talk a bit. Andy and I will probably also giving an ECM business-strategy presentation that aligns with our upcoming book.
Then I can relax!
I haven't looked at too many of the other presentation yet, but the ones that won Jake's "pick a session" contest on Oracle Mix all look good. I'm glad to see that Dan Norris will be presenting on how to be an Oracle ACE... also, Lonneke Dikmans will be presenting a shootout between Oracle WebCenter and BEA Weblogic.
I'm sure that last one will be hyper political...
Its also good to see Eric Marcoux presenting on a comparison between Oracle Portal, Oracle WebCenter, and Stellent... its nice to see a Stellent presentation make the top 25. Although it will be tough to give a decent comparison of all 4 Oracle Portal Products PLUS Stellent in one talk... Good luck to Eric.
Your turn: are you going to Open World? If so, what would you like to see?
OpenIDs problems don't seem to be going away
OOW08 Mix presentations and ADF & SOA
The ADF developer community is not so large, it has to be a lot bigger to survive. To make this happen, Oracle has to promote and invest into JHeadstart ( it has to be more like APEX ) so the customer will make the step to go from APEX or Forms to Jheadstart. The second step Oracle has to do is to make sure that the BEA java developers will use ADF. So the ADF community will be large and important else ADF will only be used in the Oracle Apps.
By the way here are the SOA or Portal presentations which are selected by the Oracle mix people for OOW08.
BEA Aqualogic versus Oracle Fusion Middleware shoot out by Lonneke Dikmans
Oracle Portal, WebCenter and Stellent – which one should you use ? by by Eric Marcoux
How to Effectively use Web 2.0 Technologies within a Portal by Howard Block.
Thinking about service levels
Google Map Rolling on a Mac
CRUD operations in Flex with ADF BC
The great thing is that LifeCycle keeps all the clients in sync which are using the same data service, even in different flex projects ( Data Push).
First you have to setup a jdeveloper LifeCycle project, see my previous post
For my example I am using the employee table in the HR schema. Make sure you the java types instead the Oracle java types else you have to do some extra casting

To get this working in LifeCycle we have to create three classes and do some configuration work.
Create an employee object class, I already tried the use the RowImpl of the employee viewobject but this does not work in all cases. When I update a record in Flex the updated RowImpl is send back to the lifecycle server where I got a dead viewobject row error. So we have to do it manually. To make life a little bit simplier I use two methods which can transform this employee object to EmployeeRowImpl and back.
package nl.ordina.flex.adfbc;
import java.math.BigDecimal;
import java.sql.Date;
import nl.ordina.flex.model.dataaccess.EmployeesViewRowImpl;
public class Employee {
private BigDecimal employeeId;
private String firstName;
private String lastName;
private String email;
private String phoneNumber;
private Date hireDate;
private String jobId;
private BigDecimal salary;
private BigDecimal commissionPct;
private BigDecimal managerId;
private BigDecimal departmentId;
public Employee() {
}
public Object getAttribute(String attribute) {
if ( attribute.equalsIgnoreCase("firstname")) {
return firstName;
}
if ( attribute.equalsIgnoreCase("lastname")) {
return lastName;
}
return null;
}
public Employee transform( EmployeesViewRowImpl row) {
Employee emp = new Employee();
emp.setEmployeeId(row.getEmployeeId());
emp.setFirstName(row.getFirstName());
emp.setLastName(row.getLastName());
emp.setCommissionPct(row.getCommissionPct());
emp.setDepartmentId(row.getDepartmentId());
emp.setEmail(row.getEmail());
emp.setHireDate(row.getHireDate());
emp.setJobId(row.getJobId());
emp.setManagerId(row.getManagerId());
emp.setPhoneNumber(row.getPhoneNumber());
emp.setSalary(row.getSalary());
return emp;
}
public EmployeesViewRowImpl transform( Employee employee) {
EmployeesViewRowImpl row = new EmployeesViewRowImpl();
row.setEmployeeId(employee.getEmployeeId());
row.setFirstName(employee.getFirstName());
row.setLastName(employee.getLastName());
row.setCommissionPct(employee.getCommissionPct());
row.setDepartmentId(employee.getDepartmentId());
row.setEmail(employee.getEmail());
row.setHireDate(employee.getHireDate());
row.setJobId(employee.getJobId());
row.setManagerId(employee.getManagerId());
row.setPhoneNumber(employee.getPhoneNumber());
row.setSalary(employee.getSalary());
return row;
}
public void setEmployeeId(BigDecimal employeeId) {
this.employeeId = employeeId;
}
public BigDecimal getEmployeeId() {
return employeeId;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getFirstName() {
return firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public String getLastName() {
return lastName;
}
public void setEmail(String email) {
this.email = email;
}
public String getEmail() {
return email;
}
public void setPhoneNumber(String phoneNumber) {
this.phoneNumber = phoneNumber;
}
public String getPhoneNumber() {
return phoneNumber;
}
public void setHireDate(Date hireDate) {
this.hireDate = hireDate;
}
public Date getHireDate() {
return hireDate;
}
public void setJobId(String jobId) {
this.jobId = jobId;
}
public String getJobId() {
return jobId;
}
public void setSalary(BigDecimal salary) {
this.salary = salary;
}
public BigDecimal getSalary() {
return salary;
}
public void setCommissionPct(BigDecimal commissionPct) {
this.commissionPct = commissionPct;
}
public BigDecimal getCommissionPct() {
return commissionPct;
}
public void setManagerId(BigDecimal managerId) {
this.managerId = managerId;
}
public BigDecimal getManagerId() {
return managerId;
}
public void setDepartmentId(BigDecimal departmentId) {
this.departmentId = departmentId;
}
public BigDecimal getDepartmentId() {
return departmentId;
}
}
Create an EmployeeService which does the CRUD operations in ADF BC.
package nl.ordina.flex.adfbc;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import nl.ordina.flex.model.dataaccess.EmployeesViewImpl;
import nl.ordina.flex.model.dataaccess.EmployeesViewRowImpl;
import nl.ordina.flex.model.service.EmployeeModuleImpl;
import oracle.jbo.client.Configuration;
public class EmployeeService {
private EmployeeModuleImpl am;
public EmployeeService() {
am = (EmployeeModuleImpl)Configuration.createRootApplicationModule("nl.ordina.flex.model.service.EmpoyeeModule", "EmployeeModuleLocal");
}
public List getEmployees() {
List list = new ArrayList();
Employee emp = new Employee();
EmployeesViewImpl empView = am.getEmployeesView1();
empView.executeQuery();
while (empView.hasNext()) {
EmployeesViewRowImpl row = (EmployeesViewRowImpl) empView.next();
list.add(emp.transform(row));
}
return list;
}
public Employee getEmployee(BigDecimal employeeId) {
EmployeesViewImpl view = am.getEmployeesView1();
Employee emp = new Employee();
view.setid(employeeId);
view.executeQuery();
if ( view.hasNext()) {
EmployeesViewRowImpl row = (EmployeesViewRowImpl)view.next();
return emp.transform(row);
} else
return null;
}
public Employee create(Employee employee) {
EmployeesViewImpl view = am.getEmployeesView1();
Employee emp = new Employee();
view.insertRow(emp.transform(employee));
am.getDBTransaction().commit();
return employee;
}
public static String capitalize(String s) {
if (s.length() == 0) return s;
return s.substring(0, 1).toUpperCase() + s.substring(1);
}
public boolean update(Employee employee, List changes) {
EmployeesViewImpl view = am.getEmployeesView1();
view.setid(employee.getEmployeeId());
view.executeQuery();
if ( view.hasNext()) {
EmployeesViewRowImpl row = (EmployeesViewRowImpl)view.next();
for (int i = 0 ; i < changes.size(); i++ ) {
String attribute = capitalize(changes.get(i).toString());
row.setAttribute(attribute,employee.getAttribute(attribute));
}
am.getDBTransaction().commit();
return true;
} else
return false;
}
public boolean delete(Employee employee) {
EmployeesViewImpl view = am.getEmployeesView1();
view.setid(employee.getEmployeeId());
view.executeQuery();
if ( view.hasNext()) {
EmployeesViewRowImpl row = (EmployeesViewRowImpl)view.next();
row.remove();
am.getDBTransaction().commit();
return true;
} else
return false;
}
}
We have to create Assembler class which is used by the LifeCycle server
package nl.ordina.flex.adfbc;
import java.util.List;
import java.util.Collection;
import java.util.Map;
import flex.data.DataSyncException;
import flex.data.assemblers.AbstractAssembler;
import java.math.BigDecimal;
public class EmployeeAssembler extends AbstractAssembler {
public Collection fill(List fillArgs) {
EmployeeService service = new EmployeeService();
return service.getEmployees();
}
public Object getItem(Map identity) {
EmployeeService service = new EmployeeService();
return service.getEmployee(((BigDecimal) identity.get("employeeId")));
}
public void createItem(Object item) {
EmployeeService service = new EmployeeService();
service.create((Employee) item);
}
public void updateItem(Object newVersion, Object prevVersion, List changes) {
EmployeeService service = new EmployeeService();
boolean success = service.update((Employee) newVersion, changes);
if (!success) {
BigDecimal employeeId = ((Employee) newVersion).getEmployeeId();
throw new DataSyncException(service.getEmployee(employeeId), changes);
}
}
public void deleteItem(Object item) {
EmployeeService service = new EmployeeService();
boolean success = service.delete((Employee) item);
if (!success) {
BigDecimal employeeId = ((Employee) item).getEmployeeId();
throw new DataSyncException(service.getEmployee(employeeId), null);
}
}
}
Now the last step in jdeveloper is to add a new data service entry to the lifecycle configuration ( data-management-config.xml located in the flex folder)
<?xml version="1.0" encoding="UTF-8"?>
<service id="data-service"
class="flex.data.DataService">
<adapters>
<adapter-definition id="actionscript" class="flex.data.adapters.ASObjectAdapter" default="true"/>
<adapter-definition id="java-dao" class="flex.data.adapters.JavaAdapter"/>
</adapters>
<default-channels>
<channel ref="my-rtmp"/>
</default-channels>
<destination id="employee">
<adapter ref="java-dao" />
<properties>
<cache-items>false</cache-items>
<use-transactions>false</use-transactions>
<source>nl.ordina.flex.adfbc.EmployeeAssembler</source>
<scope>application</scope>
<metadata>
<identity property="employeeId" type="java.math.BigDecimal" />
</metadata>
<network>
<session-timeout>20</session-timeout>
<paging enabled="false" pageSize="100" />
<throttle-inbound policy="ERROR" max-frequency="500"/>
<throttle-outbound policy="REPLACE" max-frequency="500"/>
</network>
</properties>
</destination>
</service>
Now we can create a Flex lifecycle project ( For more information on creating a flex j2ee project see one of my BlazeDS examples. But here we have to create the employee object too. Create an new Class called Employee
package
{
import flash.display.InteractiveObject;
[Managed]
[RemoteClass(alias="nl.ordina.flex.adfbc.Employee")]
public class Employee
{
public function Employee()
{
}
public var employeeId:int;
public var firstName:String;
public var lastName:String;
public var email:String;
public var phoneNumber:String;
public var hireDate:Date;
public var jobId:String;
public var salary:Number;
public var commissionPct:Number;
public var managerId:int;
public var departmentId:int;
}
}
Add the employee destination to mx:DataService. Import the employee object by adding xmlns="*" to the mx:Application element. Now you can use <Employee/> in Flex.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="*"
width="1155" height="276"
applicationComplete="ds.fill(employeeArray)" >
<mx:ArrayCollection id="employeeArray"/>
<mx:DataService id="ds" destination="employee"/>
<Employee/>
<mx:DataGrid dataProvider="{employeeArray}" editable="true"
width="100%" height="100%"/>
</mx:Application>
Start the flex project twice so you can see the data push in action.
Having JDeveloper 10.1.3.x on your PC
$JDEV_HOME\j2ee\home\admin_client.jar - OC4J provides a command-line utility,
admin_client.jar, for performing configuration, administration, and deployment tasks on active OC4J instances in an Oracle Application Server clustered environment as well as on a standalone OC4J server. In addition, you can use admin_client.jar to restart or stop an OC4J instance or group of instances. See this document for more details.Oracle® Containers for J2EE Configuration and Administration Guide
10g (10.1.3.1.0)
Part Number B28950-01
http://download-uk.oracle.com/docs/cd/B31017_01/web.1013/b28950/adminclient.htm#BABCCJEC
$JDEV_HOME\webservices\lib\wsa.jar - The WebServicesAssembler tool assists in assembling Oracle Application Server Web Services. It enables you to generate the artifacts required to develop and deploy Web services, regardless of whether you are creating the service top down or bottom up. The WebServicesAssembler can also be invoked to create Web service client objects based on a WSDL. See this document for more details.
Oracle® Application Server Web Services Developer's Guide
10g (10.1.3.1.0)
Part Number B28974-01
http://download-uk.oracle.com/docs/cd/B31017_01/web.1013/b28974/wsassemble.htm#CHDDBCCA
For both of these utilties use the -help option for more details of what command line options can be used.
Eg:
java -jar D:\jdev\jdevprod\10133\webservices\lib\wsa.jar -helpNote: Stand Alone OC4J has the same JAR files as well.http://feeds.feedburner.com/TheBlasFromPas
Is AD really the dominant Identity Store out there?
Using Adobe LifeCycle in the embedded OC4J server
Now you can run LifeCycle from jdeveloper and please try the Data services features with java , hibernate or SQL adapter.
Enterprise 2.0: What It Is, and How You'll Fail

A few days ago Justin asked me if I would like to give a presentation at Oracle's Enterprise 2.0 Bootcamp on July 28th... I said sure, but only if I get to be controversial.
Hopefully this topic will be controversial enough!
I've heard a lot of buzz about Enterprise 2.0 lately... and lots of Enterprise Content Management folks (including Newton, Pie, and Billy) still seem to be frustrated by the general lack of a coherent definition of what exactly is Enterprise 2.0? Frankly, I think the very act of defining Enterprise 2.0 defeats the whole purpose, but I appreciate that some people need guidance...
The world is filled with "thought leaders" trying to railroad people into a narrow definition that is properly aligned with their own technology and ego... Some say E 2.0 is just Web 2.0 for the enterprise. Some say its emerging enterprise architectures (SOA, ESB, CEP, IdM) that make services easier to govern and re-use. Others -- like the lame-os at Wikipedia -- say its nothing more than enterprise social software. Others say its just the Knowledge Management Beast rearing its ugly head yet again...
triple ish on that last one...
In my upcoming book, I spend a chapter on how Enterprise Content Management fits in with Enterprise 2.0... and after swimming in blogs for the past year I think I have synthesized an approximate definition that might make everybody happy:
Enterprise 2.0 is an emerging social and technical movement towards helping your business practices evolve. At its heart, its goals are to empower the right kind of change by connecting decision makers to information, to services and to people.
Swish! Leave a comment and tell me what you think... Hot or not?
Its vital to understand that E 2.0 is still a moving target... we know that the enterprise is changing radically, but we don't have enough hard data to say what its changing into. However, I feel its just the latest leap in the neverending goal to make information and services more re-usable.
As an added twist, E 2.0 also has at its core the goal of connecting people with each other in order to discover the tremendous value that exists outside "the process." If the purpose of process is efficiency, then why do so many people in enterprises complain that their process is horribly inefficient? It might be because your process just plain sucks, or it might be because the process is keeping you from changing something that has drastic side-effects outside your view of the company. The point is not to mock or destroy "the process," but to help processes evolve at the optimal rate. This is not possible unless all decision makers can see first-hand how their changes negatively affect other departments. This cannot be done with metrics alone: you need friendly hallway conversations between people who normally would hate each other.
Unfortunately, after coming up with that definition I was staring point blank at something a little unsettling... If people focus on the wrong things, Enterprise 2.0 will FAIL HORRIBLY the same way Knowledge Management FAILED HORRIBLY! For those who forget, Knowledge Management was some snake oil sold 20 years ago saying that access to information was the #1 problem... its not. The problem is access to the right information at the right time in the right format. My industry -- Enterprise Content Management -- emerged from the ashes of Knowledge Management, trying to implement the few good ideas that it offered.
So... how did Knowledge Management fail? What implications does this have for the failure of Enterprise 2.0? I'm no psychic, but I anticipate that people might make similar mistakes... it all boils down to one problem: you're probably focussing on the wrong thing! How could you fail? Here's five ways:
The Lotus Notes "But Bull Duck"
After yesterday's post on how the best analogy for software design is gene splicing, Michelle pointed me to perhaps one of the saddest marketing ideas ever... The Lotus Notes "But Bull Duck", brought to you by the kind folks at IBM.
I am NOT making this up.
For some reason that I can only attribute to a prolonged lack of fiber, the Lotus folks at IBM decided to put together an online ad campaign about how wonderful Lotus Notes 8 is... Hosted at createsimplicity.com, it allows you to design your own unholy cross-breeds of different animals, and save them to your desktop... each has a different name when you download it. My favorite? The "But Bull Duck".
Apparently the new motto is unify and simplify.
Ummmm... I'm all for unification and simplicity... and I do appreciate the idea that the best analogy for software design is gene splicing... but comparing Lotus Notes to the "But Bull Duck" might not be the best way to get new customers... nor is it the best way to demonstrate to your existing customer base that its time to upgrade. In all likelihood, the "But Bull Duck" will make them think your software is awkward and bizarre.
Viral marketing, or truth in advertising? You choose.
Convergence of Content And Data
Convergence of Content And Data
SOA success - value over technology
Delving deeper into Relationship-based RBAC
I hate technology, I love solutions
Using EJB in Flex with blazeds
In the model project we can create a new entity bean. I use the CMP entity bean from tables.

Now we can create a Session Bean
If we look at the properties of the session bean we see the retrieveAllEmployees method. We will use this to display all the employees in flex. 
We are ready to add the blazeds libraries to the viewcontroller project. Because we want to use EJB, we have to download an extra library. Here is the link of the ejb library which is made by Ryan J. Norris. Add also this library to the viewcontroller project.
Because we use ejb we have to add the embedded oc4j client and j2ee library to viewcontroller project.
Now we can configure blazeds. We have to create two files (remoting-config.xml and services-config.xml ) in WEB-INF/flex/ folder
Here is the remoting-config.xml file. In this file we define a destination with the name of the session bean in the model project.
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service" class="flex.messaging.services.RemotingService">
<adapters>
<adapter-definition id="java-object"
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true"/>
</adapters>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
<destination id="EmployeeEJB">
<properties>
<factory>ejb</factory>
<source>SessionEJB</source>
</properties>
</destination>
</service>
Here is the services-config.xml. In this file we define the ejb factory in my case I have to use com.adobe.ac.ejb.EJBFactory for ejb3 we have to use com.adobe.ac.ejb.EJB3Factory as factory class.
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service-include file-path="remoting-config.xml"/>
<default-channels>
<channel ref="my-amf"/>
</default-channels>
</services>
<factories>
<factory id="ejb" class="com.adobe.ac.ejb.EJBFactory" />
</factories>
<channels>
<channel-definition id="my-amf"
class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
</properties>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<properties>
<prefix>[Flex] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
</target>
</logging>
</services-config>
Add the blazeds servlet to the web.xml
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MessageBrokerServlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
The last step in jdeveloper is to add -Doc4j.jmx.security.proxy.off=true to the run options of the viewcontroller project.
Let's open Flex builder 3 and create a new project.

We have to select j2ee server technology.

The second step is to add the webapp url's.
The mxml is very simple. First we add a remoteobject, then we are calling theretrieveAllEmployees method when the application is loaded and at last we display the result in a datagrid.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
width="1155" height="206.21213">
<mx:applicationComplete>
srv.retrieveAllEmployees()
</mx:applicationComplete>
<mx:RemoteObject id="srv" showBusyCursor="true"
destination="EmployeeEJB"/>
<mx:DataGrid width="1104.6212"
dataProvider="{srv.retrieveAllEmployees.lastResult}"
height="140.98485"/>
</mx:Application>
Here the result. That's all.




