-
1. Re: How to automatically create data sources and security domains with deployment descriptors?
emmartins Mar 26, 2014 3:15 PM (in response to shinzey)1 of 1 people found this helpfulThe Java EE 7 specification (EE.5.18.3) allows you to create Datasources in the standard web, ejb and application XML descriptors, through <datasource/>, or you may use instead the DatasourceDefinition annotation.
Wrt security domains, I may be wrong, but I think there is no such feature, but perhaps using WildFly's CLI in non-interactive mode serves the purpose?
-
2. Re: Re: How to automatically create data sources and security domains with deployment descriptors?
shinzey Mar 27, 2014 4:08 AM (in response to emmartins)Thanks for the tip, Eduardo! The <data-source> tag in web.xml works, but it's strange that the created data source is invisible from admin console.
For security domain, I found JBoss 6 already have this feature with jboss-beans.xml:
Chapter 7. Dynamic Security Domains
And WildFly 8 also declares to support that:
Although AS 7 no longer uses service-style descriptors, the container supports these service-style deployments without change where possible. This means that if you used jboss-service.xml or jboss-beans.xml deployment descriptors in your AS5/AS6 application, they should run with little or no modification in AS 7. (Not sure why it's still using AS 7...)
However when I add a jboss-beans.xml to WEB-INF, an error occurs:
Unexpected element '{urn:jboss:bean-deployer:2.0}application-policy' encountered
Changing application-policy to security-domain doesn't help.
Does WildFly no longer support boss-beans.xml? Is there any replacement?
-
3. Re: Re: How to automatically create data sources and security domains with deployment descriptors?
emmartins Mar 27, 2014 7:01 AM (in response to shinzey)1) Only datasources in the server configuration will show in the admin console.
2) I think the support for jboss-beans.xml deployments is limited to creation of legacy beans. Can you share the GF XML descriptor? Maybe there is something else that provides the functionality you need.
-
4. Re: How to automatically create data sources and security domains with deployment descriptors?
shinzey Mar 27, 2014 9:28 AM (in response to emmartins)I did a double check and found GF deployment descriptors support only data sources, no security realms. Sorry for the mistake.
I've created a feature request for dynamic security deployment:
[WFLY-3179] Dynamic Deployment of Security Domain - JBoss Issue Tracker
-
5. Re: How to automatically create data sources and security domains with deployment descriptors?
emmartins Mar 28, 2014 4:00 AM (in response to shinzey)You should be able to use jboss-cli in non interactive mode to configure the security domain before deploying. See Management Clients - WildFly 8 - Project Documentation Editor