javax.security.sasl.SaslException:从远程客户端连接到 Jboss 7 服务器时验证失败 [英] javax.security.sasl.SaslException: Authentic Failed while connecting to Jboss 7 server from remote client
问题描述
我有独立的 Java 客户端(在 eclipse 中运行),我希望连接到外部服务器.如果服务器是本地主机,那么我看不到任何问题.但是,每当我尝试连接到外部服务器时,总是会出现以下异常
I have standalone Java client(Running from within eclipse ) that I wish to connect to an external server . If the server is localhost then i see no problems at all . However whenever i try to connect to the external server where I always gets the following exception
- JBREM000200: Remote connection failed: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
- Could not register a EJB receiver for connection to remote://10.160.148.61:4447
java.lang.RuntimeException: javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
我尝试按照提到的步骤EJB使用 JNDI 从远程客户端调用
异常告诉我 tthere 我的配置文件中与身份验证相关的错误.这是我的 ejb_client_properties 文件
The exception tells me tthere is something wrong in my configuration files related to authentication . Here is my ejb_client_properties file
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false
remote.connections=default
remote.connection.default.host=10.160.148.61
remote.connection.default.port = 4447
remote.connection.default.connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS=false
remote.connection.default.username=tan
remote.connection.default.password=f2b1c3c7d3f1e224cbf6508494cf0418
注意:用户 tan 被添加到服务器上的 mgt.user.properties 文件中.我使用 add-user.bat 在服务器中添加用户.我还添加了一个应用程序用户.我使用相同的凭据传递给服务器.我想不出别的了.
Note : the user tan is added to my mgt.user.properties file on the server . I used add-user.bat to add a user in the server . I also added an application user . I use the same credentials to pass to the server . I cant think of anything else .
我的 ejb 调用如下:
My ejb calling is as follows :
final Hashtable jndiProperties = new Hashtable();
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
InitialContext aJNDI = new InitialContext(jndiProperties);
Ppi handle = (Ppi) aJNDI
.lookup("ejb:PPIEAR/PService/PConnect!com.gem.p.PConnection?stateful");
我看到许多与异常相关的线程,但无法修复它:(有人可以帮忙.
I see numerous threads related to the exception but unable to fix it :( Can someone help .
我还在服务器上安装了合法的 SSL 证书.我需要做一些额外的事情来解决这个问题吗?
I also have a legitimate SSL certificate installed on the server . Do i need to do something extra to take care of that ?
另请注意:我的服务器以独立模式运行.
Also NOTE : My server is running in standalone mode .
推荐答案
好的,我已经能够找出问题所在.
Ok I have been able to figure out the problem .
这是一个应用程序用户在服务器端被错误添加的情况.具体见下文.
It was a case of the application user being added incorrectly on the server side . Specifically see below .
[userone@localhost bin]$ ./add-user.sh
What type of user do you wish to add?
a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a): b
Enter the details of the new user to add.
Realm (ApplicationRealm) : ApplicationRealm ---->> Careful Here . You need to type this or leave it blank . I filled an incorrect value here and things went wrong from there .
Username : testuser
Password : testpassword
Re-enter Password : testpassword
What roles do you want this user to belong to? (Please enter a comma separated list, or leave blank for none) : testrole
About to add user 'testuser' for realm 'ApplicationRealm'
Is this correct yes/no? yes
Added user 'testuser' to file '/home/userone/jboss-as-7.1.0.Final/standalone/configuration/application-users.properties'
Added user 'testuser' to file '/home/userone/jboss-as-7.1.0.Final/domain/configuration/application-users.properties'
Added user 'testuser' with roles testrole to file '/home/userone/jboss-as-7.1.0.Final/standalone/configuration/application-roles.properties'
Added user 'testuser' with roles testrole to file '/home/userone/jboss-as-7.1.0.Final/domain/configuration/application-roles.properties'
.
.
我花了很长时间才弄明白.相同的有用链接 :: http://middlewaremagic.com/jboss/?p=1466一个>
I took me a long time to figure this out . Helpful link for the same :: http://middlewaremagic.com/jboss/?p=1466
这篇关于javax.security.sasl.SaslException:从远程客户端连接到 Jboss 7 服务器时验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!