To test it:
mvn clean package tomee:run
A datasource is defined in tomee.xml:
<Resource id="myDataSource" type="DataSource" /> <!-- standard properties -->
Then this datasource is referenced in server.xml:
<Realm className="org.apache.catalina.realm.DataSourceRealm" dataSourceName="myDataSource" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name"/>
To initialize the datasource (for the test) we used the TomEE hook which consists in providing
a file import-
Go to http://localhost:8080/realm-in-tomee-1.1.0-SNAPSHOT/, then connect using the login/password tomee/tomee. You should see "Home".
svn co http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/realm-in-tomee cd realm-in-tomee mvn clean install
All edits are reviewed before going live, so feel free to do much more than fix typos or links. If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it. Don't be surprised if we like it so much we ask you for help with other pages :)NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.