Pregunta

I have an Enterprise Application in NetBeans comprising of 2 modules: test-ejb (EJB project) and test-war(Web application). In the web application I have a JSF page that makes a call to a method of a managed bean that exists in the test-ejb.

Inside register.xhtml:

<h:commandButton id="register" value="Register" action="#{registrationBean.doRegister}" />

The RegistrationBean.java is inside com.testpackage and has a method:

@ManagedBean
@RequestScoped
public class RegistrationBean {

    public String doRegister() {
        return "confirmation";
    }
}

Those two modules are automatically deployed by NetBeans in a JBoss 7.1 AS. When I run the web application and click the register button I get on my browser:

Target Unreachable, identifier 'registrationBean' resolved to null

My question is, how can I call a method of the RegistrationBean.java that resides in a different module than the web application.

As a solution I tried to add the .jar file of the EJB Module in the libraries of the web application, but it didn't help.

Thank you in advance!

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top