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 IndexWebSphere Message Broker SupportUser Defined (Java)

Post new topicReply to topic
User Defined (Java) View previous topic :: View next topic
Author Message
lonesheep
PostPosted: Mon Oct 09, 2017 7:15 am Post subject: User Defined (Java) Reply with quote

Novice

Joined: 12 Sep 2017
Posts: 13

Hi,

Is there a end to end tutorial anyway on creating user defined Java nodes in IIB 10?

I see there appears to be a wizard which generates a class which defines the input/output connections etc which extends Node....however I cannot find any information on how to implement this generated class or what to do with it.

Many thanks
Back to top
View user's profile Send private message
lonesheep
PostPosted: Wed Oct 11, 2017 11:03 am Post subject: Reply with quote

Novice

Joined: 12 Sep 2017
Posts: 13

really nothing!

I've progressed with that I could find online using the looping IBM help pages (I found some information under WebSphere 8 - so quite old).

Currently I've managed to create a user defined broker node, as long as it has no parameters. As soon as I add a parameter (i.e. a string called "Path") and amend the implementation class to include a getPath and setPath, I get the following error when trying to deploy the message flow;

The integration node received a configuration message containing the attribute name 'Path' which is not valid for the target object

I'm at a loss and can't get this to work.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Oct 11, 2017 12:19 pm Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

https://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/as04490_.htm
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
lonesheep
PostPosted: Wed Oct 11, 2017 1:34 pm Post subject: Reply with quote

Novice

Joined: 12 Sep 2017
Posts: 13

Not being funny, but I have read all this (and gone around the looping within the IBM help site). I've written a plugin on IIB 9without issue....just not in IIB 10.

Having worked 20+ years with Microsoft Technologies, I'm surprised there is no "download this example"....which I'd normally be presented with. To be honest I'm surprised all this IBM stack is shrouded in mystery...but I suppose it is not in IBM's interest to publish a lot of information on it as the most of there income comes from consultancy. If only the company I worked for gave training!.......still maybe this is a opportunity to leave!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Thu Oct 12, 2017 4:07 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

Well. I wasn't trying to be funny either.

The error you are getting says that the node you have deployed doesn't have the properties you have defined.

That's usually a mismatch between the node functions (the get/set) in the node proejct and the ui node project.

So, there are two projects. one for UI and one for runtime.

It's been a while since I've written a user defined node (IIB v7 maybe?). I thought the UI project had some kind of fancy editor thingy for the node properties...

Generally, there are samples/templates/whatever for IIB topics. I don't know where they are in v10.0, and I don't know if they include a user-defined node, but there used to be a user-defined node template thingy.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Oct 12, 2017 4:57 am Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24648
Location: Ohio, USA

mqjeff wrote:
Generally, there are samples/templates/whatever for IIB topics. I don't know where they are in v10.0, and I don't know if they include a user-defined node, but there used to be a user-defined node template thingy.


IIRC, one of the ways the IIBv10 Developer Edition install was made smaller was by not packaging the samples / templates with the software but putting them up on GitHub.

I'd look, but the lease on my old laptop expired and they've "refreshed" me.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lonesheep
PostPosted: Thu Oct 12, 2017 6:35 am Post subject: Reply with quote

Novice

Joined: 12 Sep 2017
Posts: 13

I'm using the IIB 10.0.0.8 developer edition.

I've stripped everything down to absolute basics.

Created a UDN project and generated a UDN in there with one property under "Basic" called "AttName".

Create an Java project to implement this UDN.


public class testNode extends MbNode implements MbNodeInterface {

private String tracingLevel = "";

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

<an... public void evaluate(MbMessageAssembly assembly, MbInputTerminal..{} >

public String getAttName() {
return tracingLevel;
}

public void setAttName(String value) {
this.tracingLevel = value;
}

}


Stopped the broker.
Compiled the implementation code and copied it to my LIL folders
Started the broker
Selected "Run in new Workbench" for the UDN project.

The UDN is listed in the menu. I can drag it out and use it in a flow.

If I make no changes to the UDN node properties all works OK when I deploy. However, should I amend a property on the node and deploy I get the error...


BIP2210E: Invalid configuration message: attribute name 'AttName' not valid for target object 'gen.operation1_Request_Response.Test Node'.
Back to top
View user's profile Send private message
lonesheep
PostPosted: Thu Oct 12, 2017 12:00 pm Post subject: None working sample Reply with quote

Novice

Joined: 12 Sep 2017
Posts: 13

I've created a workspace with what I have created to demonstrate the issue I'm having. I hope I'm just missing something out.

The workspace can be retrieved from here (its for IIB 10).

http://www.darkangel.me/workspace_udn.zip

Two projects;
Sample - The UDN project
SampleNodeImpl - The implementation

I export the SampleNodeImpl as a JAr and copy this to an LIL folder "c:\brokerplugins" I created using;

mqsichangebroker TESTNODE -l C:\brokerplugins

I then test the flow by going to the Sample UDN project and selecting "Run in new workbench"

I create a new Integration service and add the UDN node from the toolbox into the flow. Amend the value of "FirstAttribute" in the "Sample" and attempt to deploy the to the broker....

ERROR
BIP2210E: Invalid configuration message: attribute name 'FirstAttribute' not valid for target object 'gen.operation1_Request_Response.Sample'.

I'm at a loss....any help greatly appreciated.
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Oct 12, 2017 12:11 pm Post subject: Re: None working sample Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 24648
Location: Ohio, USA

lonesheep wrote:
I'm at a loss....any help greatly appreciated.


On that basis I'll show my lack of Java knowledge and offer this:

lonesheep wrote:
I export the SampleNodeImpl as a JAr and copy this to an LIL folder "c:\brokerplugins" I created using;


To me, an .lil file is what you get from a C-based node. I'd be surprised if that's the correct folder for a JAR file.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lonesheep
PostPosted: Thu Oct 12, 2017 1:23 pm Post subject: Reply with quote

Novice

Joined: 12 Sep 2017
Posts: 13

A jar file seems to ben invoked from the LIL path, I placed some code to write to a file in the constructor and this is invoked as the file is created.

The broker also grabs a lock on the file...so I'm happy the jar is loaded from the LIL path.

TO be on the safe side, I also copied the java implementation Jar to the java library path at C:\Program Files\IBM\IIB\10.0.0.9\server\jplugin. The issue is still present.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri Oct 13, 2017 4:22 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

I'm going to take a wild stab here and guess that you are having classloader problems.

The knowledge center recommends that you create a new LIL directory, and put stuff there. It also gives instructions on making sure that the classpath knows about that directory.

Stuff loaded by the system classloader (which lods things from the default lil file) probably aren't available in the places you're trying to use them from.

there's a KC page somewhere that shows the classloader hierarchy.

I've not posted links because I forget where they are.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
lonesheep
PostPosted: Fri Oct 13, 2017 11:28 am Post subject: Reply with quote

Novice

Joined: 12 Sep 2017
Posts: 13

I copied the jar file over to the broker shared-classes folder in;

C:\ProgramData\IBM\MQSI\config\TESTNODE\shared-classes

Still get the same issue. I have absolutely no idea why and the BIP error returned is a generic one! Even installed the latest service pack in the hope that would fix it!
Back to top
View user's profile Send private message
mqjeff
PostPosted: Sun Oct 15, 2017 12:45 pm Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17448

... shared classes isn't the right place either... The link was specific about creating a new folder and adding that to the lil path.

I know the last time I tried to do stuff with user defined nodes, I had to take this step or things just wouldn't work.

shared classes is for java compute node class dependencies.

I'm sure someone around has done stuff with user defined nodes in v10, but I'd suggest two things.

One, open a PMR.

Two, look at the connector api. I don't know if that's only for talking over transports not provided, but it might not be.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
lonesheep
PostPosted: Thu Dec 07, 2017 11:17 am Post subject: Reply with quote

Novice

Joined: 12 Sep 2017
Posts: 13

I finally figured out the issue.

In the broker message UI toolkit I had to give the property names all lower case names, otherwise the toolkit wouldn't marry up the property names to the Java properties.

ie.

In the UI the property

"path"
needs to map to the Java
getpath

If the "path", was "Path" it never works. Funny as this was not the case in IIB9.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportUser Defined (Java)
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.