Monday, November 24, 2014

Please make sure that the port attribute for the binding defined in the composite file is correct by checking the namespace service name and port name

There was an error deploying the composite Deployment Failed: Unable to find a WSDL that has a definition for service . Please make sure that the port attribute for the binding defined in the composite file is correct by checking the namespace service name and port name. In addition check that the WSDL associated with the binding namespace is imported and currently reachable (check the import nodes at the top of the composite file). Finally validate the HTTP proxy settings for the server..

This is a common error while deploying the composite from JDEV

One of the major reason for this error is due to invalid imports. Sometimes local MDS reference might have used during development time, but at deployment time it will be referring the target environment's MDS. In such cases ensure that your local MDS and target MDS are in sync.

Check all the import statements in the composite.xml. Ensure that each and every import statement is valid and the corresponding target resource is available.

Try to open the composite.xml in design view to see any wsdl loading errors happening.

Other reason could be because of the wrong config plan file used or
Wrong values for binding.ws port attribute in the composite.xml or
Wrong value for interface.wsdl interface in the composite.xml


If  there is a change in the reference/service/import sections in the composite.xml ensure you regenerate the config plan file.

Checking binding.ws port attribute in composite.xml
===============================
Follow the below rule to verify the correctness of binding.ws port attribute

<NAME_SPACE>#wsdl.endpoint(<SERVICE>/<PORT>)

For e.g

  <binding.ws port="http://xmlns.oracle.com/POCApplication/ApprovalService/ApprovalProcess#wsdl.endpoint(approvalprocess_client_ep/ApprovalProcess_pt)"/>

Where
Namespace is  - http://xmlns.oracle.com/POCApplication/ApprovalService/ApprovalProcess
Service is -  approvalprocess_client_ep
Port is -  ApprovalProcess_pt

Checking  interface.wsdl interface attribute in composite.xml
===============================
Follow the below rule to verify the correctness of  interface.wsdl interface port attribute

<NAME_SPACE>#wsdl.interface(<COMPONENTNAME>)

For e.g

http://xmlns.oracle.com/POCApplication/ApprovalService/ApprovalProcess#wsdl.interface(ApprovalProcess)

Where
namespace is - http://xmlns.oracle.com/POCApplication/ApprovalService/ApprovalProcess
component name is  - ApprovalProcess

Saturday, November 22, 2014

The process domain is encountering the following errors while loading the process : Validation of BPEL2.0 process failed.. This error contained an exception thrown by the underlying process loader module.


The process domain is encountering the following errors while loading the process : Validation of BPEL2.0 process failed..
This error contained an exception thrown by the underlying process loader module.
Check the exception trace in the log (with logging level set to debug mode). If there is a patch installed on the server, verify that the bpelcClasspath domain property includes the patch classes.

Even though our BPEL project is compiled in jdev, during deployment it can throw the above error.

From the error message we cant make out anything.


But one of the reasons for this compilation failure could be the java embedding used inside the BPEL process. If the java code refers some external classes and if that jar files are not set in the project in the SCA/lib folder this error can happen


To resolve the error at run time the same custom jar files must be made avaiable to the BPEL Process Manager at run time .

This can be achieved by following the below process

Navigate to Oracle_Home\soa\soa\modules\oracle.soa.ext_11.1.1 directory.

Copy your custom jar files under the classes directory

Open the command prompt and navigate to \Oracle_Home\soa\soa\modules\oracle.soa.ext_11.1.1

Run the ant command


\Oracle_Home\soa\soa\modules\oracle.soa.ext_11.1.1>ant
Buildfile: C:\installed\Oracle\Middleware12C\Oracle_Home\soa\soa\modules\oracle.
soa.ext_11.1.1\build.xml
  [taskdef] Could not load definitions from resource net/sf/antcontrib/antlib.xm
l. It could not be found.

create-manifest-jar:
   [delete] Deleting: \Oracle_Home\soa\soa\modu
les\oracle.soa.ext_11.1.1\oracle.soa.ext.jar
      [jar] Building MANIFEST-only jar: \Oracle
_Home\soa\soa\modules\oracle.soa.ext_11.1.1\oracle.soa.ext.jar

BUILD SUCCESSFUL
Total time: 0 seconds

Restart the Server

Importantly ensure that your .BPEL file uses the import statements for such referred classes

e.g

     <import location="oracle.xml.parser.v2.XMLElement" importType="http://schemas.oracle.com/bpel/extension/java"/>
  <import location="java.io.BufferedReader" importType="http://schemas.oracle.com/bpel/extension/java"/>
  <import location="java.io.ByteArrayOutputStream" importType="http://schemas.oracle.com/bpel/extension/java"/>
  <import location="java.io.InputStream" importType="http://schemas.oracle.com/bpel/extension/java"/>
  <import location="java.io.InputStreamReader" importType="http://schemas.oracle.com/bpel/extension/java"/>

After adding all  the  required import statements , redeploy the process

Wednesday, November 19, 2014

BINDING.JCA-11975 AQ_INVALID_QUEUE Unable to obtain queue table name


The invocation resulted in an error: Invoke JCA outbound service failed with connection error, exception: com.bea.wli.sb.transports.jca.JCATransportException: oracle.tip.adapter.sa.api.JCABindingException: oracle.tip.adapter.sa.impl.fw.ext.org.collaxa.thirdparty.apache.wsif.WSIFException: WSIF JCA Execute of operation 'Enqueue' failed due to: AQ_INVALID_QUEUE.
Unable to obtain queue table name.
Queue does not exist or not defined correctly.
; nested exception is:
BINDING.JCA-11975
AQ_INVALID_QUEUE.
Unable to obtain queue table name.
Queue does not exist or not defined correctly.
Drop and re-create queue.



This issue normally happens when the underlying schema changes.

For eg. while migrating AQAdapter from one ENV to another ENV normally only the following parameters might need to change

database name
hostname
port
service/sid

Usually we change these values in the datasource configuration in weblogic console

But in some situations if the target schema name is different than the one configured in the .jca file, this issue could happen

In such cases you may need to verify your .jca file and see the following property value reflect the correct schema name

<property name="DatabaseSchema" value="AQ_USER"/>

Redeploy the service after updating the jca file


How to rollback a patch for oracle soa suite

The simplest way of roll back a patch is :

opatch rollback -id <patch_number> 

Tuesday, November 11, 2014

Passing Custom Header from BPEL to OSB and vice versa

Sometimes we might have a requirement to pass some information via Header between BPEL and OSB.

In this post I am trying to explain one of the approaches possible to achieve that requirement

BPEL side
=========================

As a first step, create an xsd as shown below


=============Header.xsd==========================

<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns="http://xmlns.oracle.com/Custom/Header"
            targetNamespace="http://xmlns.oracle.com/Custom/Header"
            elementFormDefault="qualified">
  <xsd:element name="SessionHeader" type="SessionHeaderType"/>
  <xsd:complexType name="SessionHeaderType">
        <xsd:sequence>
            <xsd:element name="sessionToken" type="xsd:string"/>
            <xsd:element name="type" type="xsd:string"/>
        </xsd:sequence>
  </xsd:complexType>
</xsd:schema>

===================================================

Create two variables of type SessionHeader in the BPEL Process.

customHeader is to pass header values to the target service.

customHeaderIn is to receive the header values from a response received from target service.









On the invoke activity configure the input and output Header variables as follows


  <invoke name="InvokeTokenProcess" partnerLink="TokenProcess"
            portType="ns1:EmployeePortType" operation="GetEmployeeByEmpId" inputVariable="TokenProcess_IV"
            outputVariable="TokenProcess_OV" bpelx:invokeAsDetail="no" bpelx:inputHeaderVariable="customHeader" bpelx:outputHeaderVariable="customHeaderIn"/>


Use an assign activity before the invoke activity to set the required values in the customHeader variables

After invoke activity use another assign activity to retrieve the passed header- from target service on the customHeaderIn variable




