Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 部署EAR时出现Glassfish异常_Java_Glassfish_Ear - Fatal编程技术网

Java 部署EAR时出现Glassfish异常

Java 部署EAR时出现Glassfish异常,java,glassfish,ear,Java,Glassfish,Ear,我有以下包结构:A,B,C,D,E,F A: Enterprise Application Project, includes B, C, D, E B: Basics for C, D C, D: Application modules E: JPA F: Web project 当我尝试在Glassfish上部署EAR文件时,会遇到以下异常: Error occurred during deployment: Exception while deploying the app [A] :

我有以下包结构:A,B,C,D,E,F

A: Enterprise Application Project, includes B, C, D, E
B: Basics for C, D
C, D: Application modules
E: JPA
F: Web project
当我尝试在Glassfish上部署EAR文件时,会遇到以下异常:

Error occurred during deployment: Exception while deploying the app [A] : Cannot resolve reference [Remote ejb-ref name=...Remote 3.x interface =...,ejb-link=null,lookup=,mappedName=,jndi-name=,refType=Session] because there are [3] ejbs in the application with interface .... Some of the possible causes: 1. The EJB bean class was packaged in an ear lib library (or through any other library mechanism which makes the library visible to all component modules), this makes all the component modules include this bean class indirectly. 2. The EJB bean class was packaged in a component module which references the EJB, either directly or indirectly through Manifest, WEB-INF/lib. The EJB bean class should only be packaged in the declaring ejb module and not the referencing modules. The referencing modules should only include EJB interfaces.. Please see server.log for more details. 
所有模块jar/war文件在EAR中只存在一次


有人提示您修复此问题吗?

似乎您正在使用一些打包在一起的重复类。。尝试打开EAR,查看错误消息中的类是否在所有这些ABCDE上重复。之后,尝试删除这些重复的类并再次部署,查看类名更改的错误是否已检查此项。整个EAR文件中似乎只有一个接口实现。(Eclipse:file search->workspace->“implements…”)我还解压缩了EAR文件并检查了实现类是否存在多次。我还解包了子包(jar,war)。因此,另一件要看的事情是,尝试检查错误消息中的这些类是否由glashfish加载,比如,它可能是您在项目中编译的JPA/hibernate类,并且这些类已经作为模块存在于glashfish上如果您使用maven,可能只是在编译时更改库的范围的问题