I was struggling with this message(XML) with MQRFH2 Header.
I have tried the MRM Header, the drawback is that you got to choose a schema, which makes it less flexible. Also the parsers being selected at runtime (printed in the mqsitrace log) are not consistent! Still puzzling.
Setting parser as BLOB in the MQInput node solved my issue. Without making any further message format conversion, you can read the xml using XMLNSC parser anytime anywhere.
Tuesday, March 1, 2011
Monday, September 27, 2010
Transfer message with RFH header from one queue to another queue
I have this simple java program transferring message with RFH header from one queue to another queue in bulk.
First time it failed due to the program failed to maintain the RFH header during the transfer. It read the message in STRING format and then put the message back in the destination queue.
After that i changed this by sending the MQMessage directly to the destination queue. This works.
First time it failed due to the program failed to maintain the RFH header during the transfer. It read the message in STRING format and then put the message back in the destination queue.
After that i changed this by sending the MQMessage directly to the destination queue. This works.
Thursday, September 9, 2010
java.sql.Date not working on WPS 6.2?
I had this program reading database table column as java.sql.Data type. Well it failed to read this when running from the WPS AIX server. Funny thing is it was fine when i was testing this program from my local WPS server runtime. In application log the column data type is recognized as java.sql.Timestamp. So i have to change to program to read Timestamp instead of Date.
Thursday, June 3, 2010
MQ-related CRON job setting
Recently my colleague was faced with the crontab issue. Below is the description:
1. CRON Tab
We developed a JAR where it connects to the Queue Manger and puts message into the Queue to kick start the WMB flow. We have created a Shell script to send message to the queue. It is successful by executing the Shell script manually where it connects to the Queue Manager and successfully put the message into the Queue.
Unfortunately, the CRON job failed to execute this script. After a few rounds of investigation we found out that this is due to the AIX Environment Setting. We need to set the environment variables at our Shell script as below before connecting to MQ:
. /opt/IBM/mqsi/6.1/bin/mqsiprofile
The default environment setting for CRON does not have the MQ Specific environment.
Therefore, when we are using server binding, we need in include this into our Shell script.
If the Shell is running externally as client, we do not need to include this.
1. CRON Tab
We developed a JAR where it connects to the Queue Manger and puts message into the Queue to kick start the WMB flow. We have created a Shell script to send message to the queue. It is successful by executing the Shell script manually where it connects to the Queue Manager and successfully put the message into the Queue.
Unfortunately, the CRON job failed to execute this script. After a few rounds of investigation we found out that this is due to the AIX Environment Setting. We need to set the environment variables at our Shell script as below before connecting to MQ:
. /opt/IBM/mqsi/6.1/bin/mqsiprofile
The default environment setting for CRON does not have the MQ Specific environment.
Therefore, when we are using server binding, we need in include this into our Shell script.
If the Shell is running externally as client, we do not need to include this.
Wednesday, May 26, 2010
Modify WSDL to get the java client generated right
I have to generate java client for this WSDL. However the bean generated is not what i expect. The reason is the SOAP response format actually looks like this:
<data>
<field id="field1"><field>
<field id="field2"><field>
...
</data>
The bean generated is like this:
public Class Response{
Field[] data;
....
}
I failed to get the value of each. The Field class does not provide a getValue method. Instead it provides getId method which returns the field id.
I had 2 solutions:
1) Modify the generated java web-service client code. (Those serializer, deserializer etc)
2) Modify the WSDL to get the code generated as according to what i want.
I chose the second option.
I commented this segment of the WSDL:
<xsd:element maxOccurs="unbounded" name="field">
<xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1" />
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
</xsd:element>
I replace the above segment with:
<maxoccurs="unbounded" minoccurs="0" name="field" nillable="true" type="xsd:string"/>
Done!
<data>
<field id="field1"><field>
<field id="field2"><field>
...
</data>
The bean generated is like this:
public Class Response{
Field[] data;
....
}
I failed to get the value of each
I had 2 solutions:
1) Modify the generated java web-service client code. (Those serializer, deserializer etc)
2) Modify the WSDL to get the code generated as according to what i want.
I chose the second option.
I commented this segment of the WSDL:
<xsd:element maxOccurs="unbounded" name="field">
<xsd:complexType>
<xsd:sequence maxOccurs="1" minOccurs="1" />
<xsd:attribute name="id" type="xsd:string" />
</xsd:complexType>
</xsd:element>
I replace the above segment with:
<maxoccurs="unbounded" minoccurs="0" name="field" nillable="true" type="xsd:string"/>
Done!
Wednesday, March 31, 2010
Issue with JMS & MQInput node in WMB
The XML is sent by JMS as below format:
reqMsg.setJMSType("mcd://mrm//" + msgType + "?format=CwXML");
WMB trace file throws the below error:
See the following messages for details of the error.
2010-03-31 16:49:05.949233 13942 ParserException BIP5313E: Message format ''CwXML'' is not defined for message set ''RR_MVNO_Port_In_MessageSet (H74SG78002001)''.
The broker received a message for processing within the MRM domain.
However, the message cannot be processed because the message format specified in the physical format identifier ''CwXML'' has not been defined for message set ''RR_MVNO_Port_In_MessageSet (H74SG78002001)''.
The message format describes the physical representation of the message, and you can specify this format either in the properties on an input node, or dynamically within an MQRFH2 message header.
The solution is to add one more "XML Wire Formats" at the Message Set.
Also, need to make sure the MQInput node's Message Domain & Message Set are set with the correct values.
reqMsg.setJMSType("mcd://mrm//" + msgType + "?format=CwXML");
WMB trace file throws the below error:
See the following messages for details of the error.
2010-03-31 16:49:05.949233 13942 ParserException BIP5313E: Message format ''CwXML'' is not defined for message set ''RR_MVNO_Port_In_MessageSet (H74SG78002001)''.
The broker received a message for processing within the MRM domain.
However, the message cannot be processed because the message format specified in the physical format identifier ''CwXML'' has not been defined for message set ''RR_MVNO_Port_In_MessageSet (H74SG78002001)''.
The message format describes the physical representation of the message, and you can specify this format either in the properties on an input node, or dynamically within an MQRFH2 message header.
The solution is to add one more "XML Wire Formats" at the Message Set.
Also, need to make sure the MQInput node's Message Domain & Message Set are set with the correct values.
Tuesday, March 16, 2010
Another cert issue
We have this standalone java program running on a AIX box calling a web service which is running on https. The web service provider provided us the cert and we imported this cert to the cacerts keystore using IBM Key Management tool(Alternatively you may use the java keytool command).
(Anyway this is the first time i am exposed to this, so please correct me if i am wrong)
At first the web service called failed. We got the below error:
unable to find valid certification path to requested target
We checked the shell script where we started this program. In the shell script, the java command path is specified as /usr/java5_64/bin and the cacerts actually resides at /usr/java5_64/jre/lib/security
Therefore we changed in our script from /usr/java5_64/bin/java to /usr/java5_64/jre/bin/java and now it is working well.
Please find the 2 URLs as below
Link1
Link2
(Anyway this is the first time i am exposed to this, so please correct me if i am wrong)
At first the web service called failed. We got the below error:
unable to find valid certification path to requested target
We checked the shell script where we started this program. In the shell script, the java command path is specified as /usr/java5_64/bin and the cacerts actually resides at /usr/java5_64/jre/lib/security
Therefore we changed in our script from /usr/java5_64/bin/java to /usr/java5_64/jre/bin/java and now it is working well.
Please find the 2 URLs as below
Link1
Link2
Subscribe to:
Posts (Atom)