ayuda, problemas para conectar a MQSeries
Hola tengo problemas al conectar a una cola de MQSeries... este es el codigo... despues esta la salida de consola con el error en tiempo de ejecucion que muestra.... espero alguien pueda ayudarme a resolver esto:
-----code---------
package ejemplo;
import com.mine.mq.*;
/**
* @author JG
*
*/
public class MQSample {
private String qManager = "your_Q_manager"; // define name of queue
// manager to connect to.
private MQQueueManager qMgr; // define a queue manager
// object
public static void main(String args[]) {
System.out.println("Go Queue!");
new MQSample();
}
public MQSample() {
try {
// Create a connection to the queue manager
qMgr = new MQQueueManager(qManager);
// Set up the options on the queue we wish to open...
// Note. All MQSeries Options are prefixed with MQC in Java.
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;
// Now specify the queue that we wish to open,
// and the open options...
MQQueue system_default_local_queue = qMgr.accessQueue("SYSTEM.DEFAULT.LOCAL.QUEUE", openOptions);
// Define a simple MQSeries message, and write some text in UTF format..
MQMessage hello_world = new MQMessage();
hello_world.writeUTF("Hello World!");
// specify the message options...
MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the // defaults,
// same as MQPMO_DEFAULT
// put the message on the queue
system_default_local_queue.put(hello_world,pmo);
// get the message back again...
// First define a MQSeries message buffer to receive the message into..
MQMessage retrievedMessage = new MQMessage();
retrievedMessage.messageId = hello_world.messageId;
// Set the get message options...
MQGetMessageOptions gmo = new MQGetMessageOptions(); // accept the defaults
// same as MQGMO_DEFAULT
// get the message off the queue...
system_default_local_queue.get(retrievedMessage, gmo);
// And prove we have the message by displaying the UTF message text
String msgText = retrievedMessage.readUTF();
System.out.println("The message is: " + msgText);
// Close the queue...
system_default_local_queue.close();
// Disconnect from the queue manager
qMgr.disconnect();
}
// If an error has occurred in the above, try to identify what went wrong
// Was it an MQSeries error?
catch (MQException ex)
{
System.out.println("An MQSeries error occurred : Completion code " + ex.completionCode + " Reason code " + ex.reasonCode);
}
// Was it a Java buffer space error?
catch (java.io.IOException ex)
{
System.out.println("An error occurred whilst writing to the message buffer: " + ex);
}
}
}
-------------console:-----------------
Go Queue!
java.lang.NoClassDefFoundError: com/mine/mq/iiop/MQSESSION
at com.mine.mq.MQQueueManager.<init>(MQQueueManager.java:241)
at ejemplo.MQSample.<init>(MQSample.java:28)
at ejemplo.MQSample.main(MQSample.java:20)
Exception in thread "main"
-----PD---------
Estoy usando WSAD 5.0 y WebsphereMQ (MQSeries) en mi mismo equipo.. con profile de instalacion default...
-----code---------
package ejemplo;
import com.mine.mq.*;
/**
* @author JG
*
*/
public class MQSample {
private String qManager = "your_Q_manager"; // define name of queue
// manager to connect to.
private MQQueueManager qMgr; // define a queue manager
// object
public static void main(String args[]) {
System.out.println("Go Queue!");
new MQSample();
}
public MQSample() {
try {
// Create a connection to the queue manager
qMgr = new MQQueueManager(qManager);
// Set up the options on the queue we wish to open...
// Note. All MQSeries Options are prefixed with MQC in Java.
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;
// Now specify the queue that we wish to open,
// and the open options...
MQQueue system_default_local_queue = qMgr.accessQueue("SYSTEM.DEFAULT.LOCAL.QUEUE", openOptions);
// Define a simple MQSeries message, and write some text in UTF format..
MQMessage hello_world = new MQMessage();
hello_world.writeUTF("Hello World!");
// specify the message options...
MQPutMessageOptions pmo = new MQPutMessageOptions(); // accept the // defaults,
// same as MQPMO_DEFAULT
// put the message on the queue
system_default_local_queue.put(hello_world,pmo);
// get the message back again...
// First define a MQSeries message buffer to receive the message into..
MQMessage retrievedMessage = new MQMessage();
retrievedMessage.messageId = hello_world.messageId;
// Set the get message options...
MQGetMessageOptions gmo = new MQGetMessageOptions(); // accept the defaults
// same as MQGMO_DEFAULT
// get the message off the queue...
system_default_local_queue.get(retrievedMessage, gmo);
// And prove we have the message by displaying the UTF message text
String msgText = retrievedMessage.readUTF();
System.out.println("The message is: " + msgText);
// Close the queue...
system_default_local_queue.close();
// Disconnect from the queue manager
qMgr.disconnect();
}
// If an error has occurred in the above, try to identify what went wrong
// Was it an MQSeries error?
catch (MQException ex)
{
System.out.println("An MQSeries error occurred : Completion code " + ex.completionCode + " Reason code " + ex.reasonCode);
}
// Was it a Java buffer space error?
catch (java.io.IOException ex)
{
System.out.println("An error occurred whilst writing to the message buffer: " + ex);
}
}
}
-------------console:-----------------
Go Queue!
java.lang.NoClassDefFoundError: com/mine/mq/iiop/MQSESSION
at com.mine.mq.MQQueueManager.<init>(MQQueueManager.java:241)
at ejemplo.MQSample.<init>(MQSample.java:28)
at ejemplo.MQSample.main(MQSample.java:20)
Exception in thread "main"
-----PD---------
Estoy usando WSAD 5.0 y WebsphereMQ (MQSeries) en mi mismo equipo.. con profile de instalacion default...
