Monday, April 9, 2012

After Oracle DB upgrade from 10g to 11g, Oracle BAM Active Data Cache Service cannot be started. It throws "ORA-1017: invalid username/password; logon denied" error


Cause: Database was upgraded to Oracle 11g in which passwords are case sensitive while in 10g passwords were not case sensitive.
The issue was because we were having 10g ODP.NET at our BAM machine instead of 11g. Whenever we send the passwords using 10g ODP.NET ,it converts them into all upper cases and send it to 11g DB thus resulting in "ORA-1017: invalid username/password; logon denied" error when we try to start active data cache service.
 
Resolution: There are multiple resolutions for this issue
1.       Upgrade ODP.NET to 11g
2.       Change the password such that each character is in upper case
3.       Set SEC_CASE_SENSITIVE_LOGON to FALSE so that on 11g database password become insensitive

Friday, February 10, 2012

ORABPEL-12137 - Error while creating Queue producer:

Error Message:


Error Invoking BAM JMS Adapter:

ESB Dispatch failed with error An unhandled exception has been thrown in the ESB system. The exception reported is: "org.collaxa.thirdparty.apache.wsif.WSIFException: esb:///ESB_Projects/ESB_BAMJMSProducer/BAMJMSProducer.wsdl [ Produce_Message_ptt::Produce_Message(AuditLog) ] - WSIF JCA Execute of operation 'Produce_Message' failed due to: ERRJMS_ERR_CR_QUEUE_PROD.
Error while creating Queue producer:.
; nested exception is:
        ORABPEL-12137
ERRJMS_ERR_CR_QUEUE_PROD.
Error while creating Queue producer:.
Please examine the log file to determine the problem.



Solution:


In my case required queue was missing. So I created the queue and it started working. I also suggest to verify from your oc4j-ra.xml that the adapter JNDI entries are correct.

Wednesday, November 2, 2011

JAVA API to verify JMS Consumer

Sometime it happens that JMS Consumer (BPEL/ESB Process) stops consuming message from the JMS Queue. This queue could be either on the SOA Side or on participating application side. To narrow down to the root cause of the issue, below JAVA API will be highly useful. The JAVA API will consume the data from the queue if queue is working properly so in that case you need to look into your consumer process to trace out the root cause of the issue. In case the JAVA API is throwing any error then it means there is an issue at the queue end which needs to be sorted out.

To set up the enviroment to execute this JAVA API please go through the previous post "Test your JMS Queue" and follow step no. 1 (Environment setup).

2. Create a JAVA file with name TestJMSConsumer.java and copy the below code in it

import java.util.Hashtable;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.jms.*;

public class TestJMSConsumer
{

  public static void main(String[] args)
  {

    //*******************************************************************************************
    //* Change settings below according to JMS provider requirements
    //*******************************************************************************************

    // Set Context Factory
    final String myContextFactoryName = "com.evermind.server.rmi.RMIInitialContextFactory";

    // Set the target queue connection factory
    final String myQueueConnectionFactoryName = "java:comp/resource/COMMS_SUBMITORDER_PRODUCER/XAQueueConnectionFactories/AIA_Queue";

    // Set the target queuename
    final String myQueueName = "java:comp/resource/COMMS_SUBMITORDER_PRODUCER/Queues/JMSUSER.AIA_CRTFO_IN_JMSQ";

    // Set UrlProvider
    final String myUrlProviderName = "opmn:ormi://soaserver:6003:oc4j_soa/default";

    // Set user+password credentials
    final String myUser     = "oc4jadmin";
    final String myPassword = "password";

    //*******************************************************************************************

    String classPath = System.getProperty("java.class.path",".");

    Context                jndiContext = null;
    QueueConnectionFactory myQueueConnectionFactory = null;
    QueueConnection        myQueueConnection = null;
    QueueSession           myQueueSession = null;
    Queue                  myQueue = null;
    QueueReceiver          myQueueReceiver = null;


    /*
     * Set the environment for a connection to the JMS server
     */
    Hashtable myEnv = new Hashtable();
              myEnv.put(Context.INITIAL_CONTEXT_FACTORY, myContextFactoryName);
              myEnv.put(Context.SECURITY_PRINCIPAL,      myUser);
              myEnv.put(Context.SECURITY_CREDENTIALS,    myPassword);
              myEnv.put(Context.PROVIDER_URL,            myUrlProviderName);

    System.out.println("Using :-");
    System.out.println("Context Factory=" + myContextFactoryName);
    System.out.println("Queue Connection Factory=" + myQueueConnectionFactoryName);
    System.out.println("Url Provider=" + myUrlProviderName);
    System.out.println("");
    System.out.println("Current CLASSPATH=" + classPath);
    System.out.println("");

    /*
     * Set the Context Object.
     * Lookup the Queue Connection Factory.
     * Lookup the Queue
     */
    try
    {
       jndiContext = new InitialContext(myEnv);
       System.out.println("Lookup Queue Connection Factory : " + myQueueConnectionFactoryName);

       myQueueConnectionFactory = (QueueConnectionFactory)jndiContext.lookup(myQueueConnectionFactoryName);
       System.out.println("OK");
       System.out.println("Lookup Queue " + myQueueName);

       myQueue = (Queue)jndiContext.lookup(myQueueName);
       System.out.println("OK");
    }
    catch (NamingException e)
    {
       System.out.println("JNDI lookup failed: " + e.toString());
       System.exit(1);
    };

    /*
     * Create connection factory, session, receiver and receive message
     */
    try
    {
       myQueueConnection = myQueueConnectionFactory.createQueueConnection();
       myQueueSession    = myQueueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
       myQueueReceiver  = myQueueSession.createReceiver(myQueue);

       // Start the queue connection
       myQueueConnection.start();

       System.out.println("Receiving Message...");

       TextMessage message = (TextMessage) myQueueReceiver.receive();
       System.out.println("Received Message: " + message.getText());

       // Close the queue connection
       myQueueConnection.close();

  }
    catch (JMSException e)
    {
       System.out.println("Exception occurred: " + e.toString());
    }
    finally
    {
       if (myQueueConnection != null)
       try
       {
         myQueueConnection.close();
       }
       catch (JMSException e)
       {
        System.out.println("Close error: " + e.toString());
       };
    };
  }; // end main
}// end TestJMSConsumer class


