|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
java.lang.NoClassDefFoundError: com.ibm.mq.MQEnvironment |
« View previous topic :: View next topic » |
Author |
Message
|
nebazrag |
Posted: Thu Mar 21, 2002 12:04 pm Post subject: |
|
|
Newbie
Joined: 20 Mar 2002 Posts: 2
|
I am new to Java and MQseries. I am running VisualAge 4.0. I am trying to convert an existing Lotus Notes Agent to java. I have started out by simply attempting to get the MQseries part working and cannot get past this error:
Debugger Stack Trace Report:
Thread[Thread-0,5,main] (Alive)
Uncaught exception (java.lang.NoClassDefFoundError: com.ibm.mq.MQEnvironment)
ArRunDominoAgent(NotesThread).run()
this=(com.ibm.ivj.domino.ar.ArRunDominoAgent) Thread[Thread-0,5,main]
It happens on the line of code that attempts to set the MQEnvironment variable. Below is the agent. I have changed the actual values of the hostname and channel but that should be irrelavent. I am a newbie and would appreciate any suggestions or direction to some documentation. Thanks!
package triggermonitoragent;
import java.lang.*;
import java.io.PrintWriter;
import lotus.domino.*;
import com.ibm.mq.*;
/**
* Insert the type's description here.
* Creation date: (3/21/02 5:30:47 AM)
* @author: Ben Garza
*/
public class MQSeriesTest extends DebugAgentBase{
String hostname = "hostname.com"; // hostname to connect to
String channel = "svr.conn"; // name of channel for client to use
int iPort = 1414; // port, assumed to be 1414 unless specified
MQQueueManager qMgr;
String qManager = "HCTSRV1_D";
public void NotesMain() {
System.out.println("Now executing MQSeriesTest..");
System.out.println("NotesMain method starting");
try
{
// Notes initialization...
Session session = getSession();
AgentContext ac = session.getAgentContext();
Database db = ac.getCurrentDatabase();
Document doc = ac.getDocumentContext();
//System.out.println("Document in use,UID:"+ doc.getUniversalID());
PrintWriter pw = getAgentOutput();
// Extract required information from document...
//String partNumber = doc.getItemValueString("I_PARTNO");
//String quantity = doc.getItemValueString("I_QUANTITY");
// MQ initialization...
MQEnvironment.hostname = hostname;
MQEnvironment.port = iPort;
MQEnvironment.channel = channel;
System.out.println("About to try connecting to qmgr: " + qManager);
System.out.println("Usingchannel:"+channel);
System.out.println("andhostname:"+hostname);
// Create a connection to the queue manager...
qMgr = new MQQueueManager(qManager);
} //Try
catch (MQException mqex)
{
System.out.println("An MQ error occurred: Completion code " + mqex.completionCode + "Reason code "+mqex.reasonCode + "from:"+mqex.exceptionSource);
}
// Was it a Notes error?
catch (NotesException nex)
{
System.out.println("An Noteserror occurred:"+nex);
}
// Any other error...
catch (Exception e)
{
e.printStackTrace();
}
finally
{
}
} // end of NotesMain
} // end of Agent
|
|
Back to top |
|
 |
abmanesh |
Posted: Thu Mar 21, 2002 1:05 pm Post subject: |
|
|
Apprentice
Joined: 06 Nov 2001 Posts: 39
|
This one looks more like a Classpath problem.
Add the directory MQSeriesInstallDirectoryjavalib to the VisualAge for Java
workspace class path and see if it fixes the problem. |
|
Back to top |
|
 |
nebazrag |
Posted: Thu Mar 21, 2002 7:23 pm Post subject: |
|
|
Newbie
Joined: 20 Mar 2002 Posts: 2
|
Thanks abmanesh!! I had my Environment CLASSPATH variable set but wasn't aware that the VisualAge App also had it's own. I added the path to the JAVA lib and it worked like a champ! Chalk it up to lack of experience. Thanks again!
Ben
_________________ Round Rock, TX |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|