我正在将ejb应用程序从OC4j迁移到JBoss AS7,我可以在JBoss控制台中成功部署ear,如下消息所述
17:30:30,346 INFO [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Listening on 127.0.0.1:4447
17:30:30,613 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:/jdbc/testappDataSource]
17:30:39,431 INFO [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Deployed "testapp.ear" (runtime-name : "testapp.ear")并且应用程序正在使用Customdatabase身份验证,因此相应地更新了standalone.xml,如下所述:
<security-domain name="testapp" cache-type="default">
<authentication>
<login-module code="com.demo.dev.framework.products.oc4j.security.auth.OC4JLoginManager" flag="required"/>
</authentication>
</security-domain>并将远程连接器配置为:
<subsystem xmlns="urn:jboss:domain:remoting:1.1">
<connector name="remoting-connector" socket-binding="remoting"/>
</subsystem>应用程序的Jndi属性为:
INITIAL_CONTEXT_FACTORY=org.jboss.naming.remote.client.InitialContextFactory
PROVIDER_URL=remote://127.0.0.1:4447/testapp
Context.SECURITY_PRINCIPAL=<db user name>
Context.SECURITY_CREDENTIALS=<db password>
Context.URL_PKG_PREFIXES= "org.jboss.ejb.client.naming" 现在我正在创建loginContext并从应用程序执行登录操作,但我在控制台中得到以下错误:
Created MBeanServer with ID: -793ffe64:14dcde54837:-8000:PC197689:1
2015-06-07 17:31:05,573 1 ERROR ( 114): Failed to create remoting connection.
javax.naming.NamingException: Failed to create remoting connection
at com.demo.dev.framework.util.ejb.LoginServiceLocator.authenticate(LoginServiceLocator.java:102)
at com.demo.dev.app.application.security.auth.OC4JLoginModuleWrapper.commit(OC4JLoginModuleWrapper.java:220)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.access$000(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
at javax.security.auth.login.LoginContext.login(Unknown Source)
at com.demo.dev.app.application.security.auth.Authentication.authenticate(Authentication.java:49)
at com.demo.dev.app.application.gui.controller.LoginCommand$LoginUserCommand.getResponseIntern(LoginCommand.java:68)
at com.demo.dev.framework.gui.command.BlockingGuiCommand.getResponse(BlockingGuiCommand.java:300)
at com.demo.dev.framework.gui.command.CommandQueue.executeCommand(CommandQueue.java:538)
at com.demo.dev.framework.gui.command.CommandQueue.doWork(CommandQueue.java:161)
at com.demo.dev.framework.gui.command.CommandQueue.access$5(CommandQueue.java:141)
at com.demo.dev.framework.gui.command.CommandQueue$NonModal.run(CommandQueue.java:611)
at java.lang.Thread.run(Unknown Source)
2015-06-07 17:31:05,706 134 ERROR ( 114): Client is unable to connect to application-server
(Failed to create remoting connection).
javax.security.auth.login.LoginException: Client is unable to connect to application-server
(Failed to create remoting connection)
at com.demo.dev.app.application.security.auth.OC4JLoginModuleWrapper.commit(OC4JLoginModuleWrapper.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.invoke(Unknown Source)
at javax.security.auth.login.LoginContext.access$000(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at javax.security.auth.login.LoginContext$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.invokePriv(Unknown Source)
at javax.security.auth.login.LoginContext.login(Unknown Source)
at com.demo.dev.app.application.security.auth.Authentication.authenticate(Authentication.java:49)
at com.demo.dev.app.application.gui.controller.LoginCommand$LoginUserCommand.getResponseIntern(LoginCommand.java:68)
at com.demo.dev.framework.gui.command.BlockingGuiCommand.getResponse(BlockingGuiCommand.java:300)
at com.demo.dev.framework.gui.command.CommandQueue.executeCommand(CommandQueue.java:538)
at com.demo.dev.framework.gui.command.CommandQueue.doWork(CommandQueue.java:161)
at com.demo.dev.framework.gui.command.CommandQueue.access$5(CommandQueue.java:141)
at com.demo.dev.framework.gui.command.CommandQueue$NonModal.run(CommandQueue.java:611)
at java.lang.Thread.run(Unknown Source)我已经尝试了使用JBoss的示例远程ejb应用程序,它工作得很好,但是当我尝试使用JBoss连接我的应用程序时,它不允许连接。
为了沟通,我还需要做什么吗?
发布于 2015-06-08 05:52:08
我不确定Customdatabase凭证是如何工作的,但看起来您可能需要调整这些行:
Context.SECURITY_CREDENTIALS = <db user name>
Context.SECURITY_CREDENTIALS = <db password>SECURITY_CREDENTIALS将列出两次。应该是吗?
Context.SECURITY_PRINCIPAL = <db username>
Context.SECURITY_CREDENTIALS = <db password>另外,只是想看看它是否有效:
Context.SECURITY_PRINCIPAL = <jboss username>
Context.SECURITY_CREDENTIALS = <jboss password>另外,可能是空格造成了问题。尝试:
Context.SECURITY_PRINCIPAL=<db user name>
Context.SECURITY_CREDENTIALS=<db password>https://stackoverflow.com/questions/30693473
复制相似问题