New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding security-domain and insert database on local jboss setup #1

quangtin3 opened this Issue Dec 27, 2013 · 1 comment


None yet
2 participants

quangtin3 commented Dec 27, 2013

Before we can running this extjs-rest-java-hibernate application on local jBoss, some works need to be done:

Setup DataSource

  • Create MySQL driver Module
  • Prepare an user on MySQL database with: src/main/resources/import.sql
  • Create datasource, for example in your jBoss's standalone.xml add:
    <datasource jndi-name="java:jboss/datasources/MysqlDS" pool-name="extjsDS" enabled="true" use-java-context="true">
        <driver name="mysql" module="com.mysql">

Add security domain, again, in your jBoss's standalone.xml add security domain as following:

<security-domain name="ExtjsMVCTemplateRealm" cache-type="default">
        <login-module code="Database" flag="required">
            <module-option name="dsJndiName" value="java:jboss/datasources/MysqlDS"/>
            <module-option name="principalsQuery" value="select password from user where username=?"/>
            <module-option name="rolesQuery" value="select role.rolename, 'Roles' from role, userrole where = userrole.roles_id and userrole.users_username=?"/>
            <module-option name="hashAlgorithm" value="MD5"/>
            <module-option name="hashEncoding" value="hex"/>

This comment has been minimized.

Show comment
Hide comment

endriju commented Dec 27, 2013

Thank you very much!
I linked to the issue from our website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment