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 » Java plug-in nodes

Post new topic  Reply to topic Goto page 1, 2, 3  Next
 Java plug-in nodes « View previous topic :: View next topic » 
Author Message
pfaulkner
PostPosted: Tue Mar 26, 2002 2:29 pm    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

I am trying to test Java Plug-in nodes on an NT Broker using one of the samples (SwitchNode). I compiled the java node and created a jar file from the class, then I moved the jar file to the 'LIL' directory (installdir/jplugin) as indicated by the documentation. I also integrated my new plug-in to the Control Center and used it in a message flow. I checked in my message flow and Deployed the Execution Group to the Broker, all without any errors in the log.

When I stop and start the broker to allow it pick up the new plug-in I get this error:

---------------------------------------------------------------------------
( NTBROKER1.default ) Failure to locate Java class SwitchNode
The java class SwitchNode could not be found by the Java API framework.
This is an internal error. Contact your IBM support center.
---------------------------------------------------------------------------

One strange thing I notice in the error message was the name 'NTBROKER1.default', NTBROKER1 is the name of my NT Broker but my Execution Group where I use the new plug-in is not called 'default'.

Any help would be appreciated.

_________________
Paul Faulkner
Back to top
View user's profile Send private message AIM Address
kolban
PostPosted: Tue Mar 26, 2002 3:20 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Each and every node (whether used or not) is identified by each execution group when it starts so I am not too surprised that the default execution group was named. Probably useful if you post the code of the java source of the node and let us take a look at it ...
Back to top
View user's profile Send private message
pfaulkner
PostPosted: Tue Mar 26, 2002 3:33 pm    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Hello Grand Master Kolban

Okay, here is the code (but as I said it is just the sample code provided).

Also, I decided to remove my other Execution Group and everything I didn't need and just place my Message flow that uses this node into the default Execution Group.

When I deploy I get this error now and not the previous errors...

------------------------------------------------------------------------------
( NTBROKER1.default ) Execution group 'default' received an invalid configuration message. See the following messages for details of the error.

The message broker received an invalid configuration message and has not updated its configuration. This can arise as a result of errors in the specification of either message flows or message sets which the configuration manager was unable to detect. It can also result from a message flow requiring a type of node that is not supported by the broker installation, from the broker having become out of step with the configuration database or from other applications sending extraneous messages to the broker's configuration queues (SYSTEM.BROKER.ADMIN.QUEUE & SYSTEM.BROKER.EXECUTIONGROUP.QUEUE).

Check the relevant message flow and message set definitions, check that all necessary plug-ins are installed, perform a complete redeploy of the broker's configuration and ensure that no applications are writing to the broker's configuration queues.
------------------------------------------------------------------------------

Code
----
/*
* Licensed Materials - Property of IBM
* 5648-C63
* (C) Copyright IBM Corp. 1999, 2001
*/

package com.ibm.samples;

import com.ibm.broker.plugin.*;

/**
* Sample plugin node.
* This node propagates the incoming message to one of several output terminals
* depending on the content of the message.
* A minimal test message for this node would be:
* <data><action>change</action></data>
*/
public class SwitchNode extends MbNode implements MbNodeInterface
{
String _nodeTraceSetting;

/**
* Switch node constructor.
* This is where input and output terminal are created.
*/
public SwitchNode() throws MbException
{
createInputTerminal("in");
createOutputTerminal("add");
createOutputTerminal("change");
createOutputTerminal("delete");
createOutputTerminal("hold");
createOutputTerminal("failure");
}

/**
* This static method is called by the framework to identify this node.
* If this method is not supplied, a default name will be generated
* automatically based on the node's package/class name. In this case
* it would be 'ComIbmSamplesSwitchNode'.
*/
public static String getNodeName()
{
return "ComIbmSwitchNode";
}

/**
* This evaluate message is called by the broker for each message passing
* through the flow. The message assembly is passed in with the 'assembly'
* parameter. It is possible for a node to have more than one input
* terminal. The terminal that the message has come in on is represented
* by the 'in' parameter.
*/
public void evaluate(MbMessageAssembly assembly, MbInputTerminal in)
throws MbException
{
// Navigate to the relevant syntax element in the XML message
MbElement rootElement = assembly.getMessage().getRootElement();
MbElement switchElement = rootElement.getLastChild().getFirstChild().getFirstChild();

// To aid debugging, text can be printed to stdout/stderr.
// On NT this can be viewed by selecting 'Allow sevice to interact with
// desktop' on the NT Services properties dialog.
// On Unix set the environment variable MQSI_RUN_ATTACHED=1 before
// starting the broker.
if(_nodeTraceSetting.equals("debug"))
{
System.out.println("Element = " + switchElement.getName());
System.out.println("Value = " + switchElement.getValue());
}

// Select the terminal indicated by the value of this element
String terminalName;
String elementValue = (String)switchElement.getValue();
if(elementValue.equals("add"))
terminalName = "add";
else if(elementValue.equals("change"))
terminalName = "change";
else if(elementValue.equals("delete"))
terminalName = "delete";
else if(elementValue.equals("hold"))
terminalName = "hold";
else
terminalName = "failure";

MbOutputTerminal out = getOutputTerminal(terminalName);

// Now propagate the message assembly.
// If the terminal is not attached, an exception will be thrown. The user
// can choose to handle this exception, but it is not neccessary since
// the framework will catch it and propagate the message to the failure
// terminal, or if it not attached, rethrow the exception back upstream.
out.propagate(assembly);
}

/* Attributes are defined for a node by supplying get/set methods.
* The following two methods define an attribute 'nodeTraceSetting'.
* The capitalisation follows the usual JavaBean property convention.
*/
public String getNodeTraceSetting()
{
return _nodeTraceSetting;
}

public void setNodeTraceSetting(String nodeTraceSetting)
{
_nodeTraceSetting = nodeTraceSetting;
}

}


