首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >org.omg.stub.java.rmi._Remote_Stub不兼容

org.omg.stub.java.rmi._Remote_Stub不兼容
EN

Stack Overflow用户
提问于 2014-07-22 18:35:58
回答 1查看 2.1K关注 0票数 1

我按照这个指南http://jonas.ow2.org/doc/JONAS_5_1_7/doc/doc-en/html/ejb3_programmer_guide.html来学习如何编写EJB3.0,但是我被2.3. Writing the Client Code这一章卡住了。

我使用的是RAD 8.5和WAS 7.0。我创建了EJB项目和会话bean,但是当我运行客户端时(即在相同的项目和bean的EAR中),我总是得到这样的错误:

代码语言:javascript
运行
复制
22-lug-2014 12.33.15 null null
WARNING: WSVR0072W
22-lug-2014 12.33.15 null null
WARNING: WSVR0072W
22-lug-2014 12.33.15 null null
WARNING: WSVR0072W
22-lug-2014 12.33.15 null null
WARNING: WSVR0072W
22-lug-2014 12.33.15 null null
INFO: Client code attempting to load security configuration
Exception in thread "P=194786:O=0:CT" java.lang.ClassCastException: org.omg.stub.java.rmi._Remote_Stub incompatible with HelloWorldInterface
    at Client.main(Client.java:26)

我尝试了几种解决方案,但都没有结果。有关于如何解决这个错误的想法吗?

EN

回答 1

Stack Overflow用户

发布于 2014-09-27 17:18:35

在java main或JUnit上下文中,您必须使用createEJBStubs.bat生成EJB3存根。我正在使用ANT task为我生成它...

was.home - WAS安装的根目录

locationName - EAR文件的位置

代码语言:javascript
运行
复制
<target name="export_ear">
    <earExport earProjectName="MyProject" earExportFile="${locationName}/MyProject.ear" exportSource="false" overwrite="true"/> 
</target>

<target name="createStubs" depends="export_ear">
    <exec executable="${was.home}/bin/createEJBStubs.bat">
        <arg line="${locationName}/MyProject.ear" />
    </exec>
</target>

生成存根后,必须从MyProject.ear中提取MyProject.jar和MyProjectClient.jar,并将它们包含到构建路径中。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24885058

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档