OSB Side
=====================

 The passed custom Header can be retrieved in OSB pipeline as given below




 To send a custom header from OSB use the insert activity as given below



================
Deploy both BPEL and OSB service and do a test to see the header being passed correctly



Thursday, November 6, 2014

weblogic.jndi.internal.AdminModeAccessException

This issue happens mostly while doing lookup for ConnectionFactory,Queues,Topics etc

 One of the reason for this exception is that the managed servers stays at ADMIN mode rather than RUNNING mode.

In such cases ensure that the server state is RUNNING by debugging the issues seen on the logs while startup

Monday, November 3, 2014

Creating JMS Resources iteratively using Maven and WLST script in 12c

In the previous post we have seen how to create a JMSSserver and JMSModule using WLST.

To extent this script further, with multiple sets of JMSServer and JMSModules we can follow the below approach


Create jms.properties file for each set of configuration.

Please note use the convention as jms1, jms2,jms3 for the properties files

===========jms1.properties=================
domain.name=DefaultDomain
admin.url=t3://localhost:7101
admin.userName=weblogic
admin.password=weblogic1

jms.jmsserver=TEST_JMSSerer1
jms.jmssystemresource=TEST_JMSSystemResource1
jms.subdeployment=TEST_JMSSubdeployment1
jms.queue=TEST_JMSQUEUE1
jms.queue.jndi=jms/TEST_JMSQUEUE1
jms.topic=TEST_JMSTOPIC1
jms.topic.jndi=jms/TEST_JMSTOPIC1
jms.targetserver=DefaultServer

============end of properties================



===========jms2.properties=================

domain.name=DefaultDomain
admin.url=t3://localhost:7101
admin.userName=weblogic
admin.password=weblogic1

jms.jmsserver=TEST_JMSSerer2
jms.jmssystemresource=TEST_JMSSystemResource2
jms.subdeployment=TEST_JMSSubdeployment2
jms.queue=TEST_JMSQUEUE2
jms.queue.jndi=jms/TEST_JMSQUEUE2
jms.topic=TEST_JMSTOPIC2
jms.topic.jndi=jms/TEST_JMSTOPIC2
jms.targetserver=DefaultServer




============end of properties================

Save the following python script as jmsobjects.py

================start of python script============

 from java.io import FileInputStream

for i in 1,2:

  
    propInputStream = FileInputStream("path\\to\\jms"+str(i)+".properties")
    configProps = Properties()
    configProps.load(propInputStream)

    domainName=configProps.get("domain.name")
  
    adminURL=configProps.get("admin.url")
    adminUserName=configProps.get("admin.userName")
    adminPassword=configProps.get("admin.password")

    jms_server=configProps.get("jms.jmsserver")
    print 'jms_server : '+jms_server
    jms_systemResource=configProps.get("jms.jmssystemresource")
    print 'jms_systemResource : '+jms_systemResource
    jms_queue=configProps.get("jms.queue")
    print 'jms_queue : '+jms_queue
    jms_queue_jndi=configProps.get("jms.queue.jndi")
    print 'jms_queue_jndi : '+jms_queue_jndi
    jms_subdeployment=configProps.get("jms.subdeployment")
    print 'jms_subdeployment : '+jms_subdeployment
    jms_topic=configProps.get("jms.topic")
    print 'jms_topic : '+jms_topic
    jms_topic_jndi=configProps.get("jms.topic.jndi")
    print 'jms_topic_jndi :'+jms_topic_jndi
    jms_targetserver=configProps.get("jms.targetserver")
    print 'jms_targetserver : '+jms_targetserver


    #connect('weblogic','weblogic1', 't3://localhost:7101')
    connect(adminUserName, adminPassword, adminURL)

    # Creating a JMS Server

    edit()
    startEdit()
    cd('/')
    print 'Creating JMS Server.'
    cmo.createJMSServer(jms_server)
    cd('/JMSServers/'+jms_server)
    cmo.addTarget(getMBean('/Servers/'+jms_targetserver))
    activate()

    # Creating a Module

    startEdit()
    cd('/')
    cmo.createJMSSystemResource(jms_systemResource)
    cd('/JMSSystemResources/'+jms_systemResource)
    cmo.addTarget(getMBean('/Servers/'+jms_targetserver))
    cmo.createSubDeployment(jms_subdeployment)
    activate()

    # Creating Queue

    startEdit()
    print 'Creating Queue & Topic '
    cd('/')
    cd('/JMSSystemResources/'+jms_systemResource+'/JMSResource/'+jms_systemResource)
    cmo.createQueue(jms_queue)
    cd('/JMSSystemResources/'+jms_systemResource+'/JMSResource/'+jms_systemResource+'/Queues/'+jms_queue)
    set('JNDIName',jms_queue_jndi)
    set('SubDeploymentName',jms_subdeployment)
    cd('/JMSSystemResources/'+jms_systemResource+'/SubDeployments/'+jms_subdeployment)
    cmo.addTarget(getMBean('/JMSServers/'+jms_server))
    activate()

    # Creating Topic

    startEdit()
    cd('/')
    cd('/JMSSystemResources/'+jms_systemResource+'/JMSResource/'+jms_systemResource)
    cmo.createTopic(jms_topic)
    cd('/JMSSystemResources/'+jms_systemResource+'/JMSResource/'+jms_systemResource+'/Topics/'+jms_topic)
    set('JNDIName',jms_topic_jndi)
    set('SubDeploymentName',jms_subdeployment)
    cd('/JMSSystemResources/'+jms_systemResource+'/SubDeployments/'+jms_subdeployment)
    set('Targets',jarray.array([ObjectName('com.bea:Name='+jms_server+',Type=JMSServer')],ObjectName))
 
    
