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=