Hey,
I love this extender as it is so easy to use jms from javascript with it.
As we have to use Weblogic JMS I run into two problems. I found the solution for my first one but i will post it here for others with the same issue and the second one is a question for help from here.
a) When using a Topic or Queue all examples use the createTopic method. e.g.
session.createTopic("stocksTopic")
In case of Weblogic it is important to know that the given topic name is not the jndi-Name of that topic but the CDI name. CDI stands for Create Destination Identifier and ist not standardized.
Weblogics syntax here is to use JMSServer/JMSModule!TopicName e.g. 'JMS_Server/MyTestModule!stocksTopic' or if you have only one JMS Server you can use './MyTestModule!stocksTopic'.
b) now to my problem.
All worked fine but setting up a subscriber for a queue.
The same code that worked with ActiveMQ is throwing a NullPointerException with Weblogic - and as the stacktrace suggests that is inside lightstreamer and not due to using the weblogic jars. (i made a java application against the jar and it worked fine with all the same calls to the java api on java level.
The expception occurs when connection.start() is called.
here is the code:
Code:
jms.ConnectionFactory.createConnection(lightstreamerUrl, cfgName, null, null, {
onConnectionCreated: function(conn) {
node.connection = conn;
// Connection succeeded, dest subscription
var session= conn.createSession(false, "PRE_ACK");
var dest = session.createQueue(destination);
var consumer= session.createConsumer(dest, null);
// Add listener to message consumer
consumer.setMessageListener({
onMessage: function(message) {
node.log("ls-jms-in: Message received in ls-jms: " + message.getText())
node.send({payload: message.getText()});
}
});
node.log("start");
// Start the connection
conn.start();
node.status({fill:"green", shape:"dot", text:"connected"});
},
and here is the stacktrace:
Code:
28.Sep.18 12:11:37,298 <ERROR> Dispatcher S5399c6b84dba47e2T1137058/87a9cfe5-7c31-44fa-ac76-cf243981be7e: runtime exception caught while starting consumer for destination './PMES!t
estQueue' of type QUEUE
java.lang.NullPointerException: null
at java.util.concurrent.ConcurrentHashMap.putVal(Unknown Source) ~[na:1.8.0_161]
at java.util.concurrent.ConcurrentHashMap.put(Unknown Source) ~[na:1.8.0_161]
at com.lightstreamer.jms_extender.b.p.b(p.java) ~[ls-jms-adapters.jar:na]
at com.lightstreamer.jms_extender.b.o.a(o.java) ~[ls-jms-adapters.jar:na]
at com.lightstreamer.jms_extender.b.o.a(o.java) ~[ls-jms-adapters.jar:na]
at com.lightstreamer.jms_extender.b.aa.run(aa.java) [ls-jms-adapters.jar:na]
at com.lightstreamer.b.d.z.d(z.java) [lightstreamer.jar:na]
at com.lightstreamer.b.d.r.b(r.java) [lightstreamer.jar:na]
at com.lightstreamer.b.d.r.run(r.java) [lightstreamer.jar:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_161]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_161]
at com.lightstreamer.b.d.ar.c(ar.java) [lightstreamer.jar:na]
at com.lightstreamer.b.d.as.c(as.java) [lightstreamer.jar:na]
at com.lightstreamer.b.d.aq.run(aq.java) [lightstreamer.jar:na]
Hope you can give me any hints what goes wrong here and how i could fix it.
Bookmarks