1. 程式人生 > >Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver availab

Exception in thread "main" java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver availab

Exception in thread “main” java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling

使用JBOSS/WildFly 呼叫EJB時遇到的錯誤:
遇到這種錯誤的時候,首先應該確認JNDI是否拼寫正確(我的第一反應是這個)。
然後,就是檢查你的java檔案下是否有:jboss-ejb-client.properties 這個檔案,一定是在src(或者其他程式碼所在的source folder)的根路徑下:
以下是錯誤示範:(檔案放錯路徑了,讓我找了好久)
這裡寫圖片描述

以下是jboss-ejb-client.properties的樣例:


endpoint.name=client-endpoint
remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED=false

remote.connections=default

remote.connection.default.host=127.0.0.1
remote.connection.default.port = 8080
remote.connection.default.connect.options.org.xnio
.Options.SASL_POLICY_NOANONYMOUS=false remote.connection.default.username=yufeng remote.connection.default.password=