Highlighted
Outstanding Contributor.
Outstanding Contributor.
906 views

ViewMemberListener not responding outside of IDE

Jump to solution

I apologize if this is more of a Java question than a StarTeam question, but perhaps someone can help me.

I have finally finished my MPX event subscription tool that allows me to be alerted on the echckin activity of a number of views.

That is, it works well in the IDE (I use netbeans).

When I first attemted to launch it via java -jar  the enableMPX would raise a connection exception, which I resolved but putting the call in a retry loop. It takes a few seconds before the connection is established.

Now I notice that my ViewMemberListener code is simply not executed outside the IDE.  To further complicate it I cannot even attach the process to my IDE.

Could this be related to the same cause that troubled my MPX connection?

I stress again that within the IDE, the listener code executes without fail.

Anyone have any ideas?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: ViewMemberListener not responding outside of IDE

Jump to solution
Hi Patrick,

>>the enableMPX would raise a connection exception, which I resolved but putting the call in a retry loop. It takes a few seconds before the connection is established.
This seems very wrong, though I cannot tell you why it works in your IDE in debug , but not standalone.
I d onot think that it is actually connecting after a few seconds either.
I guess it is possible that you are missing the dependency .jar's?

if you are using an activemq message broker, you need 5 jars
active-mq-client-5.11.1, geronimo-j2ee-management-1.1-spec-1.0.0, geronimo-jms_1.1_spec-1.1.1, hawtbuf_1.10 & sl4j-api-1.75.

if you are using the smartsockets message broker, you need ss.jar

>>the listener code executes without fail.
you may already be doing this, but i always recommend that event objects should be thrown
into a queue, and then processed on a separate thread.
any attempt to process them on the event message thread will cause the thread to block.
this is because the event message thread sits in a loop, waiting for events to come in from the message broker.

take care
anil

View solution in original post

0 Likes
6 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: ViewMemberListener not responding outside of IDE

Jump to solution
Hi Patrick,

>>the enableMPX would raise a connection exception, which I resolved but putting the call in a retry loop. It takes a few seconds before the connection is established.
This seems very wrong, though I cannot tell you why it works in your IDE in debug , but not standalone.
I d onot think that it is actually connecting after a few seconds either.
I guess it is possible that you are missing the dependency .jar's?

if you are using an activemq message broker, you need 5 jars
active-mq-client-5.11.1, geronimo-j2ee-management-1.1-spec-1.0.0, geronimo-jms_1.1_spec-1.1.1, hawtbuf_1.10 & sl4j-api-1.75.

if you are using the smartsockets message broker, you need ss.jar

>>the listener code executes without fail.
you may already be doing this, but i always recommend that event objects should be thrown
into a queue, and then processed on a separate thread.
any attempt to process them on the event message thread will cause the thread to block.
this is because the event message thread sits in a loop, waiting for events to come in from the message broker.

take care
anil

View solution in original post

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: ViewMemberListener not responding outside of IDE

Jump to solution
I can give that a try but I have my doubts, because queuing the events would be done by the listener, and as I said, I don't seem to enter the code at all (there's a console output on entrance, and I only see it when I'm in the IDE).

As far as the original connection I have the code in a try catch block, as I output to console in the catch (MPXException ).
In the IDE, I get no output from the catch. Outside I get three. In each catch I have a thread.sleep(1000) and I see 2 out puts. So there definitely is a difference there.

I'll let ou know how the queuing goes in about 12 hours 🙂
Thanks,
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: ViewMemberListener not responding outside of IDE

Jump to solution
Ok you're right Anil, MPX is actually NOT enabled when out of the IDE. It's very strange. I'll try those activeMQ jar's.
I thought we were using smart sockets but I guess our V16 upgrade changed that. In the server configuration, under Event Handler, it is set at "ActiveMQ MPX Transmitter", so I guess that's that.

I still find it bizarre that I connect to MPX in the IDE though.
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: ViewMemberListener not responding outside of IDE

Jump to solution
VICTORY!
I had tried to include the libraries you mentioned and it still would not work. then I realized I had missed one: geronimo-jms_1.1_spec-1.1.1, and that did the trick.
I had a strange warning:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See www.slf4j.org/codes.html for further details.

But the app would run anyway.

The message goes away if I add sl4j-nop1.7.25.jar - it does not seem to cause any other issue.

I'll mark your last answer as the answer.
Thanks for the help.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: ViewMemberListener not responding outside of IDE

Jump to solution
Hi Patrick,

I think this explains your error message - www.slf4j.org/codes.html

James
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

RE: ViewMemberListener not responding outside of IDE

Jump to solution
Thanks James.
That was how I got the sl4j-nop1.7.25.jar solution 🙂

"Placing one (and only one) of slf4j-nop.jar slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem."
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.