据我所知,无论何时通过外部访问存根,都需要createEJBstubs来创建存根。 Java客户端(http://www-01.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.doc/ae/rejb_3stubscmd2.html?lang=ko)。而且,创建的存根将用于模块中可用的EJB3接口。但是他们如何检测给定的接口/ bean是否为EJB 3类型而不是2. *。从我在下面面对的问题来看,我不清楚这种检测是如何完成的。请帮助我理解这一点,以便我能解决我所面临的问题(见下文) -
我的问题的详细解释:
当我运行createEJBStubs.bat C:\1\DEN\proj\target\proj.jar -updatefile C:\1\DEN\proj\target\proj.jar -verbose
我收到以下错误 -
CNTR9241I: The C:\1\DEN\proj\target\proj-5.DEV-SNAPSHOT.jar Java archive (JAR) file has no level 3.0 enterprise beans with remote interfaces.
当我使用-verbose
选项运行相同的命令时,我收到以下错误 -
createWarProcessingRootDir: enter
Root directory for war processing: C:\Users\w723521\AppData\Local\Temp\_tempWar_1096410607889881622
War explosion root: C:\Users\w723521\AppData\Local\Temp\_tempWar_1096410607889881622\warExpls
War primary input root: C:\Users\w723521\AppData\Local\Temp\_tempWar_1096410607889881622\warExpls\primary
War primary classpath root: C:\Users\w723521\AppData\Local\Temp\_tempWar_1096410607889881622\warExpls\primary\classPth
War primary workspace root: C:\Users\w723521\AppData\Local\Temp\_tempWar_1096410607889881622\warExpls\primary\wrkSpace
War alternate workspace root: C:\Users\w723521\AppData\Local\Temp\_tempWar_1096410607889881622\warExpls\alternate\wrkSpace
War alternate output file: C:\Users\w723521\AppData\Local\Temp\_tempWar_1096410607889881622\warExpls\alternateOutputWar.war
War embedded in ear root: C:\Users\w723521\AppData\Local\Temp\_tempWar_1096410607889881622\warExpls\embInEar
createWarProcessingRootDir: exit
Dumping input parameters:
parameter 1 = C:\1\DEN\proj\target\proj-5.DEV-SNA
PSHOT.jar
parameter 2 = -updatefile
parameter 3 = C:\1\DEN\proj\target\proj-5.DEV-SNA
PSHOT.jar
parameter 4 = -trace
Processing the C:\1\DEN\proj\target\proj-5.DEV-SNAPSHOT.jar input file.
checkEJBVersion - jar name is C:\1\DEN\proj\target\proj-5.DEV-SNAPSHOT.jar
The output file name is C:\Users\w723521\AppData\Local\Temp\ejb3093395338317385883.jar
copyArchiveEntriesAndStubs(null,C:\1\DEN\proj\target\proj-5.DEV-SNAPSHOT.jar,C:\Users\w723521\AppData\Local\Temp\ejb3093395338317385883.jar,false)
Main output archive file (no pre-existing stubs) is C:\Users\w723521\AppData\Local\Temp\ejb3093395338317385883.jar
Preexisting stubs archive file is ejb5694574801473018226.jar
Writing non-stub entry MANIFEST.MF
Writing non-stub entry TestLocal.class
Writing non-stub entry TestRemote.class
Classloader updated for -cp null
Classloader updated for jar C:\1\DEN\proj\target\proj-5.DEV-SNAPSHOT.jar
getMetaData - entry
metadataComplete setting is false
findRemoteInterfaces
List of interfaces are: null
Number of pre-existing stubs = 0
CNTR9241I: The C:\1\DEN\proj\target\proj-5.DEV-SNAPSHOT.jar Java archive (JAR) file has no level 3.0 enterprise beans with remote interfaces.
Starting process of deleting workspace files...
Done with process of deleting workspace files...
Command Successful
我无法理解为什么它说没有EJB3的本地和远程接口,即使使用EJB3注释创建的bean类
@Remote
public interface TestRemote {
public void test();
}
@Remote
public interface TestRemote {
public void test();
}
如果给定的接口是否为EJB3,脚本如何检测?(基于我获得的输出并不像我预期的那样清晰)
答案 0 :(得分:0)
proj-5.DEV-SNAPSHOT.jar需要以某种方式指定EJB及其远程接口。例如,如果使用ejb-jar.xml,则<session>
使用<remote>pkg.TestRemote</remote>
。再举一个例子,如果JAR中的某个类使用@Stateless
和@Remote(TestRemote.class)
进行注释。