_________________
Paul Faulkner
Back to top
View user's profile Send private message AIM Address
amigupta1978
PostPosted: Tue Mar 26, 2002 3:34 pm    Post subject: Reply with quote

Centurion

Joined: 22 Jan 2002
Posts: 132
Location: India

hi,
how exactly u deployed ur java plugin node. Did u made the jar file and then deployed or directly deployed the class file. I faced the problem but was able to resolve it after creating the .jar file and copying it to the jplugin directory

amit
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
pfaulkner
PostPosted: Tue Mar 26, 2002 3:36 pm    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

I created a jar file and copied it the the jplugin dir.
Back to top
View user's profile Send private message AIM Address
kolban
PostPosted: Tue Mar 26, 2002 3:53 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

The node name returned by the static method getNodeName() must match the name of your new node as well as the class name as well as the name defined in the Control Center with the exception that the string returned has the text "Node" appended.

For example ... imagine we wanted to create a new node called "DoIt".

The class would be "DoIt"
The control center definitions would be "DoIt"
And the code would be

Code:

public static String getNodeName()
{
   return("DoItNode");
}


That is not what is in the sample code provided.
Back to top
View user's profile Send private message
pfaulkner
PostPosted: Tue Mar 26, 2002 4:38 pm    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Ok,

I renamed my plug-in class to be:

CustomSwitch

and changed the getNodeName to use CustomSwitchNode.

code
-----------------------------------------------------------------------
/*
* Licensed Materials - Property of IBM
* 5648-C63
* (C) Copyright IBM Corp. 1999, 2001
*/

package com.ibm.samples;

import com.ibm.broker.plugin.*;

/**
* Sample plugin node.
* This node propagates the incoming message to one of several output terminals
* depending on the content of the message.
* A minimal test message for this node would be:
* <data><action>change</action></data>
*/
public class CustomSwitch extends MbNode implements MbNodeInterface
{
String _nodeTraceSetting;

/**
* Switch node constructor.
* This is where input and output terminal are created.
*/
public CustomSwitch() throws MbException
{
createInputTerminal("in");
createOutputTerminal("add");
createOutputTerminal("change");
createOutputTerminal("delete");
createOutputTerminal("hold");
createOutputTerminal("failure");
}

/**
* This static method is called by the framework to identify this node.
* If this method is not supplied, a default name will be generated
* automatically based on the node's package/class name. In this case
* it would be 'ComIbmSamplesSwitchNode'.
*/
public static String getNodeName()
{
return "CustomSwitchNode";
}

/**
* This evaluate message is called by the broker for each message passing
* through the flow. The message assembly is passed in with the 'assembly'
* parameter. It is possible for a node to have more than one input
* terminal. The terminal that the message has come in on is represented
* by the 'in' parameter.
*/
public void evaluate(MbMessageAssembly assembly, MbInputTerminal in)
throws MbException
{
// Navigate to the relevant syntax element in the XML message
MbElement rootElement = assembly.getMessage().getRootElement();
MbElement switchElement = rootElement.getLastChild().getFirstChild().getFirstChild();

// To aid debugging, text can be printed to stdout/stderr.
// On NT this can be viewed by selecting 'Allow sevice to interact with
// desktop' on the NT Services properties dialog.
// On Unix set the environment variable MQSI_RUN_ATTACHED=1 before
// starting the broker.
if(_nodeTraceSetting.equals("debug"))
{
System.out.println("Element = " + switchElement.getName());
System.out.println("Value = " + switchElement.getValue());
}

// Select the terminal indicated by the value of this element
String terminalName;
String elementValue = (String)switchElement.getValue();
if(elementValue.equals("add"))
terminalName = "add";
else if(elementValue.equals("change"))
terminalName = "change";
else if(elementValue.equals("delete"))
terminalName = "delete";
else if(elementValue.equals("hold"))
terminalName = "hold";
else
terminalName = "failure";

MbOutputTerminal out = getOutputTerminal(terminalName);

// Now propagate the message assembly.
// If the terminal is not attached, an exception will be thrown. The user
// can choose to handle this exception, but it is not neccessary since
// the framework will catch it and propagate the message to the failure
// terminal, or if it not attached, rethrow the exception back upstream.
out.propagate(assembly);
}

/* Attributes are defined for a node by supplying get/set methods.
* The following two methods define an attribute 'nodeTraceSetting'.
* The capitalisation follows the usual JavaBean property convention.
*/
public String getNodeTraceSetting()
{
return _nodeTraceSetting;
}

public void setNodeTraceSetting(String nodeTraceSetting)
{
_nodeTraceSetting = nodeTraceSetting;
}

}
------------------------------------------------------------------------

