You are here

Basic Troubleshooting Steps for EAI JMS Transport

 

The EAI JMS Transport is provided to allow connection to a JMS queue / topic. This document will outline overall required steps (referencing document as necessary) in order to achieve this.

NOTE: the JMS provider .jar files as well the content of the jndi.properties file is provided to illustrate JNDI/JMS connectivity setup to instance of the Oracle J2EE Application Server 10g (10.1.3.x), known also as the OC4J Server.The JMS messages Persistant Store in this example is the Oracle Advanced Queuing (AQ) feature of Oracle Database Server.

Review required settings for EAI JMS Transport

Before attempting to call the EAI JMS Transport, you will need to configure your Siebel client / server.

Important considerations are below.

Whether running a Siebel dedicated client, or a Siebel Server component, you need to provide details on where to find the Java Virtual Machine (JVM) and CLASSPATH.

If you are running a Siebel dedicated client, you edit the appropriate .cfg with required entries, for example :

NOTE HERE:

  • Siebel Java folder is: C:\JRE
  • Siebel Installation folder is: C:\SBL
  • Siebel folder with the "jndi.properties" file: C:\JNDI
  • Siebel folder of OC4J ( J2EE Application Server 10.1.3.x) .jar and ..class files collection is: C:\JMS

NOTE: the JCAProperties.class of the oc4j-internal.jar OC4J archive must be extracted in this folder keeping its name space hierarchy as folders tree (C:\JMS\com\evermind\util). Following command of java archiver utility (JAR) can be used to achieve it: jar vxf oc4j-internal.jar com/evermind/util/JCAProperties.class
WARNING: The the oc4j-internal.jar OC4J archive should NOT BE INCLUDED in the CLASSPATH.

 

[JAVA]
DLL=C:\JRE\bin\client\jvm.dll

CLASSPATH=C:\JNDI;C:\SBL\CLASSES\Siebel.jar;
C:\SBL\CLASSES\SiebelJI_enu.jar; C:\JMS;C:\JMS\jndi.jar; C:\JMS\jms.jar; C:\JMS\oc4jclient.jar;C:\JMS\optic.jar;
C:\JMS\dms.jar; C:\JMS\ejb.jar;C:\JMS\mail.jar; C:\JMS\bcel.jar;C:\JMS\pcl.jar;C:\JMS\jta.jar;

VMOPTIONS="-xrs -Djava.compiler=NONE  -Djms.log=C:\SBL\LOG\jms_log"

 

Note, in addition to the Siebel jar files, you will need the jar files required by your JMS server (please refer to the documentation from your JMS provider).

If you are running on the Siebel Server, you will need to configure the JAVA named subsystem (type JVMSubSys) to provide the same properties.

For further information, see: Transports and Interfaces: Siebel Enterprise Application Integration > Java Message Service Transport

 

2. The jndi.properties

The EAI JMS Transport will attempt to locate a jndi.properties file from a directory named in the CLASSPATH. This file will typically denote the Initial Context Factory and Provider Url, for example :

NOTE HERE:

  • oc4j_host - the name of the OC4J Server machine, that hosts the JNDI provider
  • 6003 - the port of the opmn instance to access the OC4J Server
  • oc4j_soa - the name of the OCJ4 Instance
  • oc4jadmin/welcome1 - the name/password of the OCJ4 user who is allowed to

java.naming.factory.initial=oracle.j2ee.naming.ApplicationClientInitialContextFactory
java.naming.provider.url=opmn:ormi://oc4j_host:6003:oc4j_soa
java.naming.security.principal=oc4jadmin
java.naming.security.credentials=welcome1

Note, the actual values provided should be as documented by your JMS provider.

 

The VMOPTIONS (in the client cfg, or JAVA named subsystem) can be used to specify a log file, for example :

VMOPTIONS="-xrs -Djava.compiler=NONE -Djms.log=C:\SBL\LOG

 

(note, actual file created for above would be C:\SBL\LOG\jms_<nnnn>.txt, where <nnnn> is process id of the server component, or for dedicated client process id of the siebel.exe)

 

 

For dedicated client, set Siebel logging per Doc ID 475587.1 How Should Client Side Logging Be Set? (please set SIEBEL_LOG_EVENTS=all).

For Siebel Server components, set tracing for your component from srvrmgr :

change evtloglvl %=5 for comp <component>

Verify JMS is working as expected outside of Siebel application

The EAI JMS Transport acts as a java client to the target JMS server. When troubleshooting problems with the EAI JMS Transport, it is important to confirm whether the same operations are working fine outside of Siebel (and from the same machine and operating system user). For example, if a problem is found with Send method of the EAI JMS Transport, first confirm that it is successful when the same is tested outside of Siebel. One way to prove this is with a simple java client, to send a test message to a queue (using the same Classpath, Provider Url, Initial Context Factory, Connection Factory and Queue). An example java source is provided below, the only section requiring changes is that marked 'Change settings below according to JMS provider requirements'. Set the CLASSPATH to include required jar files (per your JMS provider documentation), compile with javac, and test by running :-

TestJMSClient.java:

