Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 无法访问错误目标,标识符';注册bean';已解析为空_Jsf_Web Applications_Jboss7.x_Ejb 3.0_Netbeans 7 - Fatal编程技术网

Jsf 无法访问错误目标,标识符';注册bean';已解析为空

Jsf 无法访问错误目标,标识符';注册bean';已解析为空,jsf,web-applications,jboss7.x,ejb-3.0,netbeans-7,Jsf,Web Applications,Jboss7.x,Ejb 3.0,Netbeans 7,我在NetBeans中有一个企业应用程序,它由两个模块组成:测试ejb(ejb项目)和测试war(Web应用程序)。在web应用程序中,我有一个JSF页面,用于调用测试ejb中存在的托管bean的方法 内部register.xhtml: <h:commandButton id="register" value="Register" action="#{registrationBean.doRegister}" /> 这两个模块由NetBeans在JBoss 7.1 AS中自动部署。

我在NetBeans中有一个企业应用程序,它由两个模块组成:测试ejb(ejb项目)和测试war(Web应用程序)。在web应用程序中,我有一个JSF页面,用于调用测试ejb中存在的托管bean的方法

内部register.xhtml:

<h:commandButton id="register" value="Register" action="#{registrationBean.doRegister}" />
这两个模块由NetBeans在JBoss 7.1 AS中自动部署。当我运行web应用程序并单击“注册”按钮时,我会在浏览器上看到:

Target Unreachable, identifier 'registrationBean' resolved to null
我的问题是,如何调用RegistrationBean.java的方法,该方法驻留在与web应用程序不同的模块中

作为一种解决方案,我尝试在web应用程序的库中添加EJB模块的.jar文件,但没有任何帮助


提前谢谢你

这不是答案,但为什么
@ManagedBean
s不是EJB,因此如果您决定拆分EJB(这本身很好,但在war中作为jar提供),它们应该包含在war模块中。您是对的。我应该将RegistrationBean放在war模块中。但是,注册Bean仍然需要与ejb模块中的其他ejb“对话”,并且应该这样做。您应该能够简单地将您的EJB bean注入(使用
@EJB
@inject
)到
@ManagedBean
中。我尝试使用@EJB和@inject,但在部署war时遇到一个错误:“没有找到具有'com.testpackage.RegistrationManagerBean'类型接口的EJB。”。RegistrationManagerBean是我想要调用的EJB。有什么想法吗?
Target Unreachable, identifier 'registrationBean' resolved to null