Friday 26 November 2010

OC4J Configurations for Deploy Apache CXF Web Services

In this post I’ll guide you to port web service developed using Apache CXF and Spring Framework into Oracle Application server. After hitting the first deployment issue, I referred to Apache CXF Application Server Specific Configuration Guide. When going through this page, I noted some of the information (e.g - Get rid of OC4J JAX-WS libraries section) risk your Oracle Application server, as it require customization of oc4j.jar file. Actually I have oc4j.jar file as per this page, however when starting my SOA 10.1.3.5 instance, I ended-up with number of exceptions. Rather trying to resolve this issue, I decided another way of deploying the web service application. Please refer to OC4J_Configuration_For_Apache_CXF for all the steps I followed during the deployment.

Summery..
  • Preparing stax-api
  • Replace the Oracle XML parser with Xerces
    • Added xercesImpl.jar, xml-apis.jar, xalan.jar and serializer.jar from Xalan distribution
    • Added geronimo-ws-metadata_2.0_spec-1.1.2.jar from CXF distribution.
  • Swapping Oracle wsdl.jar with wsdl4j.jar
    • Only nedded -Xbootclasspath/p:<path to wsdlj>/wsdl4j-1.6.1.jar
  • Deploying applications
  • Additionally I added all required CXF and Spring Framework libraries in WEB-INF/lib
  • Get rid of OC4J JAX-WS libraries
3. I used following versions of software.
  • Oracle SOA Suits 10.1.3.5.0 (I also tested on 10.1.3.3.0)
  • Apache CXF 2.2.5
  • Xalan 2.7.1
  • Spring Framework 2.5.5
**********************************************************************************************************************

Thursday 11 November 2010

"OracleASjms/ESBMonitorTopic not found"

You might find 'OracleASjms/ESBMonitorTopic not found Make sure the topic is mapped to a jndi tree' error in oc4j container log file, after you set-up a ESB cluster. I face the same issue after I install ESB-RT and ESB-DT in two different oc4j containers. My objective was to exlopre Oracle ESB clustering options. I was trying to install Oracle BPEL and Oracle ESB-RT in one oc4j_soa container and ESB-DT in another oc4j_esbdt container, but using the same ORACLE_HOME. Starting from SOA 10.1.3.3 ESB-DT can be installed into same ORACLE_HOME as ESB-RT. However ESB-DT should be in different oc4j container

The installation went successful and no errors reported during installation and on log file. However when starting oc4j_soa container where ESB-RT installed, the following error thrown in opmn log file.

11/11 12:10:31 oracle.tip.esb.server.dispatch.QueueHandlerException: Context lookup failed "OracleASjms/ESBMonitorTopic not found" Make sure the topic is mapped to a jndi tree
10/11/11 12:10:31  at oracle.tip.esb.server.dispatch.JMSEnqueuer.createConnection(JMSEnqueuer.java:203)
......
11/11 12:10:31 Caused by: javax.naming.NameNotFoundException: OracleASjms/ESBMonitorTopic not found

This is because default default JNDI tree entries in OracleASjms adapter created by ESB install are missing in $ORACLE_HOME/j2ee/oc4j_soa/config/oc4j-connectors.xml file. Add following after taking a backup of oc4j-connectors.xml file and restart the container.

<adminobject-config location="OracleASjms/ESBDeferredTopic">
    <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
    <config-property name="jndiName" value="jms/topic/WF_JAVA_DEFERRED"/>
    <config-property name="resourceProviderName" value="oc4jjms"/>

</adminobject-config>
<adminobject-config location="OracleASjms/ESBControlTopic">
    <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
    <config-property name="jndiName" value="jms/topic/WF_CONTROL"/>
    <config-property name="resourceProviderName" value="oc4jjms"/>

</adminobject-config>
<adminobject-config location="OracleASjms/ESBMonitorTopic">
    <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
    <config-property name="jndiName" value="jms/topic/ESB_MONITOR"/>
    <config-property name="resourceProviderName" value="oc4jjms"/>

</adminobject-config>
<adminobject-config location="OracleASjms/ESBErrorRetryTopic">
     <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
     <config-property name="jndiName" value="jms/topic/ESB_ERROR_RETRY"/>
     <config-property name="resourceProviderName" value="oc4jjms"/>

</adminobject-config>
<adminobject-config location="OracleASjms/ESBErrorTopic">
     <adminobject-class>oracle.j2ee.ra.jms.generic.AdminObjectTopicImpl</adminobject-class>
     <config-property name="jndiName" value="jms/topic/ESB_ERROR"/>
     <config-property name="resourceProviderName" value="oc4jjms"/>

</adminobject-config>


Oops. After restarting the container, another error in opmn log file.


11/11 13:23:22 oracle.tip.esb.server.dispatch.QueueHandlerException: Publisher not exist for system "{0}"
10/11/11 13:23:22  at oracle.tip.esb.server.dispatch.JMSEnqueuer.createConnection(JMSEnqueuer.java:200)
.......
11/11 13:23:22 Caused by: javax.jms.InvalidDestinationException: Looking up java:comp/resource/oc4jjms/jms/topic/ESB_MONITOR: javax.naming.NameNotFoundException: No resource named 'oc4jjms/jms/topic/ESB_MONITOR'found
10/11/11 13:23:22  at oracle.j2ee.ra.jms.generic.AdminObjectImpl.getAdminObject(AdminObjectImpl.java:339)


To resolve this issue, add the following in $ORACLE_HOME/j2ee/oc4j_soa/config/jms.xml file.

<topic name="ESB Monitoring Topic" location="jms/topic/ESB_MONITOR"></topic>
<topic name="ESB Control Topic" location="jms/topic/WF_CONTROL"></topic>
<topic name="ESB Deferred Topic" location="jms/topic/WF_JAVA_DEFERRED"></topic>
<topic name="ESB Error Resubmission Topic" location="jms/topic/ESB_ERROR_RETRY"></topic>


**********************************************************************************************************************************************

Wednesday 3 November 2010

ora:parseEscapedXML XPath expression failed in SOA 10.1.3.5.0

We were running on SOA 10.1.3.3.0 on Windows and recently we migrated into SOA 10.1.3.5.0 on Oracle Linux Enterprise server 5.5. After the migration we deployed all our BPEL processors in new architecture. During the first testing scenario BPEL process start to fail with error;

XPath expression failed to execute. Error while processing xpath expression, the expression is "ora:parseEscapedXML(bpws:getVariableData('getInternalMsg',
'InternalMsgOutputCollection','/ns95:InternalMsgOutputCollection/ns95:InternalMsgOutput/ns95:INTERNAL_MSG'))", the reason is Expected name instead of  .. Please verify the xpath query.

After analysis we found this is because of source xml having '&' character. Metalink note 567712.1 says ora:parseEscapedXML fail if you send '&' character. However our Windows environment with SOA 10.1.3.3.0 perfectly working with ora:parseEscapedXML and '&' character.

Solution:
If you are in or above 10.1.3.4.0, replace ora:parseEscapedXML() with ora:parseXML(). If you are in 10.1.3.3.0, apply 10.1.3.3.1 MLR#8 and then user ora:parseXML().

********************************************************************************************************************************************