I am taking a course in Enterprise Application Development. I am new to JSF. I am trying to deploy my app using Glassfish 3.1 using JSF and Netbeans IDE.
The error I get is listed below.
Error occurred during deployment: Exception while preparing the app : Unable to load the EJB module. DeploymentContext does not contain any EJB. Check the archive to ensure correct packaging for F:\Seagate\docs backup\NetBeansProjects\ent-app-dev\Slamka_Project1\build\web.
If you use EJB component annotations to define the EJB, and an ejb or web deployment descriptor is also used, please make sure that the deployment descriptor references a Java EE 5 or higher version schema, and that the metadata-complete attribute is not set to true, so the component annotations can be processed as expected. Please see server.log for more details.
Below are the references to EJB I have made.
import javax.ejb.LocalBean;
import javax.ejb.Stateless;
import javax.ejb.EJB;
@EJB
Any help would be appreciated.
EDIT: This is a Java Web Application.
EDIT WAR FILE STRUCTURE TREE
My file does not have an EJB tag in teh xhtml document. it has what is listed below.
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:c="http://java.sun.com/jsf/core">
Changing the web.xml web-app
attribute version to 2.5
or higher resolved this issue.
Updated web-app element of web.xml will be,
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With