将 MySql 的连接器/j 包含在 EAR 文件中:Glassfish
我们希望通过将 MySql 连接器/j jar 作为 EAR 的一部分来简化应用程序的部署过程。 (因此我们不需要手动将其复制到 Glassfish 服务器的 /lib 文件夹中)
这可能吗?
更新:我们已经了解到,使用 JBoss 中的 SAR 文件可以实现这一点,但我们认为在 Glassfish 中不可用。
We want to simplify the deployment process of an app by including the MySql connector/j jar as part of the EAR. (so we won't need to manually copy it in the /lib folder of our Glassfish servers)
Is it possible?
UPDATE: We have read this is possible using the SAR files in JBoss, but we don't think it's available in Glassfish.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 Glassfish 中的类加载器层次结构,我认为这是不可能的。 mysql 驱动程序 jar 需要在应用程序的类加载器之外可用,因为连接池是全局可用的。
http://download.oracle .com/docs/cd/E19226-01/820-7695/6niugesfp/index.html#indexterm-28
据我所知发现,Glassfish 不支持 .sar 文件之类的东西:
http://old.nabble.com/Migration -From-jboss-4.2.1-to-GlassFish-td18629992.html
也许投票支持这个问题,或者创建您自己的类似 .sar 的部署选项:
http://java.net/jira/browse/GLASSFISH-16915
Because of the classloader hierarchy in Glassfish I don't think this is possible. The mysql driver jar needs to be available outside of your application's classloader because the connection pool is globally available.
http://download.oracle.com/docs/cd/E19226-01/820-7695/6niugesfp/index.html#indexterm-28
From what I can find, Glassfish doesn't support anything like .sar files:
http://old.nabble.com/Migrating-From-jboss-4.2.1-to-GlassFish-td18629992.html
Maybe vote for this issue, or create your own for a .sar-like deployment option:
http://java.net/jira/browse/GLASSFISH-16915