0

I am trying to connect to ESB broker using java code as below. I have verified that the username and password we are using are correct. Still I am receiving this error. What could be the cause for this error?

Caused by: [2101] progress.message.client.EInauthenticClient: Inauthentic Client
               at progress.message.client.EGeneralException.<init>(EGeneralException.java:43)
               at progress.message.client.ESecurityGeneralException.<init>(ESecurityGeneralException.java:23)
               at progress.message.client.ESecurityPolicyViolation.<init>(ESecurityPolicyViolation.java:32)
               at progress.message.client.EInauthenticClient.<init>(EInauthenticClient.java:27)
               at progress.message.zclient.Connection.connectWithRecoveryOpt(Connection.java:1055)
               at progress.message.zclient.ReconnectHelper.connectAndChaseSingleFailoverRedirect(ReconnectHelper.java:534)
               at progress.message.zclient.ReconnectHelper.connect(ReconnectHelper.java:367)
               at progress.message.zclient.Connection.connect(Connection.java:1562)
               at progress.message.jimpl.Connection.<init>(Connection.java:854)

Java Code:

Hashtable env = new Hashtable();
       env.put("java.naming.factory.initial", JNDI_FACTORY);
       env.put("java.naming.provider.url", provideURL);
       env.put(Context.SECURITY_PRINCIPAL, userName);
       env.put(Context.SECURITY_CREDENTIALS, password);
       env.put(com.sonicsw.jndi.mfcontext.domain, domainName);

InitialContext ctx = new InitialContext(env);
 qconFactory = (QueueConnectionFactory)ctx.lookup(JMS_FACTORY);
 qcon = qconFactory.createQueueConnection();
4

1 回答 1

0

它使用下面的代码。在 createQueueConnection 方法中添加了用户名和密码参数,并且它起作用了。:)

Hashtable env = new Hashtable();
       env.put("java.naming.factory.initial", JNDI_FACTORY);
       env.put("java.naming.provider.url", provideURL);
       env.put(Context.SECURITY_PRINCIPAL, userName);
       env.put(Context.SECURITY_CREDENTIALS, password);
       env.put(com.sonicsw.jndi.mfcontext.domain, domainName);

InitialContext ctx = new InitialContext(env);
 qconFactory = (QueueConnectionFactory)ctx.lookup(JMS_FACTORY);
 qcon = qconFactory.createQueueConnection(userName, password);
于 2017-06-14T07:56:15.550 回答