pbfastco
12 years agoNew Contributor
Hermes JMS, Tibjms and Maven: JMS message sent to localhost
Hello everyone,
Here is my situation : I am running under CentOS release 6.4 (Final) x64, and I have some SOAPUI cases which are using JMS. I have installed Hermes JMS, and defined my session using TibjmsConnectionFactory. All my tests are running fine under Soapui.
Then I try to launch my tests using Maven, with the soapui-maven-plugin. I specified all the dependencies in my POM, in order to import Hermes JMS and have my SOAPUI project.xml file used. When launching, I run into this problem: instead of using tcp://vm3:7222 or tcp://vm4:7222, the connection is created for tcp://localhost:7222. But it seems the correct configurations files are used, according to the logs ("initialized soapui-settings from" and "loaded project from") :
The file /app/jenkins/jobs/Exec_SoapUiTests_Integ/workspace/resources/config/soapui-settings.xml contains a reference to Hermes JMS <con:setting id="ToolsSettings@hermesjms">/app/HermesJMS</con:setting>.
The content of /app/HermesJMS/cfg/hermes-config.xml, where I define tcp://vm3:7222 and tcp://vm4:7222 :
Important note: before having this problem, the hermes-config.xml was not found correctly. I needed to had "<con:setting id="ProjectSettings@hermesConfig">/app/HermesJMS/cfg</con:setting>" in my project file to make it "work". When I remove this or change the directory, I got an error saying that the Hermes config file is either incorrect or not found.
I found several topic on the subject, which gave solution like:
-Replace soapui/lib/hermes-1.14.jar with hermesJms/lib/hermes.jar
-copy asm*.jar and hermes-*.jar from hermesjms/lib to soapui/lib folder
And other stuff like that, but nothing worked.
Any help would be appreciated, thanks !
Here is my situation : I am running under CentOS release 6.4 (Final) x64, and I have some SOAPUI cases which are using JMS. I have installed Hermes JMS, and defined my session using TibjmsConnectionFactory. All my tests are running fine under Soapui.
Then I try to launch my tests using Maven, with the soapui-maven-plugin. I specified all the dependencies in my POM, in order to import Hermes JMS and have my SOAPUI project.xml file used. When launching, I run into this problem: instead of using tcp://vm3:7222 or tcp://vm4:7222, the connection is created for tcp://localhost:7222. But it seems the correct configurations files are used, according to the logs ("initialized soapui-settings from" and "loaded project from") :
[INFO]
[INFO] --- maven-soapui-plugin:4.5.1:test @ soapui.test ---
soapUI 4.5.1 Maven2 TestCase Runner
18:24:47,098 INFO [DefaultSoapUICore] initialized soapui-settings from [/app/jenkins/jobs/Exec_SoapUiTests_Integ/workspace/resources/config/soapui-settings.xml]
18:24:48,453 INFO [WsdlProject] Loaded project from [file:/app/jenkins/jobs/Exec_SoapUiTests_Integ/workspace/src/test/soapui/cacp-est-TestSuite%20-%20jenkins.xml]
[...]
18:24:53,713 ERROR [SoapUI] An error occured [Failed to connect to the server at tcp://localhost:7222], see error log for details
javax.jms.JMSException: Failed to connect to the server at tcp://localhost:7222
at com.tibco.tibjms.TibjmsxLinkTcp._createSocket(TibjmsxLinkTcp.java:831)
at com.tibco.tibjms.TibjmsxLinkTcp.connect(TibjmsxLinkTcp.java:922)
at com.tibco.tibjms.TibjmsConnection._create(TibjmsConnection.java:1299)
at com.tibco.tibjms.TibjmsConnection.<init>(TibjmsConnection.java:4155)
at com.tibco.tibjms.TibjmsTopicConnection.<init>(TibjmsTopicConnection.java:36)
at com.tibco.tibjms.TibjmsxCFImpl._createImpl(TibjmsxCFImpl.java:191)
at com.tibco.tibjms.TibjmsxCFImpl._createConnection(TibjmsxCFImpl.java:253)
at com.tibco.tibjms.TibjmsConnectionFactory.createConnection(TibjmsConnectionFactory.java:36)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.createConnection(JMSConnectionHolder.java:86)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.<init>(JMSConnectionHolder.java:66)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestSendTransport.execute(HermesJmsRequestSendTransport.java:35)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestTransport.sendRequest(HermesJmsRequestTransport.java:96)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:238)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:417)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:238)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:147)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
18:24:53,715 ERROR [SoapUI] An error occured [Failed to connect to the server at tcp://localhost:7222], see error log for details
javax.jms.JMSException: Failed to connect to the server at tcp://localhost:7222
at com.eviware.soapui.impl.wsdl.submit.transports.jms.JMSConnectionHolder.<init>(JMSConnectionHolder.java:78)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestSendTransport.execute(HermesJmsRequestSendTransport.java:35)
at com.eviware.soapui.impl.wsdl.submit.transports.jms.HermesJmsRequestTransport.sendRequest(HermesJmsRequestTransport.java:96)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:238)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:417)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:238)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:147)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
18:24:53,720 INFO [SoapUITestCaseRunner] Assertion [JMS Status] has status FAILED
18:24:53,720 ERROR [SoapUITestCaseRunner] ASSERTION FAILED -> Failed to connect to the server at tcp://localhost:7222
18:24:53,721 ERROR [SoapUITestCaseRunner] RefreshConfigDoublonFlux failed, exporting to [/app/jenkins/jobs/Exec_SoapUiTests_Integ/workspace/target/surefire-reports/10_ControleDoublon-CE646SDD_controle_de_doublon-updateConfigFlux-_common-UpdateFluxWithControleDoublon-RefreshConfigDoublonFlux-0-FAILED.txt]
18:24:53,723 INFO [SoapUITestCaseRunner] Finished running soapUI testcase [UpdateFluxWithControleDoublon], time taken: 2589ms, status: FAILED
18:24:53,725 ERROR [SoapUITestCaseRunner] updateConfigFlux failed, exporting to [/app/jenkins/jobs/Exec_SoapUiTests_Integ/workspace/target/surefire-reports/10_ControleDoublon-CE646SDD_controle_de_doublon-updateConfigFlux-0-FAILED.txt]
18:24:53,726 INFO [SoapUITestCaseRunner] Finished running soapUI testcase [CE-646:SDD controle de doublon], time taken: 3257ms, status: FAILED
18:24:53,731 INFO [SoapUITestCaseRunner] TestSuite [10_ControleDoublon] finished with status [FAILED] in 3335ms
The file /app/jenkins/jobs/Exec_SoapUiTests_Integ/workspace/resources/config/soapui-settings.xml contains a reference to Hermes JMS <con:setting id="ToolsSettings@hermesjms">/app/HermesJMS</con:setting>.
The content of /app/HermesJMS/cfg/hermes-config.xml, where I define tcp://vm3:7222 and tcp://vm4:7222 :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config showDestinationsInMessageStore="false" base64EncodeMessages="true" scrollMessagesDuringBrowse="true" lookAndFeel="javax.swing.plaf.metal.MetalLookAndFeel" enableJython="true" queueBrowseConsumerTimeout="0" selectorImpl="hermes.selector.JAMSELMessageSelectorFactory" correctDropSemantics="false" autoBrowseRefreshRate="10" maxColumnsInStatisticsTable="10" displayFactoryAdmin="true" copyJMSPriority="true" copyJMSReplyTo="true" copyJMSExpiration="true" copyJMSType="true" copyJMSCorrelationID="true" copyJMSProviderProperties="true" maxMessagesInBrowserPane="1000" messageFilesDir="/app/HermesJMS/bin/./messages" auditDirectory="/temp" maxThreadPoolSize="5" lastEditedByHermesVersion="v1.14" lastEditedByUser="tibco">
<classpathGroup id="EMS">
<library noFactories="true" jar="/app/tibco/product/ems/6.0/lib/jms.jar"/>
<library noFactories="true" jar="/app/tibco/product/ems/6.0/lib/slf4j-api-1.4.2.jar"/>
<library noFactories="true" jar="/app/tibco/product/ems/6.0/lib/slf4j-simple-1.4.2.jar"/>
<library noFactories="true" jar="/app/tibco/product/ems/6.0/lib/tibcrypt.jar"/>
<library noFactories="true" jar="/app/tibco/product/ems/6.0/lib/tibemsd_sec.jar"/>
<library factories="com.tibco.tibjms.TibjmsConnectionFactory,com.tibco.tibjms.TibjmsQueueConnectionFactory,com.tibco.tibjms.TibjmsTopicConnectionFactory,com.tibco.tibjms.TibjmsXAQueueConnectionFactory,com.tibco.tibjms.TibjmsXATopicConnectionFactory,com.tibco.tibjms.naming.TibjmsFederatedConnectionFactory,com.tibco.tibjms.naming.TibjmsFederatedQueueConnectionFactory,com.tibco.tibjms.naming.TibjmsFederatedTopicConnectionFactory,com.tibco.tibjms.naming.TibjmsFederatedXAQueueConnectionFactory,com.tibco.tibjms.naming.TibjmsFederatedXATopicConnectionFactory" noFactories="false" jar="/app/tibco/product/ems/6.0/lib/tibjms.jar"/>
<library noFactories="true" jar="/app/tibco/product/ems/6.0/lib/tibjmsadmin.jar"/>
<library factories="com.tibco.tibjms.appserver.borland.TibjmsBorlandQueueConnectionFactory,com.tibco.tibjms.appserver.borland.TibjmsBorlandTopicConnectionFactory,com.tibco.tibjms.appserver.borland.TibjmsBorlandXAQueueConnectionFactory,com.tibco.tibjms.appserver.borland.TibjmsBorlandXATopicConnectionFactory" noFactories="false" jar="/app/tibco/product/ems/6.0/lib/tibjmsapps.jar"/>
<library factories="com.tibco.tibems.ufo.TibjmsUFOConnectionFactory,com.tibco.tibems.ufo.TibjmsUFOQueueConnectionFactory,com.tibco.tibems.ufo.TibjmsUFOTopicConnectionFactory" noFactories="false" jar="/app/tibco/product/ems/6.0/lib/tibjmsufo.jar"/>
<library noFactories="true" jar="/app/tibco/product/ems/6.0/lib/tibrvjms.jar"/>
</classpathGroup>
<renderer className="hermes.renderers.DefaultMessageRenderer">
<properties>
<property value="false" name="bytesIsString"/>
<property value="false" name="bytesIsObject"/>
<property value="true" name="active"/>
<property value="100" name="messageCache"/>
<property value="65536" name="bytesIsObjectBufferSize"/>
<property value="false" name="toStringOnObjectMessage"/>
</properties>
</renderer>
<renderer className="hermes.renderers.DefaultMessageHeaderRenderer">
<properties>
<property value="true" name="active"/>
</properties>
</renderer>
<renderer className="hermes.renderers.ToStringMessageRenderer">
<properties>
<property value="true" name="active"/>
</properties>
</renderer>
<renderer className="hermes.renderers.HexMessageRenderer">
<properties>
<property value="true" name="active"/>
</properties>
</renderer>
<renderer className="hermes.renderers.XMLMessageRenderer">
<properties>
<property value="true" name="active"/>
</properties>
</renderer>
<renderer className="hermes.renderers.fix.FIXMessageRenderer">
<properties>
<property value="true" name="displayValueWithEnum"/>
<property value="true" name="active"/>
<property value="100" name="messageCache"/>
<property value="true" name="displayHeaderAndTrailer"/>
</properties>
</renderer>
<renderer className="hermes.renderers.EBCDICMessageRenderer">
<properties>
<property value="16" name="rowLength"/>
<property value="." name="undisplayableChar"/>
<property value="true" name="active"/>
<property value="5242880" name="maxMessageSize"/>
</properties>
</renderer>
<factory classpathId="System">
<provider className="hermes.providers.file.FileConnectionFactory">
<properties>
<property value="${hermes.home}/bin/messages" name="baseDirectory"/>
</properties>
</provider>
<connection>
<session audit="false" reconnects="0" id="Files"/>
</connection>
<destination domain="1" name="examples.xml"/>
<destination useLocalRenderer="true" durable="false" domain="1" name="fix.xml"/>
<extension className="hermes.ext.DefaultHermesAdminFactory">
<properties/>
</extension>
</factory>
<factory classpathId="EMS">
<provider className="com.tibco.tibjms.TibjmsConnectionFactory">
<properties>
<property value="tcp://vm4:7222" name="serverUrl"/>
<property value="admin" name="userName"/>
<property value="***" name="userPassword"/>
</properties>
</provider>
<connection connectionPerThread="false" clientID="">
<session useConsumerForQueueBrowse="false" audit="false" transacted="true" reconnects="0" id="EMS_EV"/>
</connection>
<destination> [... al destinations]
<extension className="hermes.ext.ems.TibcoEMSAdminFactory">
<properties>
<property value="***" name="password"/>
<property value="tcp://vm4:7222" name="serverURL"/>
<property value="admin" name="username"/>
</properties>
</extension>
</factory>
<factory classpathId="EMS">
<provider className="com.tibco.tibjms.TibjmsConnectionFactory">
<properties>
<property value="tcp://vm3:7222" name="serverUrl"/>
<property value="admin" name="userName"/>
<property value="***" name="userPassword"/>
</properties>
</provider>
<connection connectionPerThread="false" clientID="">
<session useConsumerForQueueBrowse="false" checkSizePeriod="1000" checkSize="false" audit="false" transacted="true" reconnects="0" id="EMS_EU"/>
</connection>
<destination> [... all destinations]
<extension className="hermes.ext.ems.TibcoEMSAdminFactory">
<properties>
<property value="***" name="password"/>
<property value="tcp://vm3:7222" name="serverURL"/>
<property value="admin" name="username"/>
</properties>
</extension>
</factory>
<quickFIX filterSessionMsgTypes="false" cacheSize="1024"/>
</config>
Important note: before having this problem, the hermes-config.xml was not found correctly. I needed to had "<con:setting id="ProjectSettings@hermesConfig">/app/HermesJMS/cfg</con:setting>" in my project file to make it "work". When I remove this or change the directory, I got an error saying that the Hermes config file is either incorrect or not found.
I found several topic on the subject, which gave solution like:
-Replace soapui/lib/hermes-1.14.jar with hermesJms/lib/hermes.jar
-copy asm*.jar and hermes-*.jar from hermesjms/lib to soapui/lib folder
And other stuff like that, but nothing worked.
Any help would be appreciated, thanks !