Gra*_*ham 5 jboss ejb ejb-3.0 jboss7.x
我有一个客户端应用程序和一个使用JBoss AS 7.1.1的服务器.在启动时,我的客户端连接到服务器就好了,并为我提供了一个远程接口.但是,当我尝试通过接口运行函数时,我得到以下异常:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException:
No EJB receiver available for handling [appName:GrahamsProjServer,modulename:GrahamsProjServer,distinctname:]
combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@3a42f352
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
at $Proxy0.persistSchemas(Unknown Source)
at grahamsprojclient.main.GrahamsProjScreen.btnPersistActionPerformed(Unknown Source)
at grahamsprojclient.main.GrahamsProjScreen.access$400(Unknown Source)
at grahamsprojclient.main.GrahamsProjScreen$5.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)
服务器上没有出现错误.当我运行该功能时,它看起来好像甚至没有与服务器通信.怎么可能在启动时我的客户端连接到服务器就好了,但是当我尝试运行一个函数它不会连接?
该No EJB receiver available消息本身并没有说明为什么它不会连接,所以这不会回答你的问题,但至少它可能会指出你正确的方向.
JBoss EJB客户端库使用Log4j它不会打印System.out也不会打印System.err.要真正了解发生了什么,您必须启用对org.jboss.ejb.client程序包的登录,例如在以下位置包含此行log4j.properties:
log4j.logger.org.jboss.ejb.client=TRACE
Run Code Online (Sandbox Code Playgroud)
启用此功能后,您可以更好地查看客户端正在为您执行的操作,并且很可能会打印基础错误.
此外,从JBoss 7.1.0开始,security-realm默认情况下启用,因此要进行远程调用,必须执行以下操作之一:
<security-realm/>从standalone.xml文件中删除它来禁用它要么
bin/add-user(.bat)(.sh)脚本将用户添加到服务器.添加后,在jboss-ejb-client.properties文件中包含user/pwd信息.在这里,您可以找到有关如何从远程客户端进行EJB调用的更详细指南.