在Windows上 – 我可以在哪里使用mqji.properties?

我的应用程序是一个独立的Java应用程序,客户可以下载,安装和运行。 它使用MQ与已经工作多年的主机进行通信。 我自己和客户都没有在他们的Windows机器上安装任何MQ; 我们包括并使用com.ibm.mq.jar来完成这项工作。

显然,MQ需要在类路径中使用mqji.properties文件来防止这种情况:

Unable to load message catalog - mqji com.ibm.mq.MQException: Message catalog not found 

所以我的问题是:我从哪里得到一个?

这是我的mqji.properties文件的副本。

复制并粘贴到文本编辑器中。
保存为mqji.properties
将此文件所在的目录放入CLASSPATH。

 # mqjiEn_US.properties # Messages produced by the Websphere MQ Java interface classes # (shared by bindings and by client) # Messages beginning with MQJI are explanations for exceptions # Messages beginning with MQJE are errors # # From class MQDistributionList # 1=MQJI001: Queue manager object was null. 2=MQJI002: Not connected to a queue manager. 3=MQJI003: No object records supplied. 4=MQJI004: No response records supplied. 5=MQJI005: Not enough response records supplied. 6=MQJI006: An object or response record was null. 7=MQJI007: openResponse parameter was null. 8=MQJI008: Null message passed to put. 9=MQJI009: Null put message options passed to put. 10=MQJI010: Number of message trackers and response records do not match. 11=MQJI011: The distribution list has been closed. # # From class MQEnvironment # 12=Websphere MQ Client for Java v5.3 # # From class MQGetMessageOptions # 13=MQJI013: Unsupported version number - {0} 14=MQJI014: Insufficient data received from queue manager. 15=MQJI015: Erroneous eyecatcher : {0} # # From class MQManagedObject # 16=MQJI016: Object has been closed. 17=MQJI017: No selectors specified. # # From class MQMD # 18=MQJI015: Erroneous eyecatcher : {0} 19=MQJI018: Array copy error in MQMD # # From class MQMessage # 20=MQJI019: Malformed UTF string in MQMessage::readLine 21=MQJI020: Unsupported codeset : {0} 22=MQJI021: String index error occurred during codeset conversion 23=MQJI015: Erroneous eyecatcher : {0} # # From class MQOD # 24=MQJI022: Unmatched number of object and response records # # From class MQPutMessageOptions # 25=MQJI023: Null MQMessageTracker object supplied # # From class MQMessageTracker # 26=MQJI024: Array copy error in MQMessageTracker # # From class MQQueue # 27=MQJI025: Null MQMessage passed to get 28=MQJI026: Null MQGetMessageOptions passed to get 29=MQJI027: The queue has been closed 30=MQJI028: Null MQMessage passed to put 31=MQJI029: Null MQPutMessageOptions passed to put # # From class MQQueueManager # 32=MQJI030: The queue manager does not support distribution lists. # # From class MQS390FloatSupport # 33=MQJI031: Number outside of range for double precision S/390 Float # # From class MQS390PackedDecimalSupport # 34=MQJI032: Invalid sign nibble in packed decimal 35=MQJI033: Packed Decimal digit outside of range 0-9 36=MQJI034: Outside of range for short packed decimal (+/-999) 37=MQJI035: Outside of range for integer packed decimal (+/-9999999) 38=MQJI036: Outside of range for long packed decimal (0+/-999999999999999) # # From class MQException # 39=MQJE001: Completion Code {0}, Reason {1} 40=MQJE001: An MQException occurred: Completion Code {0}, Reason {1}\n{2} # # Messages produced by client only classes... # 41=MQJI037: Error occurred during Websphere MQ API call - reason code {0} 42=MQJI038: Unexpected internal error during string index processing 43=MQJE002: Socket output stream was null 44=MQJE003: IO error transmitting message buffer 45=MQJE004: Socket input stream was null 46=MQJE005: TSH eyecatcher not found. Eyecatcher was {0} 47=MQJE006: Internal error during array copy 48=MQJE007: IO error reading message data 49=MQJE008: IOException whilst sending status message 50=MQJE009: Failed to build API header 51=MQJE010: Unknown host: {0} 52=MQJE011: Socket connection attempt refused 53=MQJE012: Security error - cannot connect to host {0} 54=MQJE013: Error accessing socket streams 55=MQJE014: Control Point rejected connection 56=MQJE015: Error connecting to Control Point 57=MQJE016: MQ queue manager closed channel immediately during connect\n\Closure reason = {0} 58=MQJE017: MQ queue manager sent status error {0} during connect 59=MQJE018: Protocol error - unexpected segment type received 60=MQJE019: Error creating initial data segment 61=MQJE020: CCSID not supported by queue manager 62=MQJE021: Encoding not supported by queue manager 63=MQJE022: FAP level not supported by queue manager 64=MQJE023: Negotiation failed on maximum messages per batch 65=MQJE024: Sequence wrap value not supported by queue manager 66=MQJE025: Channel closed after two initial changes. Closure reason {0} 67=MQJE026: Queue manager sent status error {0} during connect 68=MQJE027: Queue manager security exit rejected connection with error code {0} 69=MQJE028: Channel closed during security exchanges 70=MQJE029: Unexpected message type sent by queue manager 71=MQJE030: IOException during security flows 72=MQJE031: Security exit closed the channel 73=MQJE032: Queue manager security exit rejected connection with reason code {0} 74=MQJE033: A required security flow was not sent by the queue manager 75=MQJE034: Unexpected message type sent by queue manager 76=MQJE035: Negotiated maximum transmission size is too small 77=MQJE036: Queue manager rejected connection attempt 78=MQJE037: Remote queue manager closed the connection 79=MQJE038: Unexpected segment type {0} received 80=MQJE039: IOException whilst building connection data stream 81=MQJE040: Channel closed by exit 82=MQJE041: Unsupported version number - (0) 83=MQJE042: Erroneous eyecatcher: {0} 84=MQJE043: Insuffucient data received from queue manager 85=MQJE044: Array copy error in MQMD 86=MQJE045: Malformed UTF string 87=MQJE046: Unsupported codeset : {0} 88=MQJE047: String index error occurred during codeset conversion 89=MQJE048: Invalid sign nibble in packed decimal 90=MQJE049: Packed Decimal digit outside of range 0-9 91=MQJE050: Outside of range for short packed decimal (+/-999) 92=MQJE051: Outside of range for integer packed decimal (+/-9999999) 93=MQJE052: Outside of range for long packed decimal (0+/-999999999999999) 94=Websphere MQ Bindings for Java v5.3 95=MQJE053: The Websphere MQ Bindings for Java library could not be loaded 96=MQJE054: The queue manager does not support distribution lists 97=MQJE055: The queue manager does not support version 2 Websphere MQ API structures 98=MQJE056: Initial negotiation failure 99=MQJE057: Channel closed during security exchanges 100=MQJE058: Invalid number of object or response records 101=MQJE059: String index error 102=MQJE060: Could not find class {0} 103=MQJE061: Could not find field {0} 104=MQJE062: Could not find method {0} # # Messages used by MQManagedConnectionJ11, ManagedConnectionFactories # and MQManagedConnectionMetaData # 105=MQJI039: Invalid ConnectionRequestInfo object 106=MQJI040: MQManagedConnection already destroyed 107=MQJI041: Method {0} is not supported by Websphere MQ Classes for Java 108=MQJI042: MQManagedConnection is not reusable # # Messages from MQManagedConnectionMetaData # 109=IBM Websphere MQ 110=Command Level {0} # # Messages from MQXAi # 111=Security manager prevented access to native methods library for MQ XA support. 112=Failed to load native methods library for MQ XA support. # # Messages from MQXAResource # 113=xa_open failed 114=XA operation failed, see errorCode 115=XAResource closed # # Messages produced by com.ibm.mq.MQMsg2 # 116=MQJE063: Unsupported character set {0} 117=MQJE064: Unsupported version of MQMD structure {0} 118=MQJE065: Inconsistent internal state detected # message when server doesn't support client XA 119=client connection not XA enabled # # Messages produced via SSL options on a client connection # 120=MQJE066: {0} provided as an unsupported object type 121=MQJE067: Peer name {0} did not match requested name {1} 122=MQJE068: Server certificate has been revoked 123=MQJE069: Unable to contact CertStore 124=MQJE070: SSL Protocol error: Channel not configured for SSL? 