NOTE HERE:

  • AQ Resource provider name (see "oc4j-connectors.xml" file in the "<j2ee>/<instance> /config" OC4J folder): myRP1
  • Connection Factory names (see "oc4j-ra.xml" file in "<j2ee>/<instance> /application-deployments/default/<resource adapter name>" OC4J folder):
    • Resource Name: QueueConnectionFactories/MyQCF1
      • NOTE: this name is seen in JNDI context as: java:comp/resource/myRP1/QueueConnectionFactories/MyQCF1
    • JNDI Name: jms/MyConnectionFactory1
      • Note: this name simplifies Connection Factory look up in JNDI context
  • Queue names (see "oc4j-connectors.xml" file in the "<j2ee>/<instance> /config" OC4J folder):
    • Resource Name: Queues/MyQ1
      • NOTE: this name is seen in JNDI context as: java:comp/resource/myRP1/Queues/MyQ1
    • JNDI Name: jms/MyQueue1
      • Note: this name simplifies Queue lookup in JNDI context

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 = "oracle.j2ee.naming.ApplicationClientInitialContextFactory";

// Set the target queue connection factory
final String myQueueConnectionFactoryName = "jms/ConnectionFactory1";
// same as: "java:comp/resource/myRP1/QueueConnectionFactories/QCF1";
// Set the target queuename
final String myQueueName = "jms/MyQueue1";
//same as: "java:comp/resource/myRP1/Queues/MyQ1";

// Set UrlProvider
final String myUrlProviderName = "opmn:ormi://oc4j_host:6003:home";

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



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;
TextMessage myTextMessage = null;

/*
* To override "jndi.properties" entries:
* one could set the environment for a connection to the JMS server
*/
/*JNDI context parametrization*...
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);
...*JNDI context parametrization*/

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(); //JNDI context parametrization: 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);
myTextMessage = myQueueSession.createTextMessage();

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

myTextMessage.setText("Testing 123");
myQueueSender.send(myTextMessage);
System.out.println("OK");
System.out.println("Sent message: " + myTextMessage.getText() + " - " + myTextMessage.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());
};
};
}; // end main
}// end TestJMSClient class

If this is not successful, please verify required settings are correct with your JMS provider. Once successful, then verify with detailed logging (refer 3. Tracing / Logging) that the EAI JMS Transport is using the same settings.

Common Errors

 

ErrorCauseAction
SBL-EAI-05010

Class name incorrect or does not extend SiebelBusinessService : com/siebel/data/SiebelPropertySet -- JVM Exception:java.lang.NoClassDefFoundError: com/siebel/data/SiebelPropertySet(SBL-EAI-05010)
This error is usually caused by incorrect entries for CLASSPATH and/or DLL in the named subsystem 'JAVA' (or for dedicated client, the [JAVA] section in the client cfg).

Ensure the Siebel.jar and SiebelJI_[lang].jar files are correctly named in the CLASSPATH, and exist in the specified directory (and that the directory is accessible to the relevant operating system user).

For unix, ensure the separators in the CLASSPATH are ':' (colon), not ';' (semi-colon).

SBL-EAI-05000 / SBL-EAI-05012

SBL-EAI-05000: Business Service call returned error code JNDI_ERROR and message: Exception: javax.naming.NameNotFoundException: myQCF; Message: myQCF

SBL-EAI-05102: JNDI error in EAI JMS Transport: 'Exception: javax.naming.NameNotFoundException: myQCF; Message: myQCF'.
The exception javax.naming.NameNotFoundException: indicates a failure to locate the ConnectionFactory and/or SendQueue parameters as supplied to the EAI JMS Transport.(1) Confirm that the supplied parameters are correct, and that the same Queue Connection Factory and Queue can be accessed outside Siebel with the test java client.
(2) Confirm, that the host names of OC4J Server machine and Oracle AQ DB machine are known to Siebel Server (Note: Definition of OC4J Data Source for AQ DB and other OC4J objects may include references to host names, that may not be known (not resolvable) on the Siebel Server side),
SBL-EAI-05000 / SBL-EAI-05102

SBL-EAI-05000: Business Service call returned error code JNDI_ERROR and message: Exception: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]; Message: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory


SBL-EAI-05102: JNDI error in EAI JMS Transport: 'Exception: javax.naming.NoInitialContextException: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.fscontext.RefFSContextFactory]; Message: Cannot instantiate class: com.sun.jndi.fscontext.RefFSContextFactory'.

SBL-EAI-05000: Business Service call returned error code JNDI_ERROR and message: Exception: javax.naming.CommunicationException: Can't find SerialContextProvider; Message: Can't find SerialContextProvider











The initial context factory (as provided in the jndi.properties 'java.naming.factory.initial') could not be found.


The initial context could not be instantiated (as provided in the jndi.properties)

 

Check the name of initial context factory in the jndi.properties is correct, and that CLASSPATH has all required JMS vendor jar files.

 

Confirm that the same java.naming.factory.initial setting, with same CLASSPATH works outside of Siebel with the test java client.

 

Confirm that the security credentials, once provided, in the java.naming.security.principal and java.naming.security.credentials parameters are correct.