【发布时间】:2015-06-22 09:33:43
【问题描述】:
一个众所周知的限制是您不应该在 EJB 中使用java.io 来访问文件系统。当在我的 ejb 应用程序中调用特定方法时,我需要创建一个文本文件并通过电子邮件发送它。
我需要一个架构解决方案,说明如何在没有using java.io 的情况下做到这一点。
我看到的唯一方法是为这项工作创建一个单独的 Web 服务。
还有一个建议使用 Apache camel,但我不知道骆驼如何帮助实现这一点。
【问题讨论】:
-
FWIW,EJB 3.2 规范将此限制更改为
An enterprise bean should exercise caution when using the Java I/O package to attempt to access files and directories in the file system.
标签: java jakarta-ee architecture ejb