I created a new Plug-in node within the Command Center and called it 'CustomSwitch', I also gave it a label and Internal Identifier of 'CustomSwitch'.

I checked in my plug-in node, then created a new Message Flow to use it.
Checked in the message flow and added it to the 'default' Execution Group of my Broker (NTBROKER1).

When I deploy the Broker I still get these errors:

---------------------------------------------------------------------------

( NTBROKER1.default ) Execution group 'default' received an invalid configuration message. See the following messages for details of the error.

The message broker received an invalid configuration message and has not updated its configuration. This can arise as a result of errors in the specification of either message flows or message sets which the configuration manager was unable to detect. It can also result from a message flow requiring a type of node that is not supported by the broker installation, from the broker having become out of step with the configuration database or from other applications sending extraneous messages to the broker's configuration queues (SYSTEM.BROKER.ADMIN.QUEUE & SYSTEM.BROKER.EXECUTIONGROUP.QUEUE).

Check the relevant message flow and message set definitions, check that all necessary plug-ins are installed, perform a complete redeploy of the broker's configuration and ensure that no applications are writing to the broker's configuration queues.

------------------------------------------------------------------------------

( NTBROKER1.default ) Configuration message requests creation of message flow node type 'CustomSwitchNode' in message flow 'TestCustomSwitch'; broker cannot create nodes of this type.

The message broker received a configuration message containing an instruction to create a message flow node of type 'CustomSwitchNode', in message flow 'TestCustomSwitch', but the broker does not have the capability to create nodes of this type.

Ensure that all necessary node implementation libraries have been installed. Then ensure that the message flow and any nested message flows have been checked in. Re-deploy the new configuration to the broker ensuring that the complete configuration option is used. If the problem persists contact your IBM support center.
Back to top
View user's profile Send private message AIM Address
kirani
PostPosted: Tue Mar 26, 2002 5:33 pm    Post subject: Reply with quote

Jedi Knight

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

It looks like you have not restarted the broker after making these changes. After you recompiled your source code, copy the binary file to appropriate directory and restart the broker.
You must restart the broker to load any changes in the plug-in.

Kiran

Back to top
View user's profile Send private message Visit poster's website
pfaulkner
PostPosted: Tue Mar 26, 2002 5:54 pm    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Already did that. I stopped and started the broker.

_________________
Paul Faulkner
Back to top
View user's profile Send private message AIM Address
kirani
PostPosted: Tue Mar 26, 2002 6:04 pm    Post subject: Reply with quote

Jedi Knight

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

Paul,
Could you try posting the contents of "CustomSwitch" and "CustomSwitch.wdp" file over here?
Back to top
View user's profile Send private message Visit poster's website
kolban
PostPosted: Tue Mar 26, 2002 8:45 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Just a guess, but try and remove the package statement from the code. Also, I am assuming the the JAR file contains the directories, not just the class files?
Back to top
View user's profile Send private message
Coz
PostPosted: Wed Mar 27, 2002 12:05 am    Post subject: Reply with quote

Apprentice

Joined: 20 Feb 2002
Posts: 44
Location: Basel CH

As you have the package statement the Node Identifier should be ComIbmSamplesCustomSwitch (as a bug still automatically puts the Node on) and this is what should be in the getNodeName() method.

Make sure the Node Label is CustomSwitchNode.

Following these conventions we have successfully deployed about 20 different java plugins.
Back to top
View user's profile Send private message
pfaulkner
PostPosted: Wed Mar 27, 2002 8:58 am    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

Kolban, what directories are you referring to? The documentation only mentions putting the class file in the JAR file.

I tried removing the package name or leavnig it in and adding it to the node name in the getNodeName and Identifer of the Node in the command center. Still getting same errors.

_________________
Paul Faulkner
Back to top
View user's profile Send private message AIM Address
kolban
PostPosted: Wed Mar 27, 2002 9:18 am    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Issue the command to list the contents of your JAR file and post the results here.
Back to top
View user's profile Send private message
pfaulkner
PostPosted: Wed Mar 27, 2002 9:50 am    Post subject: Reply with quote

Master

Joined: 18 Mar 2002
Posts: 241
Location: Colorado, USA

0 Tue Mar 26 21:21:36 MST 2002 META-INF/
71 Tue Mar 26 21:21:36 MST 2002 META-INF/MANIFEST.MF
2281 Tue Mar 26 21:21:26 MST 2002 CustomSwitch.class
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2, 3  Next Page 1 of 3

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Java plug-in nodes
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.