这里的正确答案是客户需要下载实际的WMQ客户端并将其与您的应用程序一起安装,并且您的应用程序应该在没有WMQ客户端jar的情况下进行分发。 这是因为各种原因:

  • 您无权重新分发供应商的代码。 当WMQ客户端或服务器代码捆绑在OEM许可证中时,它是完整安装而不仅仅是几个jar文件。
  • 安装完整客户端的原因之一是获得支持。 完整的客户端安装是免费的,包括许多诊断设施。 不要求完全安装的唯一原因是方便,如果您要为应用程序收费,任何便利都远远超过潜在的责任。
  • 保养。 如果客户安装WMQ客户端,那么他们可以从IBM应用定期维护,并且知道它是完整且完整的分发。 除非贵公司准备保证他们选择重新分发的组件是有效的安装,否则最好使用官方安装。 鉴于问题的本质是询问这个社区有效的非供应商安装是什么,我不知道你的公司如何能够支持这种IBM代码配置。
  • 法规遵从性。 如果您的任何客户受到PCI,SOX,HIPAA或政府法规的约束,则在此配置下无法获得认证。 例如,要符合PCI标准,部署的应用程序必须在很久以前应用了Fix Pack 7.0.1.3。 如果没有完整安装,则无法应用修订包或向基于jar子安装的审核员certificate。
  • 安全。 如果您不使用SSL或退出,则客户可能会相互冒充或使用WMQ管理帐户。 为了使用SSL,您必须安装GSKit中的IBM JCCE提供程序,它是完整客户端安装的一部分,并包含jar文件中可用的本机编译C代码。 根据应用程序的描述,我猜你的任何客户都可以远程,匿名管理你的QMgr并执行任意操作系统代码。 不好。

因此,正确的答案是让您和您的客户下载并安装完整的WMQ客户端( SupportPac MQC7 )并配置应用程序在其上运行。 更不用说让您的客户和公司面临风险。

如果您对我提到的安全风险有任何疑问,请参阅此处发布的IMPACT Hardening WebSphere MQ演示文稿和WebSphere MQ实践安全实验室