我正在使用EJB jakarta ee9.1 glassfish服务器6.2.5和java17制作一个示例应用程序,但在运行时,一旦添加EJB,我就会看到以下异常。
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.
我检查了我的web.xml,可以看到我使用的是正确的webappschema(5(,元数据complete被明确设置为false。
我可以看到很多人都经历过同样的错误,但大多数情况都与无效的web.xml有关,但在我的情况下,web.xml是正确的有人能提出建议吗。
您正在使用注释和web.xml进行EJB配置。通常,由于很长一段时间以来,只使用注释,而不是web.xml中的定义。
web.xml可以用于EJB配置之外的其他目的。但不看就很难说。
最后,我理解了ejb工件的输出布局错误地指向WEB-INF目录的问题。现在我把它指向模块输出,它就开始工作了。