Thursday, January 29, 2009

BPEL-Weblogic ClassLoader issue for Coherence

I had to deploy some existing code developed on SOA Suite on OC4J to SOA Suite on Weblogic, It was a good struggle for me, so here it goes -

The code basically is a bpel calling a java web service using wsif. And the java service uses the caching software coherence to read/write to an in memory cache.

1. First of all the java web service in Jdev didn't get deployed to weblogic - It gave me - java.lang.IllegalStateException: could not find schema type named {http}//weblogic/types/}getHelloResponse" (edited the actual type).

After some googling, it seems there r interoperability issues - so I had to use weblogic ant tasks to create/deploy the web service. Though the ant tasks like wsdlctask etc. were available my ant script didn’t run as it didn’t get xmlbean libraries, which I too couldn’t find in weblogic/lib. So my next attempt was to try develop this in workshop, which I am still trying as workshop didn't like my localhost weblogic server SOA domain, created as part of the SOA Suite on Weblogic installation scripts.

2. Since my java web service attempts were not getting anywhere, I decided to package the Java class (which would be called by WSIF anyway) in the bpel itself. That went pretty well, my wsif binding started working after a few issues with the namespace in my schema, bam code in bpel (which I removed later as it was throwing JCE Error asking to put new jars in jre/lib/ext at deployment). I couldn't find a jaxb ant task to replace the schemac, so I had to go with schemac to generate the java binding classes form the wsdl/schemas. Here too I faced compilation issues with the classes generated, so I had to edit the schema to remove the (maxOccurs="100000") entries. So finally when my bpel was ready with everything else, I had to test the coherence part.

3. The coherence part was the real hurdle to cross, by packaging the coherence.jar in my bpel output jar, I couldn't start the CacheFactory - It was complaining - Caused by: (Operation failed!; nested exception is: (Wrapped: Failed to load the factory) java.lang.reflect.InvocationTargetException - Wrapped: Failed to load configuration resource: coherence-cache-config.xml) java.io.IOException: Configuration is missing: "coherence-cache-config.xml", loader=null. So I tried putting the coherence.jar in the weblogic server classpath, and then it was working fine. I was able to create the CacheFactory and just then when I thought its done, the put/get to cache started throwing - (Wrapped) java.io.IOException: readObject failed: java.lang.ClassNotFoundException: com.schemas.Customer.CustomerQueryResultSet
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method).

Finally with the help of Coherence support, I learnt that I need to pass the classloader to CacheFactory.getCache() as the Classloaders get different when we go out of bpel domain to the coherence code and vice-versa. After passing the classloader, the whole thing worked fine.
sample code below -
NamedCache cache;
Thread thread = Thread.currentThread();
ClassLoader loaderPrev = thread.getContextClassLoader();


try
{
thread.setContextClassLoader(com.tangosol.net.NamedCache.class.getClassLoader());
cache = CacheFactory.getCache(sName);
}
finally
{
Thread.currentThread().setContextClassLoader(loaderPrev);
}

Saturday, January 17, 2009

Oracle Middleware

Oracle Products are primarily of 3 types
-Database
-Packaged Applications
-Middleware

Oracle Middleware products are categorized as

-SOA/BPM
I have already written about SOA/BPM line of products here
-Web2.0
Under this Enterprise Content management, portal servers from both the oracle and bea products.
-Application Grid
This has basically the app server (weblogic, oc4j) and the various grid technology products like Coherence, web cache etc.
-Identity management
-BI/EPM

Each category has lot of products for any kind of customer requirements and application patterns.

Tuesday, January 13, 2009

2009++

Recently I worked on a POC to call coherence java code from SOA Suite using WSIF binding, while trying to google up on the subject, found an interesting article, on 'real-time SOA'. This term 'real-time SOA' kind of hit me and I started googling up more, and hit upon many articles in sys-con on cloud computing. After Going through couple of you-tube videos on cloud computing and looking at the list 100s of companies working on related technologies like SaaS, Virtulaization etc. - I am amazed what the future holds.

I just completed 10yrs in IT as a developer in the outsourcing industry, and as I understand this decade (98-08) is what can be branded as web1.0, soa1.0, cloud computing1.0 - all 1.0 - and the next decade is going to be 2.0. We are already seeing it - be it SOA/BPM or Web2.0/AJAX, the 2.0 is starting to unfold.

After Listening to Bill Coleman here - I am right now just sleepless thinking how exciting the future looks.

Tuesday, January 06, 2009

My Oracle SOA Experience log -

From Apr/08

Installation of SOA Suite 10.1.3.3
Installation of AIA FP2.0.1
MDM PIP Development
Upgrading SOA Suite to 10.1.3.4 on Weblogic9.2

BPA suite installation
OSB installation and POC
Oracle Coherence

All installations on Windows laptop.

SOA Suite HA installation on Weblogic9.2/Linux