3. Modify the parameters mentioned below:

• ORACLE_HOME

• myQueueConnectionFactoryName

• myQueueName

• myUrlProviderName

• myPassword



4. Steps to execute the code:

[oracle@soaserver JMSClient]$ source setpath.sh

[oracle@soaserver JMSClient]$ javac TestJMSConsumer.java

[oracle@soaserver JMSClient]$ java TestJMSConsumer



Sunday, October 16, 2011

Test your JMS Queue

Test your JMS Queue:


Script location: /home/oracle/scripts/JMS/JMSClient

1. Environment setup:

a. Create a script (setpath.sh) to set the environment:

export ORACLE_HOME=/u01/app/aia/soa

export CLASSPATH=.:$ORACLE_HOME/lib/xml.jar:$ORACLE_HOME/lib/xmlparserv2.jar:$ORACLE_HOME/bpel/system/services/lib/bpm-services.jar:$ORACLE_HOME/bpel/lib/bpm-infra.jar:$ORACLE_HOME/bpel/lib/connector15.jar:$ORACLE_HOME/bpel/lib/oracle_http_client.jar:$ORACLE_HOME/j2ee/home/oc4jclient.jar:$ORACLE_HOME/bpel/lib/orawsdl.jar:$ORACLE_HOME/bpel/lib/orabpel.jar:$ORACLE_HOME/bpel/lib/orabpel-common.jar:$ORACLE_HOME/bpel/lib/orabpel-thirdparty.jar:$ORACLE_HOME/integration/esb/lib/commons-logging.jar:$ORACLE_HOME/integration/esb/lib/commons-codec-1.3.jar:$ORACLE_HOME/j2ee/home/admin_client.jar:$ORACLE_HOME/adminclient.jar:$ORACLE_HOME/argus.jar:$ORACLE_HOME/j2ee/home/lib/jmx_remote_api.jar:$ORACLE_HOME/j2ee/home/lib/jmxcluster.jar:$ORACLE_HOME/j2ee/home/lib/jmxri.jar:$ORACLE_HOME/j2ee/home/oc4jclient.jar:$ORACLE_HOME/opmn/lib/ons.jar:$ORACLE_HOME/opmn/lib/opmnconfig.jar:$ORACLE_HOME/opmn/lib/optic.jar:$ORACLE_HOME/opmn/lib/repositorycheck.jar:$ORACLE_HOME/j2ee/home/lib/jms.jar:$ORACLE_HOME/j2ee/home/lib/bcel.jar:$ORACLE_HOME/j2ee/home/lib/connector.jar

export PATH=$ORACLE_HOME/jdk/bin:$PATH



b. Copy oc4j-internal.jar in the folder JMSClient

[oracle@soaserver JMSClient]$ cp $ORACLE_HOME/j2ee/home/lib/oc4j-internal.jar .

c. Execute below commands

[oracle@soaserver JMSClient]$ source setpath.sh

[oracle@soaserver JMSClient]$ jar vxf oc4j-internal.jar com/evermind/util/JCAProperties.class



2. Create a JAVA file with name TestJMSClient.java and copy the below code in it

import java.util.Hashtable;

import javax.naming.Context;

import javax.naming.InitialContext;

import javax.naming.NamingException;

import javax.jms.*;



public class TestJMSClient

