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 » help me!

Post new topic  Reply to topic
 help me! « View previous topic :: View next topic » 
Author Message
dhb
PostPosted: Sun Dec 29, 2002 5:54 am    Post subject: help me! Reply with quote

Newbie

Joined: 28 Dec 2002
Posts: 2

Suse7.0(2.4.7)+MQSeries5.3Server for Linux(Intel)
I write a test program using the WSBCC framework.
when run it to the line "service.send(messageToSend);",a java core exception occur(IBM JDK(1.4)):
Antes de inicializar VTF
VTF inicializado
Before loop Free memory: 2183072 Total memory: 4454912
Outgoing operation : messsage to partner: OPERACIO : 1
Unexpected exception has occurred:
ReportedExceptionCode = b, at ExceptionAddress = 40222fbd
ACCESS_VIOLATION occured outside Interpreter and JITed code
ExecMode = EXECMODE_BYTECODE
Aborted
JVMDG217: Dump Handler is Processing a Signal - Please Wait.

I think that I should set the signal or semaphore where i installed the mqseries5.3 on the Suse7.0 for Intel.but I did not know whether I need to do this .and how to set these.


Thanks ,

the source code:
package mqtest;

import com.ibm.dse.base.*;
import com.ibm.dse.services.comms.*;
import com.ibm.mq.*;
import com.ibm.dse.services.mq.*;
/**
* This type was created in VisualAge.
*/
public class MQAsincrono extends DSEOperation implements Handler{
private Semaphore openedSem = new Semaphore();
private Semaphore dataSem = new Semaphore();
private int identifier;
private static int N_OPERACIONES = 3;
private static int WAIT_PERIOD = 0;
private static long RESPONSE_TIME = 0 ;
/**
* CCSendReceive constructor comment.
*/
public MQAsincrono() {
super();
}
/**
* CCSendReceive constructor comment.
* @param aName java.lang.String
* @exception java.io.IOException The exception description.
*/
public MQAsincrono(String aName) throws java.io.IOException {
super(aName);
}
/**
* CCSendReceive constructor comment.
* @param anOperationName java.lang.String
* @param aParentContext com.ibm.dse.base.Context
* @exception java.io.IOException The exception description.
* @exception com.ibm.dse.base.DSEInvalidRequestException The exception description.
*/
public MQAsincrono(String anOperationName, Context aParentContext) throws java.io.IOException, DSEInvalidRequestException {
super(anOperationName, aParentContext);
}
/**
* CCSendReceive constructor comment.
* @param anOperationName java.lang.String
* @param aParentContext java.lang.String
* @exception java.io.IOException The exception description.
* @exception com.ibm.dse.base.DSEObjectNotFoundException The exception description.
* @exception com.ibm.dse.base.DSEInvalidRequestException The exception description.
*/
public MQAsincrono(String anOperationName, String aParentContext) throws java.io.IOException, DSEObjectNotFoundException, DSEInvalidRequestException {
super(anOperationName, aParentContext);
}
/**
* @return com.ibm.dse.base.Handler
* @param anEvent com.ibm.dse.base.DSEEventObject
*/
public Handler dispatchEvent(DSEEventObject anEvent){
if (anEvent.getName().equals(((CommonCommunicationsService)anEvent.getSource()).getCcDataReceivedEventName())) {
try {
String message = ((MQMessage)(anEvent.getParameters()).get(MQConnection.DATA)).readLine();
System.out.println (" Messsage received: "+message);
if (message.indexOf(new Integer(identifier).toString()) != -1) {
dataSem.signalOn();
return null;
} else
return this;
} catch (Exception e) {
e.printStackTrace();
return null;
}

}
return this;
}
/**
*/
public void execute() throws Exception {
dataSem.clearSignal();
CCMessage retrievedMessage;
com.ibm.dse.services.mq.MQConnectionService service = (com.ibm.dse.services.mq.MQConnectionService) this.getContext().getService("connection");
service.addHandler(this,"allEvents");

String messageToSend = ((FormatElement) this.getHostSendFormat()).format(this.getContext());
service.establishConnection();

System.out.println ("Outgoing operation : messsage to partner: "+getValueAt("hostDataSend"));
//--------------error occur---------------------------
service.send(messageToSend);
dataSem.waitOn(20000);
if (dataSem.hasTimedOut())
System.out.println ("Timeout produced");

service.removeHandler(this,"allEvents");
}
/**
* @param anEventName java.lang.String
* @param aNotifierName java.lang.String
* @param aContext com.ibm.dse.base.Context
* @exception com.ibm.dse.base.DSEInvalidArgumentException.
*/
public void handleEvent(String anEventName, String aNotifierName, Context aContext) throws DSEInvalidArgumentException{
EventManager.addHandler(this, anEventName, aNotifierName, aContext);
}
/**
* @param anEventName java.lang.String
* @param aNotifierName java.lang.String
* @param aContext com.ibm.dse.base.Context
* @param aTID java.lang.String
* @exception com.ibm.dse.base.DSEInvalidArgumentException.
*/
public void handleEvent(String anEventName, String aNotifierName, Context aContext, String aTID) throws DSEInvalidArgumentException{
return;
}
/**
* This method was created in VisualAge.
* @param args java.lang.String[]
*/
public static void main(String args[]) {

try {

System.out.println("Antes de inicializar VTF");
Settings.reset( args[0]);
Settings.initializeExternalizers("memory");
System.out.println("VTF inicializado");
N_OPERACIONES = (new Integer(args[1])).intValue() ;
int count = 0;
long response_time = 0;
System.out.println (" Before loop Free memory: "+Runtime.getRuntime().freeMemory()+" Total memory: "+Runtime.getRuntime().totalMemory() );
do {
response_time = System.currentTimeMillis();
count ++ ;
MQAsincrono sendReceiveOperation =
(MQAsincrono) com.ibm.dse.base.DSEOperation.readObject("mqAsincronoOperation") ;
sendReceiveOperation.identifier = count;
sendReceiveOperation.setValueAt("hostDataSend","OPERACIO : "+ count);
sendReceiveOperation.execute();
RESPONSE_TIME = (System.currentTimeMillis() - response_time ) + RESPONSE_TIME ;
sendReceiveOperation.close();
System.out.println (" OPERATION " +count+ " COMPLETE Response_time : "+ (RESPONSE_TIME/count));
} while (N_OPERACIONES >count );
System.gc();
System.out.println (" After loop Free memory: "+Runtime.getRuntime().freeMemory()+" Total memory: "+Runtime.getRuntime().totalMemory() );
System.exit(0);
}catch(Exception e){

System.out.println("CCSendReceive -> Excepcion:"+e.toString());
e.printStackTrace();
System.exit(0);
}


}
/**
* @param anEventName java.lang.String
* @param aNotifierName java.lang.String
* @param aContext com.ibm.dse.base.Context
* @exception com.ibm.dse.base.DSEInvalidArgumentException.
* @exception com.ibm.dse.base.DSEHandlerNotFoundException.
*/
public void stopHandlingEvent(String anEventName, String aNotifierName, Context aContext) throws DSEInvalidArgumentException, DSEHandlerNotFoundException{
EventManager.removeHandler(this, anEventName, aNotifierName, aContext);
}
/**
* @param anEventName java.lang.String
* @param aNotifierName java.lang.String
* @param aContext com.ibm.dse.base.Context
* @param aTID java.lang.String
* @exception com.ibm.dse.base.DSEInvalidArgumentException.
* @exception com.ibm.dse.base.DSEHandlerNotFoundException.
*/
public void stopHandlingEvent(String anEventName, String aNotifierName, Context aContext, String aTID) throws DSEInvalidArgumentException, DSEHandlerNotFoundException{
return;
}
}
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » help me!
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.