如何将 ejb2 无状态会话 Bean 逐步迁移到 ejb3?
EJB3 规范表明 EJB2 和 EJB3 可以在单个应用程序中共存。
我希望将我的 EJB2 无状态会话 Bean 迁移到 EJB3 无状态会话 Bean。
这个问题根本与JPA无关(这是将来要进行的一项单独的工作)
我正在websphere 6.1上运行,安装了EJB3功能包并打了补丁,并且配置文件得到了增强(一个ejb3示例应用程序)确认它有效)
我需要对我的代码、web.xml、application.xml、ejb-jar.xml 和其他 websphere 特定绑定进行哪些更改才能将 SINGLE ejb 从 2 转换为 3?
The EJB3 spec indicates that EJB2 and EJB3 can co-exist in a single application.
I wish to migrate my EJB2 stateless session beans to EJB3 stateless session beans.
This question does not relate to JPA at all (that is a separate piece of work to be carried out in the future)
I'm running on websphere 6.1 with the EJB3 feature pack installed and patched and the profile is augmented (an ejb3 sample app confirms that it works)
What changes do I need to make to my code, web.xml, application.xml, ejb-jar.xml and other websphere specific bindings to convert a SINGLE ejb from 2 to 3?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我将在继续的过程中尝试回答我自己的问题。
以下是我的解决方法
以下 xml 文件过去具有文档类型,但现在必须具有命名空间:
myApp.ear/META-INF/application.xml< /strong>
myApp.ear/web.war/WEB-INF/web.xml
myApp.ear/ejb.jar/META-INF/ejb-jar.xml
< strong>对 web.xml 进行了以下更改
taglib 元素现在位于 jsp-config 元素下
显示名称元素已从过滤器元素中删除
和 servlet 元素
删除 myApp.ear/ejb.jar/META-INF/ibm-ejb-jar-bnd.xmi
JNDI 查找
更改所有本地 ejb jndi 查找以使用 ejblocal:[classname]
我还从 ejb-jar.xml 映射中删除了 jdbc 资源引用,并使用全局查找
我遇到的安全问题是因为我删除了 ibm-application-bnd .xmi 将用户和组绑定到角色/
I'm going to have a crack at answering my own question as I go along.
Here's how I got through it
The following xml files used to have doctypes, but must now have namespaces:
myApp.ear/META-INF/application.xml
myApp.ear/web.war/WEB-INF/web.xml
myApp.ear/ejb.jar/META-INF/ejb-jar.xml
The following changes have been made to web.xml
taglib elements are now under a jsp-config element
the display-name element has been removed from filter elements
and servlet elements
Remove myApp.ear/ejb.jar/META-INF/ibm-ejb-jar-bnd.xmi
JNDI lookups
change all your local ejb jndi lookups to use ejblocal:[classname]
I also removed my jdbc resource ref from ejb-jar.xml mappings and am using a global lookup instead
The security problem I was having was because I removed ibm-application-bnd.xmi where it binds users and groups to roles/
您需要将 Java EE xml 命名空间放入您提到的三个 xml 文件中。 然后我认为您删除了 WAS 绑定文件并使用不同的 jndi 查找
You need to put Java EE xml namespaces in the three xml files you mentioned to start with. Then I think you remove your WAS binding files and use a different jndi lookup