Forum Discussion

aremSOAP's avatar
aremSOAP
New Member
10 years ago

When testing jms, ready api is having error while it works fine on soapui

Hi

 

I am trying to use soapui as a testing tool for ibm mq, while following the tutorial i was able to make it work for soapui but when i turned to ready api, i am having an issue on  sending request. Please see below full stack trace of error

 

javax.jms.JMSException: JMSFMQ6312: An exception occurred in the Java(tm) MQI.
at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.createConnection(JMSConnectionHolder.java:98)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestSendReceiveTransport.execute(HermesJmsRequestSendReceiveTransport.java:38)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestTransport.sendRequest(HermesJmsRequestTransport.java:97)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

  • Well, I posted a case and got a workaround: replace commons-beanutils-1.8.3.jar in {ReadyAPI install}/lib with commons-beanutils-1.7.0.jar from {SoapUI Pro install}/lib.

     

    Seems to do the trick :-)

  • Hello aremSOAP, 

     

    Have you made sure that you are using the same hermesJMS installation in Ready and SoapUI? 

    They both come bundled with it, so please make sure that you haven't got two separate hermesJMS installations in both tools, in case you put any special jars in your lib-folder.

     

    Reason i'm asking is because it looks like Ready! API is unable to do one of the following things based on this error: 

    • Get the ConnectionFactory defined in HermesJMS
    • Create the connection with or without the correct credentials from the ConnectionFactory
    • Start the connection

     

    So my best bet is that something is acting up with Ready's connection to hermes. 

    If that looks allright then please check to see if there's any difference running these two versions of Ready. 

     

    Ready! API 1.2.1 VS Ready! API 1.3.0 

     

    Because if something changed for the worse in the classes governing JMS between SoapUI Pro and Ready! API

    then it happened between those two versions as JMS Virts was introduced. 

     

    Best of luck. 

     

     

  • johand's avatar
    johand
    Occasional Contributor

    We appear to be having the same problem.

     

    We used to work with SoapUI 4.6.4 and recently migrated to ReadyAPI 1.3.1 (both the 64 bit version).

     

    In SoapUI everything workes fine, but when using ReadyAPI, error JMSFMQ6312 is showing up when executing the same step.

     

    I've attached the logging for both SoapUI and ReadyAPI. Both give the same errors at the same point, but as you can see, the JMSFMQ6312 error is only showing up when using ReadyAPI.

    • OstbergM's avatar
      OstbergM
      Staff

      johand is it possible for you to try the 1.2.1 as i suggested in my post above? 

      It's relevant to know to track down if virt-refactoring between 1.2.1 - 1.3.1 caused this. 

      • johand's avatar
        johand
        Occasional Contributor

        @OstbergM I already tried that, but unfortunately that didn't resolve the problem.

  • johand's avatar
    johand
    Occasional Contributor

    Well, I found something when opening the ready-api-soapui-131.jar file and looking at the JMSConnectionHolder code. It seems there are 2 of those, but one is depricated.

     

    The old one has the following code:

    public JMSConnectionHolder(JMSEndpoint jmsEndpoint, Hermes hermes, boolean isTopicDomain, String clientID, String username, String password)

     

    The new one is this:

    public JMSConnectionHolder(JMSEndpoint jmsEndpoint, Hermes hermes, boolean isTopicDomain, String clientID)

     

    Part of our groovy-script is the following:

    def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null ,null ,null );

     

    So we were using the old JMSConnectionHolder.

     

    What I did was delete the two 'null' variables we were sending so our code now read the following:

    def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null );

     

    Bingo! The missing dll-file error has dissapeared.

     

    Unfortunately, the next line now gives a nullpointerexception. This is the line that is now giving a problem:

    Session queueSession = jmsConnectionHolder.getSession();

     

    For info, here is our part of our groovy-script:

    import com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder
    import com.eviware.soapui.impl.wsdl.submit.transports.jms.util.HermesUtils
    import com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSEndpoint
    import hermes.Hermes
    import javax.jms.*

    def queue = 'jms://FAT::queue_' + context.expand( '${#Project#Omgeving}' ) + '.UQ.WEKKER_AFGEGAAN.LQ'
    //def jmsEndpoint = new  JMSEndpoint("jms://FAT::queue_FPT.UQ.WEKKER_AFGEGAAN.LQ");
    def jmsEndpoint = new  JMSEndpoint(queue);
    def hermes = HermesUtils.getHermes( context.testCase.testSuite.project, jmsEndpoint.sessionName );
    //def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null ,null ,null );
    def jmsConnectionHolder = new JMSConnectionHolder( jmsEndpoint, hermes, false, null );

    Session queueSession = jmsConnectionHolder.getSession();
    Queue queueSend = jmsConnectionHolder.getQueue( jmsConnectionHolder.getJmsEndpoint().getSend() );

    MessageProducer messageProducer =queueSession.createProducer( queueSend );
    TextMessage textMessageSend = queueSession.createTextMessage();

     

    It's set up per the example found here: http://www.soapui.org/jms/working-with-jms-messages.html

     

    This is the error from the log:

    2015-06-05 15:41:27,742 ERROR [errorlog] java.lang.NullPointerException
    java.lang.NullPointerException
        at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.getSession(JMSConnectionHolder.java:152)
        at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder$getSession.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:110)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:114)
        at Script6.run(Script6.groovy:18)
        at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
        at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:76)
        at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:155)
        at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:263)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

    • 05ten's avatar
      05ten
      Contributor

      Unfortunately this only prolonged the problem to another line. 

       

      The constructor you were using previously allowed you to create a connection directly to your broken when creating the connectionHolder. The constructor you are using now prolongs the creation of that connection, but since the connection is not yet created there is no session to get. You can verify this by running jmsconnectionHolder.createConnection() right after creating it with your current constructor. 

       

      So we're not there yet unfortunately. I'm just about to try some debuggin on this, i'll get back to this thread soon with my findings. 

      • 05ten's avatar
        05ten
        Contributor

        Two kinds of news. 

         

        The bad news: 

        I haven't been able to fix the problem

         

        The good news: 

        I have downloaded a WebSphere 7.5 trial and reproduced your exact problems and can tinker with it to see if i can find a workaround for it. 

         

        I'll be in touch.