对于以下代码
public class JMSSamplePut
{
private static String initialContextUrl = null;
private static String connectionFactoryFromJndi = "UM_QMGR_QCF";
private static String queueFromJndi = "BCUFXW.EXB.ATHENA.FX.IN";
private static String outString = "A sample text message " +
"from JMSSampleput";
private static int retryInterval = 10;
private static int retryCount = 3;
private static int connStatus = 1;
/**
* @param args
*/
public static void main( String[] args )
{
// Variables
Queue ioQueue = null;
QueueSession session = null;
QueueSender queueSender = null;
QueueConnection connection = null;
QueueConnectionFactory factory = null;
boolean transacted = false;
int i = 0;
try {
// Instantiate the initial context for JNDI
String contextFactory ="com.sun.jndi.fscontext.RefFSContextFactory";
Hashtable environment = new Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
environment.put(Context.PROVIDER_URL, "file:/c:/jndi");
Context context = new InitialDirContext(environment);
System.out.println("Initial context found!");
// Create a Queue ConnectionFactory
factory = (QueueConnectionFactory) context.lookup(connectionFactoryFromJndi);
...........
最后一行失败了
捕获 JMSException:com.ibm.msg.client.jms.DetailedJMSSecurityException:JMSWMQ2013:为 QueueManager 提供的安全身份验证无效,连接模式为“Client”,主机名为“NATMIB1.hostname.net(1414)”。请检查您要连接到链接异常的 QueueManager 上提供的用户名和密码是否正确:com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2035' (' MQRC_NOT_AUTHORIZED')。完成的
JVM参数
-Djavax.net.ssl.keystore=c://keystore//a_dev.jks \
-Djavax.net.ssl.keyStorePassword=******** \
-Djavax.net.ssl.trustStorePassword=******** \
-Djavax.net.ssl.trustStore=c://keystore//cacerts.jks \
-Djavax.net.debug=all
任何指针?为什么是以下行?
为具有连接模式“客户端”和主机名“NATMIB1.hostname.net(1414)”的 QueueManager 提供的安全身份验证无效
看起来 JNDI 代理无法找到 QueueManager 的名称?我在 .bindings 文件中有以下行,队列管理器名称是 NATMIB1
UM_QMGR_QCF/RefAddr/3/Content=NATMIB1.xyz.net
提前致谢
桑达尔