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 » WebSphere Message Broker (ACE) Support » jplugin code deploy error

Post new topic  Reply to topic
 jplugin code deploy error « View previous topic :: View next topic » 
Author Message
smaram1
PostPosted: Wed May 21, 2003 5:41 pm    Post subject: jplugin code deploy error Reply with quote

Novice

Joined: 06 May 2003
Posts: 19

Hi All,

I am trying to create a custom plugin code and i am facing problems. I have a class which converts flat file to xml and this works perfectly in a stand alone enviroment.

Now i am tryng to create a custom node. I have a

CUSTOMNODE extends MbNode implements MbNodeInterface

and all other logic for this.

It compiles and placed jar in jplugin directory and i also created plugin node in CONTROL CENTER and added to flow. When i try to deploy this, i am getting following error.

ERROR:
BIP4368S: The method 'getMethod' has thrown the following exception: java.lang.NullPointerException.

The Java API framework has caught an unhandled Java exception.

Contact the node provider for further details.

I dont see getMethod anywhere in my code.

Any help would be really appreciated.

Thanks
Suresh
Back to top
View user's profile Send private message
kirani
PostPosted: Thu May 22, 2003 3:50 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Suresh,
Could you post your plug-in code here (no need to post the code for Evaluate method or the code in the utility class)?
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
smaram1
PostPosted: Thu May 22, 2003 3:59 pm    Post subject: Reply with quote

Novice

Joined: 06 May 2003
Posts: 19

Thanks for the reply Kiran..

Okay..here is the code..

i am pasting all extra methods which i used for logging..but jus to be on safe side i am posting them too..


public class HuddNode extends MbNode implements MbNodeInterface {

/** Reference to the log file */
private File log;

/** Debug switch */
private boolean debug;

/** Contains the instance of the Singleton ParserPool */
//private ParserPool parserPool;

/** Holds the reference to the current parser */
private NodeParser nodeParser;

/** Holds the reference to the current byte array from the incomming message */
private byte bytes[];

/** Node name */
private static final String NODE_NAME = "DkMaerskDataHuddNode";

/** HuddNode constructor */
public HuddNode() throws MbException {
createInputTerminal("in"); //Create in inputterminal
createOutputTerminal("out"); //Create out outputterminal
createOutputTerminal("failure"); //Create failure outputterminal
}

/** MbNodeInterface evaluate method */
public void evaluate(MbMessageAssembly assembly, MbInputTerminal inputTerminal) throws MbException {

//THIS IS WHERE I AM USING THE UTILITY CLASS AND POSTING IT OUT AND FAILURE TERMINALS

}

/** Method used by the WMQI to tie reference to this object */
public static String getNodeName() {
return NODE_NAME;
}

/** Method called by WMQI from Log file is on */
public void setLogFile(String file){
log = new File(file);
}

/** Method called by WMQI */
public String getLogFile(){
return log.toString();
}

/** Method called by WMQI if tracing is on */
public void setDebugOn(String s) {
if(s != null && s.equalsIgnoreCase("on"))
debug = true;
else
debug = false;
}

/** Method called by WMQI */
public String getDebugOn() {
return "" + debug;
}

/** Old facion log method that works in 1.3.- */
public void log(String entry){
if(debug){ //Only write to log if debug is on
try{
if(log == null) //If the logfile isn't set create a temporary file
log = File.createTempFile(getClass().getName(),"log");

StringBuffer content = new StringBuffer(); //Instantiate buffer to hold old file content

BufferedReader in = new BufferedReader(new InputStreamReader(log.toURL().openStream())); //Open the stream from the the file

String line;

while((line = in.readLine()) != null){ //While the old message contains lines add them to the new content
content.append(line + '\n');
}

in.close(); //Close the reader

content.append(new java.util.Date().toString() + " | " + entry); //Append the new entry with a timestamp

FileWriter fw = new FileWriter(log); //Instantiate a file writer

fw.write(content.toString()); //Write the new content to the file

fw.close(); //Close the writer
}
catch(Exception x){
//Do nothing if it fails
}
}
}
}

Pls let me know if i need to post evaluate(0 method too..

Thanks
Back to top
View user's profile Send private message
kirani
PostPosted: Thu May 22, 2003 4:34 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Okay ... I have made some changes in the code and they are highlighted. Hopefully this will take you a step further. Also, I didn't see any attribute defined in your plug-in configuration files. Don't you need atleast one attribute to take input file name?

Quote:

public class HuddNode extends MbNode implements MbNodeInterface {

/** Reference to the log file */
private File log;

/** Debug switch */
private boolean debug;



/** Node name */
private static final String NODE_NAME = "HuddNodeNode";


/** HuddNode constructor */
public HuddNode() throws MbException {
createInputTerminal("in"); //Create in inputterminal
createOutputTerminal("out"); //Create out outputterminal
createOutputTerminal("failure"); //Create failure outputterminal
}

/** MbNodeInterface evaluate method */
public void evaluate(MbMessageAssembly assembly, MbInputTerminal inputTerminal) throws MbException {

//THIS IS WHERE I AM USING THE UTILITY CLASS AND POSTING IT OUT AND FAILURE TERMINALS

/** Contains the instance of the Singleton ParserPool */
//private ParserPool parserPool;

/** Holds the reference to the current parser */
NodeParser nodeParser;

/** Holds the reference to the current byte array from the incomming message */
byte bytes[];


}

/** Method used by the WMQI to tie reference to this object */
public static String getNodeName() {
return NODE_NAME;
}

/** Method called by WMQI from Log file is on */

public void setLog(String file){
log = new File(file);
}

/** Method called by WMQI */
public String getLog(){
return log.toString();
}

/** Method called by WMQI if tracing is on */

public void setDebug(String s) {
if(s != null && s.equalsIgnoreCase("on"))
debug = true;
else
debug = false;
}


/** Method called by WMQI */

public String getDebug() {
return "" + debug;
}


/** Old facion log method that works in 1.3.- */
public void log(String entry){
if(debug){ //Only write to log if debug is on
try{
if(log == null) //If the logfile isn't set create a temporary file
log = File.createTempFile(getClass().getName(),"log");

StringBuffer content = new StringBuffer(); //Instantiate buffer to hold old file content

BufferedReader in = new BufferedReader(new InputStreamReader(log.toURL().openStream())); //Open the stream from the the file

String line;

while((line = in.readLine()) != null){ //While the old message contains lines add them to the new content
content.append(line + '\n');
}

in.close(); //Close the reader

content.append(new java.util.Date().toString() + " | " + entry); //Append the new entry with a timestamp

FileWriter fw = new FileWriter(log); //Instantiate a file writer

fw.write(content.toString()); //Write the new content to the file

fw.close(); //Close the writer
}
catch(Exception x){
//Do nothing if it fails
}
}
}
}



hope this helps.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
smaram1
PostPosted: Thu May 22, 2003 5:36 pm    Post subject: Reply with quote

Novice

Joined: 06 May 2003
Posts: 19

Hi Kiran,

That did the trick. I will pin point the exact change needed out of those and will post here so that it might be useful for others in future.

Do you have any idea both the Debugger issue that posted on another topic.

Thanks for all the help
Suresh
Back to top
View user's profile Send private message
smaram1
PostPosted: Tue Sep 16, 2003 2:52 pm    Post subject: Reply with quote

Novice

Joined: 06 May 2003
Posts: 19

Looks like getLogFile() and getLog() is making a diff. Other changes also are needed.

If i use getLog() name, it is throwing NullPointerException. This might be due to an exisitng method in MQ API.

If i use getLogFile() signature, everything deploys perfectly.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » jplugin code deploy error
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.