0
我在Jboss As 7.1服務器上部署了一個名爲SessionServiceBean
的會話bean。在部署我得到在控制檯下面的輸出監聽的bean,正確的JNDI標識符:JNDI:未找到EJB
JNDI bindings for session bean named SessionServiceBean in deployment unit subdeployment "account-ejb.jar" of deployment "replay-ear.ear" are as follows:
java:global/replay-ear/account-ejb/SessionServiceBean!de.replay.account.SessionService
java:app/account-ejb/SessionServiceBean!de.replay.account.SessionService
java:module/SessionServiceBean!de.replay.account.SessionService
java:jboss/exported/replay-ear/account-ejb/SessionServiceBean!de.replay.account.SessionService
java:global/replay-ear/account-ejb/SessionServiceBean
java:app/account-ejb/SessionServiceBean
java:module/SessionServiceBean
現在,如果我嘗試在我的JUnit測試案例來查找豆:
service = (SessionService) jndiCtx.lookup("java:global/replay-ear/account-ejb/SessionServiceBean!de.replay.account.SessionService");
我得到一個例外告訴我,服務器無法找到這個bean:
javax.naming.NameNotFoundException: global/replay-ear/account-ejb/SessionServiceBean!de.replay.account.SessionService -- service jboss.naming.context.java.jboss.exported.global.replay-ear.account-ejb."SessionServiceBean!de.replay.account.SessionService"
at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)
at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)
at org.jboss.naming.remote.protocol.v1.Protocol$1.handleServerMessage(Protocol.java:127)
at org.jboss.naming.remote.protocol.v1.RemoteNamingServerV1$MessageReciever$1.run(RemoteNamingServerV1.java:73)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
我不明白這個錯誤作爲JNDI標識符配襯在日誌中輸出的一個和我的客戶是肯定的連接正確的服務器。
難道是用戶Im用於身份驗證沒有jndi查找所需的權限?我其實不知道爲什麼這不起作用。那是我第一次使用遠程ejbs。