|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Defining properties on user defined java plugin node |
« View previous topic :: View next topic » |
Author |
Message
|
wolstek |
Posted: Fri Dec 17, 2004 9:42 am Post subject: Defining properties on user defined java plugin node |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 52 Location: Bristol, UK
|
I have tried to customise the Switch java plugin sample by giving it a new name and adding some properties and renaming the trace properties
On the basis that the user guide says to add the two methods
Code: |
private String attributeVariable;
public String getFirstAttribute()
{
return attributeVariable;
}
public void setFirstAttribute(String value)
{
attributeVariable = value;
}
|
which defines a variable firstAttribute, I have created a series of properties, leading lower case in msgnode file upper case in java source
I get the following error on deploy but cannot work out where the fault lies, in the node definition or the java source
Any ideas ??
Code: |
BIP2210e: Invalid configuration message: attribute name 'className' not valid for target object 'RunSampleCallEJB.'.
The message broker received a configuration message containing the attribute name 'className' which is not valid for the target object 'RunSampleCallEJB.'. This can be caused by a mismatch in levels between the Message Brokers Toolkit, the Configuration Manager and the Broker, or as a result of a user or third party written plug-in node where the implementation library installed at the broker does not match the node definition held at the Configuration manager and Message Brokers Toolkit.
Ensure that the levels of code installed at the Message Brokers Toolkit, Configuration Manager and Broker are all consistent. If they are, identify the supplier of the target object and report the problem to them. If this is IBM, contact your IBM support center.
|
contents of msgnode file
Code: |
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="ecore.xmi" xmlns:eflow="eflow.xmi" xmlns:utility="eflow_utility.xmi" xmi:id="EPackage_1" nsURI="CallEJB.msgnode" nsName="CallEJB.msgnode">
<eMetaObjects xmi:type="eflow:FCMComposite" xmi:id="FCMComposite_1">
<translation xmi:type="utility:TranslatableString" xmi:id="TranslatableString_1" key="CallEJB" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<colorGraphic16 xmi:type="utility:GIFFileGraphic" xmi:id="GIFFileGraphic_1" resourceName="platform:/plugin/com.ibm.jplugin.callejb/icons/full/obj16/CallEJB.gif"/>
<colorGraphic32 xmi:type="utility:GIFFileGraphic" xmi:id="GIFFileGraphic_2" resourceName="platform:/plugin/com.ibm.jplugin.callejb/icons/full/obj30/CallEJB.gif"/>
<eSuper xmi:type="ecore:EClass" href="eflow.xmi#FCMBlock"/>
<eAttributes xmi:id="Property.className" name="className">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_1" lower="0" upper="1"/>
</eAttributes>
<eAttributes xmi:id="Property.hostName" name="hostName" eDefaultValue="localhost">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_2" lower="0" upper="1"/>
</eAttributes>
<eAttributes xmi:id="Property.port" name="port" eDefaultValue="2809">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_3" lower="0" upper="1"/>
</eAttributes>
<eAttributes xmi:id="Property.eJBName" name="eJBName">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_4" lower="0" upper="1"/>
</eAttributes>
<eAttributes xmi:id="Property.eJBMethod" name="eJBMethod">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_5" lower="0" upper="1"/>
</eAttributes>
<eAttributes xmi:id="Property.eJBParameters" name="eJBParameters">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_6" lower="0" upper="1"/>
</eAttributes>
<eAttributes xmi:id="Property.eJBResults" name="eJBResults">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_7" lower="0" upper="1"/>
</eAttributes>
<eAttributes xmi:id="Property.traceLevel" name="traceLevel" eDefaultValue="0">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_8" lower="0" upper="1"/>
</eAttributes>
<eAttributes xmi:id="Property.traceOutFile" name="traceOutFile" eDefaultValue="callejb.trace.output.txt">
<eTypeClassifier xmi:type="ecore:EDataType" href="ecore.xmi#EString"/>
<eMultiplicity xmi:id="EMultiplicity_9" lower="0" upper="1"/>
</eAttributes>
<composition xmi:id="Composition_1">
<nodes xmi:type="eflow:FCMSource" xmi:id="InTerminal.in" location="100,20">
<translation xmi:type="utility:TranslatableString" xmi:id="TranslatableString_2" key="InTerminal.in" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
</nodes>
<nodes xmi:type="eflow:FCMSink" xmi:id="OutTerminal.failure" location="200,40">
<translation xmi:type="utility:TranslatableString" xmi:id="TranslatableString_3" key="OutTerminal.failure" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
</nodes>
<nodes xmi:type="eflow:FCMSink" xmi:id="OutTerminal.continue" location="300,60">
<translation xmi:type="utility:TranslatableString" xmi:id="TranslatableString_4" key="OutTerminal.continue" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
</nodes>
</composition>
<propertyOrganizer xmi:id="PropertyOrganizer_1">
<propertyDescriptor xmi:id="PropertyDescriptor_1" groupName="Group.Basic" describedAttribute="Property.className">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_5" key="Property.className" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<propertyDescriptor xmi:id="PropertyDescriptor_2" groupName="Group.Basic" describedAttribute="Property.hostName">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_6" key="Property.hostName" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<propertyDescriptor xmi:id="PropertyDescriptor_3" groupName="Group.Basic" describedAttribute="Property.port">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_7" key="Property.port" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<propertyDescriptor xmi:id="PropertyDescriptor_4" groupName="Group.EJB" describedAttribute="Property.eJBName">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_8" key="Property.eJBName" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<propertyDescriptor xmi:id="PropertyDescriptor_5" groupName="Group.EJB" describedAttribute="Property.eJBMethod">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_9" key="Property.eJBMethod" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<propertyDescriptor xmi:id="PropertyDescriptor_6" groupName="Group.EJB" describedAttribute="Property.eJBParameters">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_10" key="Property.eJBParameters" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<propertyDescriptor xmi:id="PropertyDescriptor_7" groupName="Group.EJB" describedAttribute="Property.eJBResults">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_11" key="Property.eJBResults" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<propertyDescriptor xmi:id="PropertyDescriptor_8" groupName="Group.Trace" describedAttribute="Property.traceLevel">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_12" key="Property.traceLevel" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
<propertyDescriptor xmi:id="PropertyDescriptor_9" groupName="Group.Trace" describedAttribute="Property.traceOutFile">
<propertyName xmi:type="utility:TranslatableString" xmi:id="TranslatableString_13" key="Property.traceOutFile" bundleName="CallEJB" pluginId="com.ibm.jplugin.callejb"/>
</propertyDescriptor>
</propertyDescriptor>
</propertyDescriptor>
</propertyDescriptor>
</propertyDescriptor>
</propertyDescriptor>
</propertyDescriptor>
</propertyDescriptor>
</propertyDescriptor>
</propertyOrganizer>
</eMetaObjects>
</ecore:EPackage>
|
extract of java source
Code: |
imports....
public class CallEJBNode extends MbNode implements MbNodeInterface
{
String _nodeTraceLevel = "";
String _nodeTraceFile = "";
String _nodeClassName = "";
String _nodeHostName = "";
String _nodePort = "";
String _nodeEJBName = "";
String _nodeEJBMethod = "";
String _nodeEJBParameters = "";
String _nodeEJBResults = "";
PrintWriter traceWriter = null;
.......
........
/* Attributes are defined for a node by supplying get/set methods.
* The capitalisation follows the usual JavaBean property convention.
*/
/* Trace Attributes
* TraceLevel, TraceOutFile
*/
public String getTraceLevel()
{
return _nodeTraceLevel;
}
public void setTraceLevel(String propertyTraceLevel)
{
_nodeTraceLevel = propertyTraceLevel;
if(traceWriter != null) {
traceWriter.println("Attribute TraceLevel set to: " + _nodeTraceLevel);
}
}
public String getTraceFile()
{
return _nodeTraceFile;
}
public void setTraceFile(String valueTraceFile)
{
_nodeTraceFile = valueTraceFile;
if(traceWriter != null) {
traceWriter.close();
traceWriter =null;
}
try {
traceWriter = new PrintWriter(new FileWriter(valueTraceFile));
if(_nodeTraceLevel.equals("debug") && traceWriter != null) {
traceWriter.println("Attribute TraceFile set to: " + _nodeTraceFile);
traceWriter.flush();
}
}
catch(IOException e) {
System.out.println("Trace File could not be set: " + e);
}
}
/* Basic Attributes
* ClassName, HostName, Port
*/
public String getClassName()
{
return _nodeClassName;
}
public void setClassName(String valueClassName)
{
_nodeClassName = valueClassName;
if(traceWriter != null) {
traceWriter.println("Attribute ClassName set to: " + _nodeClassName);
}
}
public String getHostName()
{
return _nodeHostName;
}
public void setHostName(String valueHostName)
{
_nodeClassName = valueHostName;
if(traceWriter != null) {
traceWriter.println("Attribute HostName set to: " + _nodeHostName);
}
}
public String getPort()
{
return _nodePort;
}
public void setPort(String valuePort)
{
_nodeClassName = valuePort;
if(traceWriter != null) {
traceWriter.println("Attribute Port set to: " + _nodePort);
}
}
...........
...........
etc
}
|
Many thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Dec 17, 2004 10:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Try using ejbClassName instead of className for your parameter. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wolstek |
Posted: Mon Dec 20, 2004 8:39 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 52 Location: Bristol, UK
|
Thanks for the suggestion. On what basis did you make the suggestion, it appears to be a simple change of characters?
I did make the change and then for check changed it to nodeClassName and made progress, however it just came up with the same error on a different attribute. I removed attributes until it worked (leaving renamed attributes nodeHostName, nodeClassName, nodePort, nodeTraceLevel and nodeTraceFile)
I then added one more attribute (nodeAnotherName) and this was rejected and I cannot see why?
No matter what I do to the names of the offending attribute, it does want to accept it.
in nodename.properties
I suppose I am just very unclear on what WBIMB is actually expecting in terms on names in *msgnode, *.properties, names in java, including must do must not do or whether there is something else that I have totally missed, these messages being a bit if red herring maybe. It does not seem intuitive or logical.
Each time I change the node I update the classpath for the project in toolkit, export to zip, unzip to root\eclipse\plugins, stop toolkit, configmgr, borker and restart, am I missing something
Are there any other examples, other than Switch/Transform using additional / renamed parameters that might help me to understand
Details
Code: |
Property.nodeAnotherName=nodeAnotherName
|
java
Code: |
public String getNodeAnotherName()
{
return _nodeAnotherName;
}
public void setNodeAnotherName(String valueAnotherName)
{
_nodeAnotherName = valueAnotherName;
if(traceWriter != null) {
traceWriter.println("Attribute AnotherName set to: " + _nodeAnotherName);
}
}
|
giving error
Code: |
Invalid configuration message: attribute name 'nodeAnotherName' not valid for target object 'RunSampleCallEJB.CallEJB'.
|
Given that this is virtually identical to the definition for nodeClassName!
Code: |
Property.nodeClassName=Class Name
public String getNodeClassName()
{
return _nodeClassName;
}
public void setNodeClassName(String valueClassName)
{
_nodeClassName = valueClassName;
if(traceWriter != null) {
traceWriter.println("Attribute ClassName set to: " + _nodeClassName);
}
}
|
Many thanks |
|
Back to top |
|
 |
wolstek |
Posted: Tue Dec 21, 2004 8:43 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 52 Location: Bristol, UK
|
For the recordI think I have solved this.
There was an older .jar file in the wbimb_root\bin directory which when removed allowed the plugin to start working more consistently.
Though I don't understand why this was being used as it was not in my %CLASSPATH%, unless WBIMB puts it there ?? |
|
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
|
|
|
|