使用 Eclipse WTP 静态编织 EclipseLink
我有一个在 Eclipse WTP 中的 Tomcat 上运行的项目,该项目与一些 JPA 实体一起部署。我想在这些实体上启用 ChangeTracking,但这需要启用编织。由于 Tomcat 不允许动态编织,因此我需要使用静态编织来完成此操作。
这可能吗? Eclipse 的 Dali 插件似乎没有任何静态编织的功能。
I've got a project running on Tomcat within Eclipse WTP that deploys with some JPA entities. I would like to enable ChangeTracking on these entities, but this requires enabling weaving. Since Tomcat doesn't allow for dynamic weaving, I need to do this with static weaving.
Is this possible? Eclipse's Dali plugin doesn't seem to have any facility for static weaving.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,很可能我一直都这样做。另外,我在 Eclipse WTP 中使用 Jetty(J2EE 预览版),它速度非常快并且运行良好,但在编织方面。创建一个 ant 可以处理的 weave.xml 文件,如下所示:
将其放入项目根目录中并将其作为 Ant 任务执行。确保完成后刷新项目,因为实体的所有 .class 文件都将被编织。我实际上将此任务链接到 eclipse 构建过程,因此它是自动的。您可能需要修改项目的 ant 脚本中的一些文件路径才能使其正常工作,但您应该明白了。我的 antlib 中有 servlet.jar (我不记得为什么),我的 WEB-INF/lib 中有我所有的 Web 项目 jar 以及 eclipselink。
Yes, very possible I do this all the time. Also I use Jetty (J2EE Preview) in Eclipse WTP it's very fast and works well, on to the weaving though. Make a weave.xml file that ant can handle like this:
Put this in your project root and execute it as an Ant Task. Make sure you refresh your project when done since all the .class files for your entities will be weaved. I actually link this task to the eclipse build process so it's automatic. You might need to modify some of the file paths in the ant script for your project to get it to work, but you should get the idea. My antlib has servlet.jar in it (I don't remember why) and my WEB-INF/lib has all my web project jars as well as eclipselink.