Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to load EJB module

Tags:

java

glassfish

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

  • META-INF/MANIFEST.MF
  • WEB-INF/classes
  • WEB-INF/lib/primefaces-2.1.1.jar
  • WEB-INF/web.xml
  • index.shtml

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">

like image 670
jslamka Avatar asked Sep 13 '12 20:09

jslamka


1 Answers

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">
like image 61
rnsammeta Avatar answered Nov 24 '22 11:11

rnsammeta