activate()
   

=================end of python script===========

Now open command prompt
Execute the following command after correcting the path as per your soa installation
mvn wls:wlst -DfileName=path/to/jmsobjects.py  - DmiddlewareHome=path/to/oraclehome 
-DdomainHome=path/to/domainhome

Creating JMS Resources using Maven and WLST in 12c


As a first step we need to install maven plugin wls-maven-plugin.

This plugin present in the ORACLE_HOME/wlserver_12.1/server/lib

Open a command prompt and navigate to the above location

Now we need to install this plugin to our repository( here by default the repository will be the local repository which is present at  c:/users/<username>/.m2  (for windows)).

To install the plugin use the following command


mvn install:install-file -Dfile=wls-maven-plugin.jar -DpomFile=pom.xml

Once the installation is successful we can verify whether the required goals are available using the following command

mvn com.oracle.weblogic:wls-maven-plugin:help

Here we can see the wlst task is available. 

Now we are ready to execute the WLST script using maven

Create a jms.properties file as shown below(change the values as per your requirement)
==================
domain.name=DefaultDomain
admin.url=t3://localhost:7101
admin.userName=weblogic
admin.password=weblogic1

jms.jmsserver=TEST_JMSSerer
jms.jmssystemresource=TEST_JMSSystemResource
jms.subdeployment=TEST_JMSSubdeployment
jms.queue=TEST_JMSQUEUE
jms.queue.jndi=jms/TEST_JMSQUEUE
jms.topic=TEST_JMSTOPIC
jms.topic.jndi=jms/TEST_JMSTOPIC
jms.targetserver=DefaultServer
============================================

Save the following python script as jmsobjects.py

note : remember to give the exact path to the jms.properties file)

========start of python script ==========

from java.io import FileInputStream

propInputStream = FileInputStream("path\\to\\jms.properties")
configProps = Properties()
configProps.load(propInputStream)

domainName=configProps.get("domain.name")
adminURL=configProps.get("admin.url")
adminUserName=configProps.get("admin.userName")
adminPassword=configProps.get("admin.password")

jms_server=configProps.get("jms.jmsserver")
jms_systemResource=configProps.get("jms.jmssystemresource")
jms_queue=configProps.get("jms.queue")
jms_queue_jndi=configProps.get("jms.queue.jndi")
jms_subdeployment=configProps.get("jms.subdeployment")
jms_topic=configProps.get("jms.topic")
jms_topic_jndi=configProps.get("jms.topic.jndi")
jms_targetserver=configProps.get("jms.targetserver")


