Publish Buisiness Event From ADF-BC Entity Object to SOA Server

By W.ZH  Sept 2011

Refer to the Andrejus Baranovskis and Putten’s blog, he has very good example for the Buisiness Event From ADF-BC Entity Object. Links are here:

http://andrejusb.blogspot.com/2009/08/business-events-and-adf-business.html

http://biemond.blogspot.com/2008/05/events-in-adf-bc-and-handled-by-soa.html

I have downloaded his example and tried it, here are some notes for it.

1. Entity Object has ability to config and trigger the buisiness events to SOA Suite, easy to use.

2. I have done some changes to his example as it has some issues when I tested it, such as it links a remote service to call, which is noise in the example.  and which uses old version DB of “hr” of the Oracle database example. So when I deployed the samples, it just does not run.

3. I put my working sample copy to here, you can download free
https://sites.google.com/site/wzhsite/files/SalaryEventSample.zip

SalaryManagement is one SOA composite application to receive the event.

SalaryUpdateRemote2 is the web application to create and publish the event.

4. You need to change the DB config info to point to your IP address and make it run.

5. You need to deploy the  SalaryUpdateRemote2  to your SOA server, such as soa_server1, which is my SOA composite appllications runs, as event publishing need to access the EDN in the SOA server context. Publishing EO’s application can not deploy to other server, such as AdminServer, it will get nullpointerexception when create event.

6. Then you can go to http://yourIPaddress:8001/suremote/faces/main.jspx  to access the test main page and to update employee’s salary, then you will see that an event is received by the SalaryManagement.

7. When you deploy the project through the jdeveloper to the SOA server, you might find some issue to run , such as
java.sql.SQLException: ORA-01005: null password given; logon denied , refer to my link to solve it.

Advertisements

Calling EJB From SOA Composite Application

By W.ZH Sept 2011From SOA Dev guide, we can have two ways to call the EJB – by SDO WSDL or by java interface. For the second method, I think best article is from Lucas article at here :http://technology.amis.nl/blog/8142/calling-an-ejb-from-a-soa-composite-application-using-the-ejb-binding-based-on-java-interface
I have follow his way to build the sample in Jdev 11.1.1.4, there are a bit jdev UI difference. But all things can work well together. I have upload my two projects to here:
https://sites.google.com/site/wzhsite/files/BPEL_call_EJB_Example.zip

You can download and try out.

other link might be useful:
http://biemond.blogspot.com/2009/07/using-ejb-service-reference-in-soa.html

 

http://blogs.oracle.com/rammenon/entry/invoking_an_ejb_session_bean_f

 


java.sql.SQLException: ORA-01005: null password given; logon denied

By W.ZH Sept 2011


Issue:

When i have one project ADF BC in Jdeveloper, config datasource and it can work, then i deploy this project into WLS server 11.1.1.4, and also config the right Datasource in WLS. but when this project start to run ti get this error:

oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.ConnectionPool.createConnection(ConnectionPool.java:253)
at oracle.jbo.server.ConnectionPool.instantiateResource(ConnectionPool.java:168)
at oracle.jbo.pool.ResourcePool.createResource(ResourcePool.java:546)
at oracle.jbo.pool.ResourcePool.useResource(ResourcePool.java:327)
at oracle.jbo.server.ConnectionPool.getConnectionInternal(ConnectionPool.java:104)
Truncated. see log file for complete stacktrace
java.sql.SQLException: ORA-01005: null password given; logon denied

Solution:

To read here last step:

http://radalcove.com/blog/?p=34

To ensure that the credentials that you supply in the database connections for your ADF Application are deployed and include the password, add -Djps.app.credential.overwrite.allowed=true to the JAVA_PROPERTIES entry in the FMW_HOME/user_projects/domains/yourdomain/bin/setDomainEnv.sh file (or setDomainEnv.cmd if you are on Windows), and restart the server using FMW_HOME/user_projects/domains/yourdomain/bin/startWebLogic.sh.

java.lang.ClassCastException: oracle.jbo.common.DefaultSessionContextImpl cannot be cast to oracle.jbo.SessionContext

By W.ZH Sept 2011

Issue:

When I use the Configuration.createRootApplicationModule to access the ADF-BC Application module client method. I get this kind of exception:

java.lang.ClassCastException: oracle.jbo.common.DefaultSessionContextImpl cannot be cast to oracle.jbo.SessionContext.

This exception happens only after several times client code running fine. As my code is a EJB timer, I can see it runs very good to open the AM method at the first several times timer call, but then get this exception and the timer just does not work anymore.

Reason:

Please refer to this link: https://cn.forums.oracle.com/forums/thread.jspa?threadID=995384 . It gives some background knowledge and where to look for solution. The fusion dev guide 11gR1 chapter “40 Application State Management”, have all the things you might need to understand.

Solution:

For my specific case, what I do to solve this issue on my AM :

Go to MYAM —> Configuration–>Edit MYAMLocal (DS settings for AM) –>Pooling and Scalability–>Disconnect Application Module Upon Release. I check this option for my AM, redeploy my application and this issue disappears.

RowInconsistentException JBO-25014: Another user has changed the row with primary key

By W.ZH, Sept 2011

Issue: 

When I develop the ADF BC code, I got this error “JBO-25014: Another user has changed the row with primary key [222]”. My project is based on the 11.1.1.4 release, both Jdev and Weblogic server.

Reason:

The issue normally is caused by the data merge conlict to one EO, often when ur code is very complex. Read these chapters in the adf dev guide will help u understand it more.

Related Chapter in the ADF developer guide

4.10.11 How to Protect Against Losing Simultaneously Updated Data

40.11.1 How to Set Applications to Use Optimistic Locking

Solution:

You should notice that this kind of error, key[222]. 222 is the primary key for you conflict object cause the DB transaction commit error. By this, you can know which table/EO/VO cause the issue. (Just because in one transaction, you normally will change and read many VO/EO/table data.).

So get your Enitiy Object define and find out whiich filed is used as the change indictor in the EO, Normarlly we use the “Updated On” timestamp as the change indictor for the EO. So you can check the check box of Refresh After Insert and Refresh After Update options in the Edit Attribute dialog. Then try again. This mostly can solve this issue.

Refer links:

http://cn.forums.oracle.com/forums/thread.jspa?messageID=7440027

weblogic.jdbc.wrapper.Clob…. error

By W.ZH  Sept 1 2011

Issue:

When I use the Clob and Blob in the DB, such as try to use ADF-BC to retrieve them out , it can not be converted to string from the blob domain object. System log shows that read out blob data is a weblogic.jdbc.wrapper.Clob_weblogic_jdbc_base_Base Object. So it gets conversion error.

Another problem you may facing is that, when you try to write a clob data into the DB by commit, you get an error like this:

“java.lang.NullPointException at oracle.domain.ClobDomain.writerCharsToClob (……)”

This issue also is caused by same reason.

Solution:

In the Data Soruce configuration  In Weblogic, there is a flag can control this:

Admin Console –> DataSource–> your DS–> Connection pool –>Advanced–>

There is check box for “Wrap Data Types”, uncheck this , restart your WLS to test again. you will see the db data readout will be sql blob….