jpos Gateway : Not able to send back the response message received from the remote host to the client requested - jpos

I am new to jpos. trying to use jpos-2_1_3 out of the box. I can see the message forwarded to remote host and response back but the response message is not delivered to the requested client.Getting the below error
[HOST_UNREACHABLE] o.j.t.p.QueryHost.expired:111 'mux.rsc' does not respond
I checked the client status which is connected and waiting for the response
My config files are as below
50_server.xml
<server class="org.jpos.q2.iso.QServer" logger="Q2" name="bnet-server-7003" realm="bnet-server-8000">
<attr name="port" type="java.lang.Integer">6003</attr>
<channel class="org.jpos.iso.channel.NACChannel"
packager="org.jpos.iso.packager.GenericPackager"
type="server"
logger="Q2"
header="6000000000"
>
<property name="packager-config" value="cfg/packager/CISebcdic.xml" debug="True" />
<property name="timeout" value="18000"/>
</channel>
<request-listener class="org.jpos.iso.IncomingListener" logger="Q2" realm="incoming-request-listener">
<property name="space" value="tspace:default" />
<property name="queue" value="RSCTXNMGR" />
<property name="ctx.DESTINATION" value="rsc" />
</request-listener>
</server>
10_channel.xml
<?xml version="1.0" ?>
<channel-adaptor name='rsc-channel' class="org.jpos.q2.iso.ChannelAdaptor" logger="Q2">
<channel class="org.jpos.iso.channel.BCDChannel"
packager="org.jpos.iso.packager.GenericPackager" header="6000000000" logger="Q2" >
<property name="packager-config" value="cfg/packager/CISascii.xml" debug="True" />
<property name="host" value="127.0.0.1" />
<property name="port" value="9000" />
<property name="keep-alive" value="true" />
</channel>
<in>rscbnet-send</in>
<out>rscbnet-receive</out>
<reconnect-delay>10000</reconnect-delay>
</channel-adaptor>
20_mux.xml
<?xml version="1.0" ?>
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="rsc">
<in>rscbnet-receive</in>
<out>rscbnet-send</out>
<ready>rsc-channel.ready</ready>
<key>41,11</key>
<unhandled>rsc-channel-unhandled</unhandled>
</mux>
30_txnmgr.xml
<?xml version='1.0'?>
<txnmgr class="org.jpos.transaction.TransactionManager" logger="Q2">
<property name="queue" value="RSCTXNMGR"/>
<property name="sessions" value="10"/>
<property name="max-sessions" value="128"/>
<property name="debug" value="true"/>
<participant class="org.jpos.transaction.participant.QueryHost" logger="Q2"/>
<participant class="org.jpos.transaction.participant.SendResponse" logger="Q2" />
</txnmgr>
in the log i can see message is send to the remote host and response is received
<log realm="channel/127.0.0.1:9000" at="2020-02-22T17:11:39.114">
<send>
<isomsg direction="outgoing">
<!-- org.jpos.iso.packager.GenericPackager[cfg/packager/CISascii.xml] -->
<header>6000000000</header>
<field id="0" value="0400"/>
<field id="2" value="4113550001234586"/>
<field id="3" value="003000"/>
<field id="4" value="000000005000"/>
<field id="7" value="0218135108"/>
<field id="11" value="570164"/>
<field id="12" value="005106"/>
<field id="13" value="0219"/>
<field id="14" value="1906"/>
<field id="18" value="7399"/>
<field id="22" value="812"/>
<field id="32" value="001529"/>
<field id="33" value="004601"/>
<field id="37" value="702011961044"/>
<field id="39" value="00"/>
<field id="41" value="W1Q99999"/>
<field id="42" value="25233065 "/>
<field id="43" value="Apple NZ GCS Sydney AU"/>
<field id="48" value="543432303730313033323130363331355649533237333634353032313920203230303153" type="binary"/>
<field id="49" value="036"/>
<field id="61" value="10251040066000362000"/>
<field id="90" value="010057016402181351080000000152900000004601"/>
</isomsg>
</send>
</log>
<log realm="channel/127.0.0.1:9000" at="2020-02-22T17:11:39.115" lifespan="179071ms">
<receive>
<isomsg direction="incoming">
<!-- org.jpos.iso.packager.GenericPackager[cfg/packager/CISascii.xml] -->
<header>6000000000</header>
<field id="0" value="0410"/>
<field id="2" value="4113550001234586"/>
<field id="3" value="003000"/>
<field id="4" value="000000005000"/>
<field id="7" value="0221223852"/>
<field id="11" value="620156"/>
<field id="12" value="093850"/>
<field id="13" value="0222"/>
<field id="14" value="1906"/>
<field id="18" value="7399"/>
<field id="22" value="812"/>
<field id="32" value="001529"/>
<field id="33" value="004601"/>
<field id="37" value="702011079220"/>
<field id="39" value="00"/>
<field id="41" value="W1Q99999"/>
<field id="42" value="25233065 "/>
<field id="43" value="Apple NZ GCS Sydney AU"/>
<field id="48" value="543432303730313033323130363331353030303030303030303030303020203230303153" type="binary"/>
<field id="49" value="036"/>
<field id="61" value="10251040066000362000"/>
<field id="90" value="010062015602212238520000000152900000004601"/>
</isomsg>
</receive>
</log>
<log realm="org.jpos.transaction.TransactionManager" at="2020-02-22T17:12:09.115" lifespan="30001ms">
<abort>
txnmgr-9:idle:2
<context>
TIMESTAMP: Sat Feb 22 17:11:39 AEDT 2020
SOURCE: org.jpos.iso.channel.NACChannel#795c411
REQUEST:
<isomsg direction="outgoing">
<!-- org.jpos.iso.packager.GenericPackager[cfg/packager/CISascii.xml] -->
<header>6000000000</header>
<field id="0" value="0400"/>
<field id="2" value="4113550001234586"/>
<field id="3" value="003000"/>
<field id="4" value="000000005000"/>
<field id="7" value="0218135108"/>
<field id="11" value="570164"/>
<field id="12" value="005106"/>
<field id="13" value="0219"/>
<field id="14" value="1906"/>
<field id="18" value="7399"/>
<field id="22" value="812"/>
<field id="32" value="001529"/>
<field id="33" value="004601"/>
<field id="37" value="702011961044"/>
<field id="39" value="00"/>
<field id="41" value="W1Q99999"/>
<field id="42" value="25233065 "/>
<field id="43" value="Apple NZ GCS Sydney AU"/>
<field id="48" value="543432303730313033323130363331355649533237333634353032313920203230303153" type="binary"/>
<field id="49" value="036"/>
<field id="61" value="10251040066000362000"/>
<field id="90" value="010057016402181351080000000152900000004601"/>
</isomsg>
DESTINATION: rsc
**RESULT:
<result>
<fail>
[HOST_UNREACHABLE] o.j.t.p.QueryHost.expired:111 'mux.rsc' does not respond
</fail>
</result>**
:paused_transaction:
id: 2
</context>
prepare: o.j.t.p.QueryHost PREPARED PAUSE READONLY NO_JOIN
prepare: o.j.t.p.SendResponse ABORTED READONLY NO_JOIN
in-transit=0, head=3, tail=3, paused=0, outstanding=0, active-sessions=10/128, tps=0, peak=1, avg=0.00, elapsed=30001ms
<profiler>
prepare: o.j.t.p.QueryHost [0.3/0.3]
resume [30000.5/30000.8]
prepare: o.j.t.p.SendResponse [0.1/30001.0]
end [1.1/30002.2]
</profiler>
</abort>
</log>
<log realm="Q2.system" at="2020-02-22T17:12:43.242">
it will be great if i get some help to solve this issue.thanks in advance.

