ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » java.lang.NoClassDefFoundError: com.ibm.mq.MQEnvironment

Post new topic  Reply to topic
 java.lang.NoClassDefFoundError: com.ibm.mq.MQEnvironment « View previous topic :: View next topic » 
Author Message
nebazrag
PostPosted: Thu Mar 21, 2002 12:04 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
abmanesh
PostPosted: Thu Mar 21, 2002 1:05 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
nebazrag
PostPosted: Thu Mar 21, 2002 7:23 pm    Post subject: Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » java.lang.NoClassDefFoundError: com.ibm.mq.MQEnvironment
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.