[英]Unable to load EJB module
I am taking a course in Enterprise Application Development. 我正在参加企业应用程序开发课程。 I am new to JSF.
我是JSF的新手。 I am trying to deploy my app using Glassfish 3.1 using JSF and Netbeans IDE.
我正在尝试使用GlassF 3.1使用JSF和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. 以下是我对EJB的引用。
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. 编辑:这是一个Java Web应用程序。
EDIT WAR FILE STRUCTURE TREE 编辑战争文件结构树
My file does not have an EJB tag in teh xhtml document. 我的文件在teh xhtml文档中没有EJB标记。 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. 将web.xml
web-app
属性版本更改为2.5
或更高版本可解决此问题。
Updated web-app element of web.xml will be, 更新了web.xml的 web-app元素,
<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">
So you have web application, it's not ejb-jar, it's web module that sould be packeged to *.war
archive. 所以你有web应用程序,它不是ejb-jar,它的web模块可以打包到
*.war
存档。
Structure should be 结构应该是
example of sun-web.xml
sun-web.xml
示例
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
<sun-web-app>
<context-root>/app</context-root>
</sun-web-app>
if you are using Maven
, you can use maven-war-plugin
如果你使用的是
Maven
,你可以使用maven-war-plugin
Turns out the issue was a typo in a SQL statement (1 and l [lower case L]) and I needed to do a "Clean and build" on the project. 原来问题是SQL语句中的拼写错误(1和l [小写L]),我需要对项目进行“清理和构建”。 Thank you for those who put effort into helping me solve my issue.
感谢那些努力帮助我解决问题的人。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.