Tag Archives: IBM

How to Solve IBM MQ Connect Error Code 2035

With some development experience with IBM MQ, you should realize when you look at 2035 that it was a permissions issue. The following figure

MQJE001: Completion code is '2', reason is '2035'.
Exception in thread "main" com.ibm.mq.MQException: MQJE001: Completion code is '2', reason is '2035'.
	at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:247)
	at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:588)
	at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:630)
	at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:107)
	at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:205)
	at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:911)
	at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:799)
	at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:750)
	at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:157)
	at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:681)
	at com.yusys.SendMsg.connect(SendMsg.java:30)
	at com.yusys.SendMsg.main(SendMsg.java:76)

Of course, you can also view the log file under the error folder of MQ, which has detailed error instructions.

Here is the test code:

package com.yusys;


import java.io.IOException;

import com.ibm.mq.MQEnvironment;
import com.ibm.mq.MQException;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
import com.ibm.msg.client.wmq.v6.base.internal.MQC;

public class SendMsg {
	static MQQueueManager qMgr;
	static int CCSID = 1381;
	static String queueName = "RQ_0000";
	static String message;
	
	public static void connect() throws MQException{
		MQEnvironment.hostname = "172.20.35.98";
		MQEnvironment.channel = "JMS_RECEIVE";
		MQEnvironment.port = 1416;
		MQEnvironment.CCSID = CCSID;
		//User name with privileges in MQ
		MQEnvironment.userID = "MUSR_MQADMIN";
		// the password corresponding to the user name
		MQEnvironment.password = "123456";
		
		qMgr = new MQQueueManager("QMA");
	}
	
	public static void sendMsg(String msgStr){
		int openOptions = MQC.MQOO_OUTPUT|MQC.MQOO_FAIL_IF_QUIESCING;
		MQQueue queue = null;
		try {
			//Open the queue
			queue = qMgr.accessQueue(queueName, openOptions);
			// Create message buffer
			MQMessage msg = new MQMessage(); 
			//set the options for placing messages
			MQPutMessageOptions pmo = new MQPutMessageOptions();
			//the message data to be sent
			msg.format = MQC.MQFMT_STRING;
			msg.characterSet = CCSID;
			msg.encoding = CCSID;
			msg.writeString(msgStr);
			msg.expiry = -1;//Set messages to never expire
			queue.put(msg,pmo);
			qMgr.commit();
	
		} catch (MQException e) {
			e.printStackTrace();
		} catch (IOException e){
			e.printStackTrace();
		} catch (Exception e){
			e.printStackTrace();
		} finally {
			if(queue!=null){
				try {
					queue.close();
				} catch (MQException e) {
					e.printStackTrace();
				} finally{
					try {
						qMgr.disconnect();
					} catch (MQException e) {
						e.printStackTrace();
					}
				}
			}
		}
	}
	
	public static void main(String[] args) throws MQException{
		connect();
//		String msg = HttpClientUtil.doGet("http://localhost:8080/user/all");
//		sendMsg(msg);
		sendMsg("Zhuang Sheng dawned a butterfly and wished the emperor a cuckoo in spring");
		System.out.println("End of insertion");
	}
}

Usually, MQ client and MQ server communication, using the MQ server connection channel service in the MCAUSER attribute specified by the user as the MQ client even come up with the user, if the MCAUSER attribute value is empty, use the MQ client in the operating system used by the user as the MQ client even come up with the user, communication, reported a 2035 error, is due to the client and server communication used by the user without permission, there are two solutions.
Method one:
If you set the MCAUSER property to MUSR_MQADMIN(CHANNEL definition name JMS_RECEIVE) in the server’s service connection CHANNEL definition: ALTER CHANNEL(JMS_RECEIVE) CHLTYPE(SVRCONN); MCAUSER(MUSR_MQADMIN) must ensure that the MUSR_MQADMIN user is a member of the MQM group as follows:
Usermod-g GroupName Username (change the group of the existing user)
Useradd-g GroupName Username (create new user and group)
Method 2:
If MQ channel definition on the server MCAUSER attribute values for vacant province, namely is empty, the MQ client can be used by the users to add to the MQ server’s operating system, for example, if the MQ client USES for the ADMIN user, the user is added to the MQ server ADMIN, and ensure the users in the MQM group MQ the server, and how to perform the necessary permissions on the queue manager operation.

Special note: When claiming MCA authentication under Windows and finding 2035, it may be because the channel authentication record Settings are blocked. You just need to change the list of users.

Why fan error appears in ThinkPad Lenovo IBM notebook

The original web site: http://pcweixiu.baike.com/article-11345.html

fan fan error error – as the name suggests is the machinery, in accordance with the general standard fault handler, the problem of processing method is to directly replace the fan and the joint of the heat sink can solve the black screen problem of fan error is not into the system. The main cause of the failure is due to the outlet, without dust easily into the cooling system and even when use, because all the machine only one internal fan to their necks to the work of all the heat caused by internal dust accumulated too much make a cooling fan fan increase lubrication part of the internal friction. Due to the increased resistance and limited instantaneous current at startup, the motor supply power is insufficient, and the machine detects that the fan is not started, so an error is reported. Replace CPU cooling fan is simple and direct approach, produce the IBM series machine appear fan another root cause of the error is on the motherboard temperature control chip, a temperature control chip is refers to the high and low in the temperature of the CPU card to control the fan running, if temperature control chip out of the question, also can appear on black screen fan error is not into the system, of course, in reality the moment you can also press the esc key to skip to into the system, but this case fan but how high is your CPU temperature, fan don’t return, because you skipped the self-inspection process of IBM, So the proposal had better be to appear this problem, change fan or graphics card chip directly, must not be penny wise and pound foolish, and burned CPU… Hehe…


IBM fan

solution:
first explain that this method needs a certain hands-on ability, it is suggested that friends who do not have enough experience in disassembly do not try it easily. In case of emergency, I can tell you that a simple temporary solution is to blow a deep breath into the heat sink (the position mentioned above), which should be ready to start.
this was due to the design models of laptop is very pay attention to the light, so the heat in the form of large heat sink and fan, the radiator covers the CPU and graphics boards (P series with long tube fan), and in addition to cool the CPU fan is directly to the heat from the air duct, so fan became the absolute core of the cooling system. The machine must be taken apart for the dust to be thoroughly cleared. There are many specific disassembly methods on the Internet. Simply put, remove all the screws marked 1, 2, 3 and 4 on the back, and then remove the keyboard and palm rest successively from the front. (The keyboard and palm have a wire to take off each, be careful not to break, if your palm rest is TrackOnly type, you may not have the palm take off that wire).
CPU radiator fin on a total of three or screw, because there is glue on the graphics card part of the radiator so can not directly take off, it is best to use a word screwdriver gently sled. When you take it off, you can see that there is a lot of dust under the fan. Clean it up first. On the surface, the fan is fixed between two radiators, which appear to be attached by rivets so are difficult to remove. In fact, it is not a rivet, just a very common clip, with a word screwdriver or a thin blade slightly with some force can be pry open (must choose a little bit of toughness, the blade in the moment folded is very dangerous). When the fan is removed, it is connected to the motor, and because a stick runs directly through the coil of the motor in order to reduce the volume, the fan page can be removed with a pinch. The following work needless to say, see the see can not see but also will deposit ash in the place is clean, it is best to fan on the shaft of some lubricating oil. And then put it back in order. That should be the end of it. Note: After cleaning and installation, please apply thermal conductive silicone grease, otherwise the machine will crash or shut down suddenly after long use.
(It is suggested that friends who like smoking should not smoke when using the computer, otherwise your CPU cooling fan will be broken soon, and the root cause of the failure is that the fan has been charged by the smoking machine.)