用于 GlassFish2.x Cargo 部署的设置资源
我正在尝试使用 Maven2 和 Cargo 对 GlassFish 2.x 项目进行集成测试。我终于让 Cargo 尝试部署我的 EAR,但由于未配置数据源,它无法启动。该应用程序还依赖于一些 JMS 队列和一个连接工厂 - 如何添加这些?
Cargo Glassfish 2.x 插件 表示不支持现有配置,所以我不能这样做。
使用 maven-glassfish-plugin 是一种选择,但我们也运行 OC4J,因此 Cargo 解决方案将是首选。
编辑:资源包括:1 个 JDBC 连接池、1 个 JDBC 资源、4 个 JMS 队列、2 个 JMS 连接工厂和一个自定义安全领域(梨树可选)。该领域需要在 login.conf 中添加一个条目,例如:
myRealm {
uk.co.mycom.MyGlassFishLoginModule required;
};
I'm trying to get integration testing working for a GlassFish 2.x project, using Maven2 and Cargo. I finally have Cargo attempting to deploy my EAR but it fails to start because the data source is not configured. The app also depends on a few JMS queues and a connection factory - how do I add these?
The Cargo Glassfish 2.x plugin says existing configurations are not supported, so I can't do that.
Using the maven-glassfish-plugin is an option, but we also run OC4J so a Cargo solution would be preferred.
edit: The resources are: 1 JDBC connection pool, 1 JDBC resource, 4 JMS queues, 2 JMS connection factories and a custom security realm (pear tree optional). The realm needs an entry in the login.conf like:
myRealm {
uk.co.mycom.MyGlassFishLoginModule required;
};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定(我从未使用过这个),但是 IIRC,您应该能够将数据源配置放在
sun-resources.xml
文件中并将其打包在 < EAR 中的 code>META-INF/sun-resources.xml 和 GlassFish 应该在部署时创建资源。下面是一个
sun-resources.xml
示例:尝试一下。
资源
我不知何故错过了您想要创建除数据源之外的其他资源,并且我看到多个线程报告建议的方法不适用于任何资源(如 JMS 资源)的 GlassFish v2。我的不好。
因此,鉴于当前状态,您的选择是(IMO):
我没有任何更好的建议。
I'm not sure (I never used this) but IIRC, you should be able to put your datasource configuration in a
sun-resources.xml
file and package it underMETA-INF/sun-resources.xml
in your EAR and GlassFish is supposed to create the resources at deploy time.Here is an example
sun-resources.xml
:Give it a try.
Resources
I somehow missed that you wanted to create other resources than Datasources and I've seen several threads reporting that the suggested approach won't work with GlassFish v2 for any resources (like JMS resources). My bad.
So, given the current state, your options are (IMO):
I don't have any better suggestions.