IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Java Service -> ext Java library (rabbit MQ client library -> Service.doInvoke fails

  • 1.  Java Service -> ext Java library (rabbit MQ client library -> Service.doInvoke fails

    Posted Tue September 29, 2015 10:29 AM

    Hi,

    i’m trying to use the external java library (Rabbit MQ Client jar) in wM Java Service.

    while consuming messages from Rabbit MQ’s Queue, i would like to invoke wM flow service from handleDelivery of consumer. But for some reasons, i’m not able to invoke wM built-in or user defined flow services from external library jar’s function

    any help is appreciated

    below is the exception

    jvm 1 | java.lang.NullPointerException
    jvm 1 | at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:427)
    jvm 1 | at com.wm.app.b2b.server.invoke.InvokeManager.invoke(InvokeManager.java:383)
    jvm 1 | at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:244)
    jvm 1 | at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:93)
    jvm 1 | at com.wm.app.b2b.server.Service.doInvoke(Service.java:692)
    jvm 1 | at com.wm.app.b2b.server.Service.doInvoke(Service.java:580)
    jvm 1 | at CustomerUpdates.MsgHandling$1.handleDelivery(MsgHandling.java:95)
    jvm 1 | at com.rabbitmq.client.impl.ConsumerDispatcher$5.run(ConsumerDispatcher.java:144)
    jvm 1 | at com.rabbitmq.client.impl.ConsumerWorkService$WorkPoolRunnable.run(ConsumerWorkService.java:99)
    jvm 1 | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    jvm 1 | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    jvm 1 | at java.lang.Thread.run(Thread.java:744)
    jvm 1 | error to invoke pub.flow:debugLog

    Thanks & Regards
    Ajay Kumar Kasam


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: Java Service -> ext Java library (rabbit MQ client library -> Service.doInvoke fails

    Posted Tue September 29, 2015 03:33 PM

    Hi Ajay,

    can you share some parts of the configuration and the place where you have placed the jar-file?

    Looks like an incomplete configuration or connectivity issue.

    Regards,
    Holger


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: Java Service -> ext Java library (rabbit MQ client library -> Service.doInvoke fails

    Posted Wed September 30, 2015 06:14 AM

    figured out the issue, resolved it.


    reply to your query, can you suggest where should rabbit mq client libraries placed. i had placed them in package’s code/jars directory


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 4.  RE: Java Service -> ext Java library (rabbit MQ client library -> Service.doInvoke fails

    Posted Fri October 02, 2015 03:49 PM

    Ajay – Did you call some method of java class which is expecting some input due to which you got NullPointerException. If this is not the reason, please share fix of this issue which may be helpful to other members.

    Thanks,


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 5.  RE: Java Service -> ext Java library (rabbit MQ client library -> Service.doInvoke fails

    Posted Mon October 05, 2015 02:44 PM

    Sounds good for the first try as long it is a pure Java API.
    In this case the Rabbit MQ API will only be available in this package and the packages which have declared to be dependent on this one.

    When exchanging the jar for a newer version remember to reload the package to make it active.

    I agree with MR that the fix should be shared with the community for other members having the same issue.

    Regards,
    Holger


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 6.  RE: Java Service -> ext Java library (rabbit MQ client library -> Service.doInvoke fails

    Posted Fri November 10, 2017 12:32 AM

    same issue and find resolution in empower:
    Sometime the Integration Server does not get the invoke state.

    Please try adding a new Invoke state before you do the invoke.

    InvokeState is = new InvokeState();

              Session session = Service.getSession();
    User olduser = session.getUser();
    InvokeState.setCurrentSession(session);
    InvokeState.setSessionUser(olduser);
    
    output = Service.doInvoke(nsServiceName, is.getSession(), input);
    

    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods