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.
Wednesday, June 2, 2010
Tuesday, May 25, 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!
Monday, May 3, 2010
大马来商业圈
劳动节当日,前往马六甲。
堵车严重,从收费站算起大概有整二公里长的车龙吧,塞到南北大道来。借用当年一位部长的逻辑:马来西亚真繁荣、人民真有钱,打汽油像在喝开水。
收费站是一堵,城市内更是大大堵,炎热的天气助长体内火气,直想破口大骂发泄一番。
有一个地区叫爱极乐,真是大大变,比起当年我离开马六甲时多了很多很多的建筑物。
进去绕绕,有一间特大的《买定》商场,气势非凡。商场周围有好多好多的店、好多好多的车、好多好多的友族同胞。
看来 马哈蒂 梦想中的繁荣马来商业区就是那样的了,而 阿里路斯坦 先生已经帮 马哈蒂 完愿了,中央政府和其他州政府也能以这为榜样,马哈蒂 此生无憾矣。
堵车严重,从收费站算起大概有整二公里长的车龙吧,塞到南北大道来。借用当年一位部长的逻辑:马来西亚真繁荣、人民真有钱,打汽油像在喝开水。
收费站是一堵,城市内更是大大堵,炎热的天气助长体内火气,直想破口大骂发泄一番。
有一个地区叫爱极乐,真是大大变,比起当年我离开马六甲时多了很多很多的建筑物。
进去绕绕,有一间特大的《买定》商场,气势非凡。商场周围有好多好多的店、好多好多的车、好多好多的友族同胞。
看来 马哈蒂 梦想中的繁荣马来商业区就是那样的了,而 阿里路斯坦 先生已经帮 马哈蒂 完愿了,中央政府和其他州政府也能以这为榜样,马哈蒂 此生无憾矣。
Wednesday, April 28, 2010
为红毛泡茶
那天,临危受命,为红毛泡茶,贻笑大方。
茶,是绿茶,是龙井,是上等茶。
人,一个红毛,澳洲人,有两女奉陪,中女。之一乃其女友也。
喝了很多次茶,就是少喝龙井,太贵了,平常也只喝铁观音普洱之类的。龙井印象中只喝过两次吧!
泡龙井,手法与泡普洱不同。黄师傅泡过,我从头到尾仔细观察,但在人客面前毕竟有压力,而且还是红毛人,是一个期待看到中华文化精髓一面的人。吾紧张,尴尬,羞愧,后悔平常不多加锻炼。淡定方面失了分。
最终,还是勉为其难,乱泡一通。好在有那两女解围,压力也没那么大。
高兴的是,红毛平素少喝中国茶,对龙井赞不绝口,希望是由衷之言。
黄师傅说吾所泡之龙井有七十分,吾感欣慰,亦知有安慰分。吾有试自己所泡之茶汤,没那么香甜,带点苦涩,也许放了过多茶叶,水也过热了。
这是一个难得的经验,很高兴有外族朋友欣赏中华文化之茶道,帮我们打了“易卜拉欣阿里”那班猪狗一巴掌!
茶,是绿茶,是龙井,是上等茶。
人,一个红毛,澳洲人,有两女奉陪,中女。之一乃其女友也。
喝了很多次茶,就是少喝龙井,太贵了,平常也只喝铁观音普洱之类的。龙井印象中只喝过两次吧!
泡龙井,手法与泡普洱不同。黄师傅泡过,我从头到尾仔细观察,但在人客面前毕竟有压力,而且还是红毛人,是一个期待看到中华文化精髓一面的人。吾紧张,尴尬,羞愧,后悔平常不多加锻炼。淡定方面失了分。
最终,还是勉为其难,乱泡一通。好在有那两女解围,压力也没那么大。
高兴的是,红毛平素少喝中国茶,对龙井赞不绝口,希望是由衷之言。
黄师傅说吾所泡之龙井有七十分,吾感欣慰,亦知有安慰分。吾有试自己所泡之茶汤,没那么香甜,带点苦涩,也许放了过多茶叶,水也过热了。
这是一个难得的经验,很高兴有外族朋友欣赏中华文化之茶道,帮我们打了“易卜拉欣阿里”那班猪狗一巴掌!
Sunday, April 11, 2010
The world is really small
After so many years, me and my sifu(mentor) in ex-company are in the same team again! He left my ex-company in year 2005 and has joined a few companies in the following years. In year 2009 he joined my company and finally recently he officially became my teammate! So it has been 3 years then. When the news was announced i was like "wow, it's happening"
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)