To summarize in an answer what was explained in comments, problem was field 11 not being matched by response. Because of that the mux didn't know that the incoming message was a response for the request.
You can see default fields used to match responses to requests by QMUX, and learn how to configure a different set of keys in jPOS programmers guide section 8.3.2

Related

Jasper Report how to get a sibling node with parameter of another sibling?

I am working on a new Jaspert Report. It should print all data of a xml text.
The xml text looks like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<invoice:invoiceMessage>
<invoice>
<invoiceIdentification></invoiceIdentification>
<seller>
<address>
<name></name>
<city></city>
<cityCode></cityCode>
</address>
</seller>
</invoice>
</invoice:invoiceMessage>
And the Jasper Report looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 7.1.0.final using JasperReports Library version 6.4.3 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="main_report_xml1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="24a4119c-6e8f-4411-bbb5-c069ab379330">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
<property name="ireport.jasperserver.url" value="http://10.100.10.236/jasperserver-pro/"/>
<property name="ireport.jasperserver.user" value="reko"/>
<property name="ireport.jasperserver.reportUnit" value="/Reko/main_report_xml1"/>
<subDataset name="pageHeader" uuid="cf87fcbb-cbcd-4c3b-bf87-3cf147854adb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
<queryString language="xPath">
<![CDATA[//seller/address]]]>
</queryString>
<field name="name" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="name"/>
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
<field name="streetAdressOne" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="streetAdressOne"/>
<fieldDescription><![CDATA[streetAdressOne]]></fieldDescription>
</field>
<field name="cityCode" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="cityCode"/>
<fieldDescription><![CDATA[cityCode]]></fieldDescription>
</field>
<field name="city" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="city"/>
<fieldDescription><![CDATA[city]]></fieldDescription>
</field>
</subDataset>
<parameter name="xmlString" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA[xmlText]]></defaultValueExpression>
</parameter>
<parameter name="XML_INPUT_STREAM" class="java.io.InputStream">
<defaultValueExpression><![CDATA[new java.io.ByteArrayInputStream($P{xmlString}.getBytes("ISO-8859-1"))]]></defaultValueExpression>
</parameter>
<queryString language="xPath">
<![CDATA[/invoiceMessage/invoice[invoiceIdentification/entityIdentification=9000009029]]]>
</queryString>
<field name="value" class="java.lang.String">
<fieldDescription><![CDATA[creationDateTime]]></fieldDescription>
</field>
<pageHeader>
<band height="38"/>
</pageHeader>
<columnHeader>
<band height="31" splitType="Stretch"/>
</columnHeader>
<detail>
<band height="488" splitType="Stretch">
<componentElement>
<reportElement positionType="Float" stretchType="RelativeToTallestObject" x="0" y="21" width="552" height="30" isRemoveLineWhenBlank="true" uuid="fc7d22c7-8c60-4ecb-974f-c842becc4bf7"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="pageHeader" uuid="1e20fa2b-bb3a-475f-b721-5a13d3c374eb">
<datasetParameter name="XML_DATE_PATTERN">
<datasetParameterExpression><![CDATA[$P{XML_DATE_PATTERN}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_NUMBER_PATTERN">
<datasetParameterExpression><![CDATA[$P{XML_NUMBER_PATTERN}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_LOCALE">
<datasetParameterExpression><![CDATA[$P{XML_LOCALE}]]></datasetParameterExpression>
</datasetParameter>
<datasetParameter name="XML_TIME_ZONE">
<datasetParameterExpression><![CDATA[$P{XML_TIME_ZONE}]]></datasetParameterExpression>
</datasetParameter>
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("//*[entityIdentification=9000009029]/parent::*/seller")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="30">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="0" y="0" width="552" height="15" uuid="eac696b9-e20f-48a3-b70d-b186f5e649d6"/>
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</detail>
</jasperReport>
My question is:
What should my dataSourceExpression in the componentElement be, so I can get the data out of it?
I also have some data in the invoice node that I need to show and thats why i set it like this in the query string. And I need to filter by the parameter that is stored inside of invoiceIdentification node.

Solr dataimport jdbc multiple columns into one field

I am trying to implement a solr search for a project. Everything was fine so far, a first simple version worked. Now I try to import from a postgres data base where multiple columns should end up in the same field. My config:
<entity name="address" query="SELECT objectid, ags2, ags3, ags5, ags8, ags11, ags20, ags22, pt, stn, hnr_min, hnr_max, plz, ort, ortz, ot1, ot2 FROM variablen2018.ags22_tmp_solr LIMIT 10000;">
<field column="objectid" name="id" />
<field column="plz" name="plz" />
<field column="ort" name="ort" />
<field column="ortz" name="ort" />
<field column="ot1" name="ort" />
<field column="ot2" name="ort" />
<field column="ort" name="ort_res" />
<field column="stn" name="stn" />
<field column="stn" name="stn_res" />
<field column="ags2" name="ags2" />
<field column="ags3" name="ags3" />
<field column="ags5" name="ags5" />
<field column="ags8" name="ags8" />
<field column="ags11" name="ags11" />
<field column="ags20" name="ags20" />
<field column="ags22" name="ags22" />
<field column="pt" name="coord" />
<field column="hnr_min" name="hnr_min" />
<field column="hnr_max" name="hnr_max" />
</entity>
As you can see there are 4 columns from the DB (ort, ortz, ot1, ot2) going into one field (ort). Most of the times only one of the columns is populated at all, in which case the document is indexed normally. But when there are actually multiple entries the indexing of the document fails. The field is defined this way:
<field name="ort" type="text_de" uninvertible="true" indexed="true" required="true" stored="true"/>
DataImporthandler maps the result view of the query to a schema view and hence I don't think that you will be able to map multiple columns to one field. Instead you can assign each column to a new Solr field and then do a copy of them in your schema.
eg
<field name="ort" type="string" />
<field name="ortz" type="string" />
<field name="ot1" type="string" />
<field name="ot2" type="string" />
<field name="ortCombined" type="string" multiValued="true"/>
<copyField source="ort" dest="ortCombined" />
<copyField source="ortz" dest="ortCombined" />
<copyField source="ot1" dest="ortCombined" />
<copyField source="ot2" dest="ortCombined" />
Hope this helps !
you do it this way:
you concatenate all values into a single value in the Select:
select ...,ort||','||ortz||','||or1||','||ort2 AS ort_all FROM variablen2018.ags22_tmp_solr
and then split it into individual values when indexing into solr (this is done with RegexTransformer/splitBy)
< entity name="address" transformer="RegexTransformer"
...
< field column="ort_all" name="ort" splitBy=","/>
Note: inserted a space after < or the text does not show up here...
To watch out:
handle possible nulls, check concat_ws etc
handle possible , inside ort values (use another separator or replace , etc)

how to change default delete icon of odoo 11

I have given editable bottom so i am getting default delete icon of odoo11. But i want to change it only to my module. How to change the delete icon to my own module ?
<field name="name"> Attachments</field>
<field name="model">attachments</field>
<field name="arch" type="xml">
<form string="Attachments">
<field name="line_ids" >
<tree string="Attachments" editable="bottom">
<field name="description" />
<field name="file_name" invisible="1" />
<field name="upload_file" filename="file_name" />
<button name ="download" icon ="gtk-go-down" type="object" />
</tree>
</field>
Thanks in Advance !
just add delete="false" in tree view
<field name="name">Attachments</field>
<field name="model">attachments</field>
<field name="arch" type="xml">
<form string="Attachments">
<field name="line_ids" >
<tree string="Attachments" editable="bottom" delete="false">
<field name="description" />
<field name="file_name" invisible="1" />
<field name="upload_file" filename="file_name" />
<button name ="download" icon ="gtk-go-down" type="object" />
</tree>
</field>
You can add delete="false" in tree tag
ex.
<tree string="Attachments" editable="bottom" delete="false">
<field name="description" />
<field name="file_name" invisible="1" />
<field name="upload_file" filename="file_name" />
<button name ="download" icon ="gtk-go-down" type="object" />
</tree>

Datastax Driver for cassandra and solr integration

I'm trying to integrate Solr-6.6.0 and Cassandra-3.10. I tried using JDBC of cassandra and I got to know that Cassandra JDBC does not support to the latest versions. Then, I came across Datastax Driver. So, right now I'm using Datastax cassandra-driver-core-3.1.4 as my java jar file.
solrconfig.xml
<requestHandler name="/dataimport" class="solr.DataImportHandler">
<lst name="defaults">
<str name="config">sample-data-config.xml</str>
</lst>
</requestHandler>
I added the above lines.
sample-data-config.xml
<dataConfig>
<dataSource type="JdbcDataSource" driver="com.datastax.driver.core.Connection" url="jdbc:cassandra://127.0.0.1:9042/demo" autoCommit="true"/>
<document name="content">
<entity name="test" query="SELECT id,org,name,dep,place,sal from tutor" autoCommit="true">
<field column="id" name="id" />
<field column="org" name="org" />
<field column="name" name="name" />
<field column="dep" name="dep" />
<field column="place" name="place" />
<field column="sal" name="sal" />
</entity>
</document>
</dataConfig>
where tutor is my table and demo is my keyspace.
manageschema.xml
<field name="org" type="string" indexed="true" stored="true" required="true" />
<field name="dep" type="string" indexed="true" stored="true" required="true" />
<field name="place" type="string" indexed="true" stored="true" required="true" />
<field name="sal" type="string" indexed="true" stored="true" required="true" />
<field name="name" type="string" indexed="true" stored="true" required="true"/>
Added the above lines to manage schema
Jar files added to lib folder of my core are
cassandra-driver-core-3.1.4.jar
cassandra-driver-extras-3.1.4.jar
cassandra-driver-mapping-3.1.4.jar
Now, when I run solr dih files, core does not give any requests as well it does not show any error messages. I'm throughly out of my mind.
Can we use the specified jar files to connect cassandra and solr? If so, where I'm wrong? Or else if we need to use the integrated one are we supposed to use only DSE search?
Thanks in advance.

Odoo 9 add column to grid view

I'm create simple module with 4 fields (name,date,user,description).Below is my .xml file.
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_my_report_form" model="ir.ui.view">
<field name="name">penalty.form</field>
<field name="model">my.report</field>
<field eval="2" name="priority"/>
<field name="arch" type="xml">
<form string="Project">
<sheet string="My report">
<group>
<div class="oe_title">
<h1 class="o_row">
<field name="name" placeholder="Name..." />
</h1>
</div>
</group>
<group>
<field name="user" placeholder="User..."/>
</group>
<group>
<field name="date" placeholder="Date..."/>
</group>
<notebook>
<page name="description_page" string="Description">
<field name="description"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_my_report_form">
<field name="name">Add new</field>
<field name="res_model">my.report</field>
</record>
<menuitem name="MY report" id="menu_penalty" action="action_my_izvjestaj_form" sequence="1"/>
</data>
</openerp>
When open from menu in grid view visble is only name.
https://postimg.org/image/ccms5aww3/
How add date and user fields?
You need to declare Tree view for that model.
<!-- Tree Views BEGIN-->
<record model="ir.ui.view" id="view_my_report_tree">
<field name="name">penalty.tree</field>
<field name="model">my.form</field>
<field name="arch" type="xml">
<tree string="Project">
<field name="name"/>
<field name="user"/>
<field name="date"/>
</tree>
</field>
</record>

Resources