{



public static void main(String[] args)

{



//*******************************************************************************************

//* Change settings below according to JMS provider requirements

//*******************************************************************************************



// Set Context Factory

final String myContextFactoryName = "com.evermind.server.rmi.RMIInitialContextFactory";



// Set the target queue connection factory

final String myQueueConnectionFactoryName = "java:comp/resource/SiebelJmsRP/QueueConnectionFactories/QCF";



// Set the target queuename

final String myQueueName = "java:comp/resource/SiebelJmsRP/Queues/AIA_SALESORDERJMSQUEUE";



// Set UrlProvider

final String myUrlProviderName = "opmn:ormi://soaserver:6003:OC4J_SOA/default";



// Set user+password credentials

final String myUser = "oc4jadmin";

final String myPassword = "password";



//*******************************************************************************************



String classPath = System.getProperty("java.class.path",".");



Context jndiContext = null;

QueueConnectionFactory myQueueConnectionFactory = null;

QueueConnection myQueueConnection = null;

QueueSession myQueueSession = null;

Queue myQueue = null;

QueueSender myQueueSender = null;

BytesMessage myBytesMessage = null;



/*

* Set the environment for a connection to the JMS server

*/

Hashtable myEnv = new Hashtable();

myEnv.put(Context.INITIAL_CONTEXT_FACTORY, myContextFactoryName);

myEnv.put(Context.SECURITY_PRINCIPAL, myUser);

myEnv.put(Context.SECURITY_CREDENTIALS, myPassword);

myEnv.put(Context.PROVIDER_URL, myUrlProviderName);



System.out.println("Using :-");

System.out.println("Context Factory=" + myContextFactoryName);

System.out.println("Queue Connection Factory=" + myQueueConnectionFactoryName);

System.out.println("Url Provider=" + myUrlProviderName);

System.out.println("");

System.out.println("Current CLASSPATH=" + classPath);

System.out.println("");



/*

* Set the Context Object.

* Lookup the Queue Connection Factory.

* Lookup the Queue

*/

try

{

jndiContext = new InitialContext(myEnv);

System.out.println("Lookup Queue Connection Factory : " + myQueueConnectionFactoryName);



myQueueConnectionFactory = (QueueConnectionFactory)jndiContext.lookup(myQueueConnectionFactoryName);

System.out.println("OK");

System.out.println("Lookup Queue " + myQueueName);



myQueue = (Queue)jndiContext.lookup(myQueueName);

System.out.println("OK");

}

catch (NamingException e)

{

System.out.println("JNDI lookup failed: " + e.toString());

System.exit(1);

};



/*

* Create connection factory, session, sender and send message

*/

try

{

myQueueConnection = myQueueConnectionFactory.createQueueConnection();

myQueueSession = myQueueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

myQueueSender = myQueueSession.createSender(myQueue);

myBytesMessage = myQueueSession.createBytesMessage();



System.out.println("Sending message...");



String stringMessage = " ";

byte[] byteData = stringMessage.getBytes();

myBytesMessage.writeBytes(byteData);

myQueueSender.send(myBytesMessage);

System.out.println("OK"+stringMessage);

System.out.println("Sent message: " + " - " + myBytesMessage.getJMSMessageID());

}

catch (JMSException e)

{

System.out.println("Exception occurred: " + e.toString());

}

finally

{

if (myQueueConnection != null)

try

{

myQueueConnection.close();

}

catch (JMSException e)

{

System.out.println("Close error: " + e.toString());

};

};

};

}



3. Modify the parameters mentioned below:

• ORACLE_HOME

• myQueueConnectionFactoryName

• myQueueName

• myUrlProviderName

• myPassword



4. Steps to execute the code:

[oracle@soaserver JMSClient]$ source setpath.sh

[oracle@soaserver JMSClient]$ javac TestJMSClient.java

Note: TestJMSClient.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

[oracle@soaserver JMSClient]$ java TestJMSClient

Monday, June 27, 2011

How to find out Oracle AIA Patches applied on the server

1. Make sure Oracle Standalone Interim Patch Installer version is equal or greater than 11.1.0.0.0
[oracle@soaserver ~]$ opatch version
Invoking Standalone OPatch 11.1.0.0.0
OPatch Version: 11.1.0.0.0
OPatch succeeded.

2. Set ORACLE_HOME variable to point to your AIA_HOME
[oracle@soaserver ~]$export ORACLE_HOME=/oracle/aia
(Where /oracle/aia is the location of AIA directory on my soaserver)

3. Set SOA_HOME varaible to point to your SOA Home
[oracle@soaserver ~]$export SOA_HOME=/oracle/orasoa

(Where /oracle/orasoa is the location of SOA directory on my soaserver)

4.Set AIA_HOME variable to point to your AIA_HOME
[oracle@soaserver ~]$export AIA_HOME=/oracle/aia

5. Use opatch lsinventory to find out the AIA Patches
[oracle@soaserver ~]$opatch lsinventory -invPtrLoc $SOA_HOME/oraInst.loc -oh $AIA_HOME -jre $SOA_HOME/jdk/jre