#connect('weblogic','weblogic1', 't3://localhost:7101')
connect(adminUserName, adminPassword, adminURL)

# Creating a JMS Server

edit()
startEdit()
cd('/')
print 'Creating JMS Server.'
cmo.createJMSServer(jms_server)
cd('/JMSServers/'+jms_server)
cmo.addTarget(getMBean('/Servers/'+jms_targetserver))
activate()

# Creating a Module

startEdit()
cd('/')
cmo.createJMSSystemResource(jms_systemResource)
cd('/JMSSystemResources/'+jms_systemResource)
cmo.addTarget(getMBean('/Servers/'+jms_targetserver))
cmo.createSubDeployment(jms_subdeployment)
activate()

# Creating Queue

startEdit()
print 'Creating Queue & Topic '
cd('/')
cd('/JMSSystemResources/'+jms_systemResource+'/JMSResource/'+jms_systemResource)
cmo.createQueue(jms_queue)
cd('/JMSSystemResources/'+jms_systemResource+'/JMSResource/'+jms_systemResource+'/Queues/'+jms_queue)
set('JNDIName',jms_queue_jndi)
set('SubDeploymentName',jms_subdeployment)
cd('/JMSSystemResources/'+jms_systemResource+'/SubDeployments/'+jms_subdeployment)
cmo.addTarget(getMBean('/JMSServers/'+jms_server))
activate()

# Creating Topic

startEdit()
cd('/')
cd('/JMSSystemResources/'+jms_systemResource+'/JMSResource/'+jms_systemResource)
cmo.createTopic(jms_topic)
cd('/JMSSystemResources/'+jms_systemResource+'/JMSResource/'+jms_systemResource+'/Topics/'+jms_topic)
set('JNDIName',jms_topic_jndi)
set('SubDeploymentName',jms_subdeployment)
cd('/JMSSystemResources/'+jms_systemResource+'/SubDeployments/'+jms_subdeployment)
set('Targets',jarray.array([ObjectName('com.bea:Name='+jms_server+',Type=JMSServer')],ObjectName))

activate()

========================end of python script===============

Now open command prompt

Execute the following command after correcting the path as per your soa installation

mvn wls:wlst -DfileName=path/to/jmsobjects.py  - DmiddlewareHome=path/to/oraclehome 
-DdomainHome=path/to/domainhome 

No plugin found for prefix 'wls' in the current project

Even though the wls-maven-plugin is successfully installed, referring the goal via prefix might throw the above error.

mvn wls:wlst

Here wls is the prefix.

In such cases the following approach can be attempted

use the command in following format

mvn groupId:pluginname:goalname

For eg: To invoke the wlst goal on wls-maven-plugin use the following format

mvn com.oracle.weblogic:wls-maven-plugin:wlst


Sunday, November 2, 2014

Disabling logging and reporting globally in OSB 12c

The global disabling/enabling of logging,reporting etc can be performed from em console in 12c.

In 11g this can be done in service bus console

In 12c to  disable logging /reporting follow the below steps


1.       Logon to em console
2.       Under SOA select ServiceBus
3.       Right click on Service Bus which will open the properties as shown in the screenshot
4.       Go to Global Settings tab
5.       Uncheck logging option

6.       Apply the changes


The connection pool associated with it has already been destroyed

This error happens when WLS server invalidates the connections when we redeploy the adapter after adding a new JNDI . In such cases WLS server invalidates all the previous connection pool.

Though the connection pool JNDIs are visible at adapter configuration at run time it may fail with the error message "The connection pool associated with it has already been destroyed".

This seems to be a bug in weblogic

This mostly happens when we perform Adapter redeployment frequently.

To avoid this issue,

1.Delete all the existing connection pool JNDIs
2.Redeploy the Adatper
3.Restart your server
4.Add a new connection pool JNDI
5.Redeploy the Adapter

After this for any new JNDI added to the adapter ,ensure you only update the Adapter, not redeploy.