<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2902796171332551349</id><updated>2024-10-04T19:38:08.988-07:00</updated><category term="clustering and load balancing"/><category term="security in JBOSS"/><category term="Database Connectivity in JBOSS"/><category term="Getting Started"/><category term="ejb"/><title type='text'>A-Z jboss </title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-1813711598913949554</id><published>2012-10-14T23:58:00.003-07:00</published><updated>2012-10-24T08:51:49.873-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database Connectivity in JBOSS"/><title type='text'>Implement XA-Datasource in JBOSS </title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
We have created a sample app which transfers money between
two bank account databases. This task is fulfilled by an ejb method.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Lets called first bank as Akila and the other banks as Sithum. We need to create two different databases for two different banks. then we need two create two different data source as describe&amp;nbsp;&lt;a href=&quot;http://jbossas5.blogspot.com/2012/10/data-source-file-in-jboss.html&quot;&gt;earlier&lt;/a&gt;. But in this case, we used XA-datasource. So lets start implement our sample application.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
First we are going to create two datasources for two banks called akila-ds.xml and sithum-ds.xml. I am going to show only one -ds.xml file. But you have to do is, you can change jndi name only.&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;datasources&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xa-datasource&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;jndi-name&amp;gt;jdbc/akilads&amp;lt;/jndi-name&amp;gt;&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xa-datasource-property
name=&quot;URL&quot;&amp;gt;jdbc:mysql://localhost:3306/mazhar_db&amp;lt;/xa-datasource-property&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;xa-datasource-class&amp;gt;com.mysql.jdbc.jdbc2.optional.MysqlXADataSource&amp;lt;/xa-datasource-class&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;user-name&amp;gt;root&amp;lt;/user-name&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;password&amp;gt;&amp;lt;/password&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;track-connection-by-tx&amp;gt;true&amp;lt;/track-connection-by-tx&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;exception-sorter-class-name&amp;gt;org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter&amp;lt;/exception-sorter-class-name&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;valid-connection-checker-class-name&amp;gt;org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker&amp;lt;/valid-connection-checker-class-name&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;min-pool-size&amp;gt;1&amp;lt;/min-pool-size&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;max-pool-size&amp;gt;10&amp;lt;/max-pool-size&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;idle-timeout-minutes&amp;gt;10&amp;lt;/idle-timeout-minutes&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;metadata&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;type-mapping&amp;gt;mySQL&amp;lt;/type-mapping&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/metadata&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xa-datasource&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Above file contains the data source for akila_db.&amp;nbsp; By editing jndi name and the URL we can
create a data source file for the other bank. Main difference of this file with
the previous datasource file is that this contains ‘xa-datasource’ instead of
‘local-tx-datasource’. We need ‘xa-datasource’ here because we have to handle a
transaction between two databases. Don’t forget to begin the jndi name with
‘jdbc/’ .&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In order to make a ‘mysql jdbc connection’ with ‘jboss’ we
have to copy and paste ‘mysql-connector-java-5.1.13-bin.jar’ in
jbossas/server/xxx/lib folder.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now we need to do some coding in our application. So create a new enterprise application. Then go to ejb and write down following code.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Context initCnt = new InitialContext ();&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
DataSource ds = (DataSource)
initCnt.lookup(&quot;java:jdbc/&quot;+from+&quot;bankds&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Then we have to create a database
connection and make use of it.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
ds.getConnection().createStatement().executeUpdate(&quot;Update
user_amount set amount=amount-&quot;+amount+ &quot; WHERE
user=&#39;&quot;+user1+&quot;&#39;&quot;);&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This ‘getConnection()’ method gets
a connection from connection pool and releases it as configured. Connection
pool is created by the ‘-ds.xml’ file definition.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In addition to this we have to
handle some sql exceptions.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Not only the ejb but also the
web.xml file should be modified to make database connections. Add this code
inside the ‘&amp;lt;webapp&amp;gt;’ tag&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;resource-ref&amp;gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;description&amp;gt;Oracle
Datasource&amp;lt;/description&amp;gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;res-ref-name&amp;gt;jdbc/mazhards&amp;lt;/res-ref-name&amp;gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;res-type&amp;gt;javax.sql.DataSource&amp;lt;/res-type&amp;gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;res-auth&amp;gt;Container&amp;lt;/res-auth&amp;gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;/resource-ref&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;resource-ref&amp;gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;description&amp;gt;Oracle
Datasource&amp;lt;/description&amp;gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;res-ref-name&amp;gt;jdbc/zaheerds&amp;lt;/res-ref-name&amp;gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;res-type&amp;gt;javax.sql.DataSource&amp;lt;/res-type&amp;gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;res-auth&amp;gt;Container&amp;lt;/res-auth&amp;gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;/resource-ref&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Finally following code should be added to the ‘jboss-web.xml
file’&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;lt;resource-ref&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;
&amp;lt;res-ref-name&amp;gt;jdbc/akilads&amp;lt;/res-ref-name&amp;gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;jndi-name&amp;gt;java:/mazhards&amp;lt;/jndi-name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;/resource-ref&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;resource-ref&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;res-ref-name&amp;gt;jdbc/sithumds&amp;lt;/res-ref-name&amp;gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;jndi-name&amp;gt;java:/zaheerds&amp;lt;/jndi-name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;/resource-ref&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Now open up your browser and do the&amp;nbsp;transaction.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=================================================&lt;br /&gt;
&lt;br /&gt;
So I know that i can write up to 140 characters in this box.&lt;br /&gt;
&amp;nbsp;http://bit.ly/RgNp89&lt;br /&gt;
=================================================&lt;br /&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/1813711598913949554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/implement-xa-datasource-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/1813711598913949554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/1813711598913949554'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/implement-xa-datasource-in-jboss.html' title='Implement XA-Datasource in JBOSS '/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-3682142929966470345</id><published>2012-10-14T23:22:00.002-07:00</published><updated>2012-10-14T23:22:35.118-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database Connectivity in JBOSS"/><title type='text'>Login module with database connectivity in JBOSS</title><content type='html'>We need to create a MySQL database to store usernames, passwords and rolls of users. So create a database called akila_db and create two tables called myuser and myuser_roles. Then add&amp;nbsp;following data to database.&lt;br /&gt;
&lt;br /&gt;
myuser table&lt;br /&gt;
&lt;b&gt;username&lt;/b&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;password&lt;/b&gt;&lt;br /&gt;
akila &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; akila&lt;br /&gt;
sithum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;sithum&lt;br /&gt;
&lt;br /&gt;
myuser_roles table&lt;br /&gt;
&lt;b&gt;username &amp;nbsp; &amp;nbsp;role&lt;/b&gt;&lt;br /&gt;
akila &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;admin&lt;br /&gt;
sithum &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; guest&lt;br /&gt;
&lt;br /&gt;
Then we have to edit login-config.xml in server/xxx/conf
folder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;application-policy name = &quot;akila_policy&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;authentication&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;login-module code =
&quot;org.jboss.security.auth.spi.DatabaseServerLoginModule&quot; flag =
&quot;required&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;module-option name =
&quot;unauthenticatedIdentity&quot;&amp;gt;guest&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;module-option name =
&quot;dsJndiName&quot;&amp;gt;java:/ifsds&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;module-option name = &quot;principalsQuery&quot;&amp;gt;SELECT password
FROM myuser WHERE username=?&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;module-option name = &quot;rolesQuery&quot;&amp;gt;SELECT role, &#39;Roles&#39;
FROM myuser_roles WHERE username=?&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/login-module&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/authentication&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;lt;/application-policy&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remaining things are similar to Basic authentication login module as we discussed earlier. So &lt;a href=&quot;http://jbossas5.blogspot.com/2012/10/basic-authentication-mechanism-in-jboss.html&quot;&gt;click here&lt;/a&gt;&amp;nbsp; find out about basic authentication login module.</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/3682142929966470345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/login-module-with-database-connectivity.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/3682142929966470345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/3682142929966470345'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/login-module-with-database-connectivity.html' title='Login module with database connectivity in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-4199239610469039967</id><published>2012-10-14T23:13:00.001-07:00</published><updated>2012-10-14T23:13:52.547-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Database Connectivity in JBOSS"/><title type='text'>Data source file in JBOSS</title><content type='html'>So far, we did not discuss about database connectivity. But in this article, we are going to discussed about database connectivity in JBOSS. In jboss we have three kind of data sources.&lt;br /&gt;
&lt;br /&gt;
1.&amp;lt;local-tx-datasource&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Identifies a data source that uses transactions, even distributed transactions&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;within the local application server, but&amp;nbsp;doesn&#39;t&amp;nbsp;use distributed&lt;br /&gt;
&amp;nbsp; &amp;nbsp; transactions among multiple application servers.&lt;br /&gt;
&lt;br /&gt;
2.&amp;lt;no-tx-datasource&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;Identifies a data source that&amp;nbsp;doesn&#39;t&amp;nbsp;use transactions. This option&lt;br /&gt;
&amp;nbsp; &amp;nbsp;isn&#39;t&amp;nbsp;shown in the example, but would appear in place of the&lt;br /&gt;
&amp;nbsp; &amp;lt;local-tx-datasource&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
3.&amp;lt;xa-datasource&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; Identifies a data source that uses distributed transaction among multiple&lt;br /&gt;
&amp;nbsp; application servers. This option isn’t shown in the example, but&lt;br /&gt;
&amp;nbsp; would appear in place of the &amp;lt;local-tx-datasource&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s see how we implement those&amp;nbsp;data sources&amp;nbsp;in our applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
With java applications we can make database connections by
adding ‘jdbc’ drivers.&amp;nbsp; There programmers
have to spend a lot of time in database connection management. Every time a
‘getConnection ()’ method is called a new database connection is created and it
may result in a connection bottleneck. ‘Jboss’ provides an efficient way for
database connection management. It is called connection pooling.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
A database is referenced from an enterprise application as a
data source. &amp;nbsp;Depending on whether the
database is accessed from web app or ejb configuration details differ.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
First of all we should create a data source file to be used
by the authentication method.&amp;nbsp; Name it as
akila-ds.xml and save it in server/xxx/deploy folder.&amp;nbsp; Add the below content to it. (-ds.xml is mandatory
here because the server identifies a data source file by that extension)&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;?xml version=&quot;1.0&quot;
encoding=&quot;UTF-8&quot;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;datasources&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;local-tx-datasource&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;jndi-name&amp;gt;akilads&amp;lt;/jndi-name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;connection-url&amp;gt;jdbc: mysql://localhost:3306/ifs_db&amp;lt;/connection-url&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;driver-class&amp;gt;com.mysql.jdbc.Driver&amp;lt;/driver-class&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;user-name&amp;gt;root&amp;lt;/user-name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;password&amp;gt;&amp;lt;/password&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;lt;validconnectioncheckerclassname&amp;gt;org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker&amp;lt;/valid-connection-checker-class-name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;min-pool-size&amp;gt;10&amp;lt;/min-pool-size&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;max-pool-size&amp;gt;100&amp;lt;/max-pool-size&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;metadata&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;type-mapping&amp;gt;mySQL&amp;lt;/type-mapping&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/metadata&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/local-tx-datasource&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;/datasources&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Latha; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Latha; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;Jndi name component
must contain the file name without ‘-’. (akila-ds.xml -&amp;gt; akilads)&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: Latha; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 115%;&quot;&gt;Here we are going to use MySQL database. Now we created the data source file. In next article, we will see how we use this file to&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 15px; line-height: 17px;&quot;&gt;achieve&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 115%;&quot;&gt;&amp;nbsp;Basic authentication login module with stored data in a database.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/4199239610469039967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/data-source-file-in-jboss.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/4199239610469039967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/4199239610469039967'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/data-source-file-in-jboss.html' title='Data source file in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-5613735195817028951</id><published>2012-10-14T22:48:00.004-07:00</published><updated>2012-10-14T22:48:58.411-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clustering and load balancing"/><title type='text'>Enable buddy replication in JBOSS</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;To
enable buddy replication you need to edit a configuration file in the nodes. Go
to following directory and open the jboss-cache-manager-jboss-beans.xml file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;{JBOSS_HOME}\server\node3\deploy\cluster\jboss-cache-manager.sar\META-INF\jboss-cache-manager-jboss-beans.xml&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then you
need to edit buddy replication mbean. Find the &amp;lt;property name=&quot;buddyReplicationConfig&quot;&amp;gt;
tag and set following tag to true in all the nodes within the cluster.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;lt;property
name=&quot;enabled&quot;&amp;gt;true&amp;lt;/property&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/5613735195817028951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/enable-buddy-replication-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/5613735195817028951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/5613735195817028951'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/enable-buddy-replication-in-jboss.html' title='Enable buddy replication in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-7307118786222639918</id><published>2012-10-14T22:48:00.000-07:00</published><updated>2012-10-14T22:48:10.172-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clustering and load balancing"/><title type='text'>Session Replication in JBOSS</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;We need
to edit some configuration files to achieve session replication. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;First go
to the application web.xml file then add &amp;lt;&lt;b&gt;distributable/&amp;gt; &lt;/b&gt;tag
inside the &lt;b&gt;&amp;lt;web-app&amp;gt;&lt;/b&gt; tag. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then
open the jboss-web.xml file and add following tag inside the &amp;lt;jboss-web&amp;gt;
tag.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;lt;replication-config&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;replication-trigger&amp;gt;SET_AND_NON_PRIMITIVE_GET&amp;lt;/replication-trigger&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;replication-granularity&amp;gt;SESSION&amp;lt;/replication-granularity&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;replication-field-batch-mode&amp;gt;true&amp;lt;/replication-field-batch-mode&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/replication-config&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then we
need to edit some configuration files in the server. So we need to add jvmroute
to server.xml file. Open the server.xml file located in {JBOSS_HOME}\server\node1\deploy\jbossweb.sar\server.xml.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Find
following tag.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;lt;Engine
name=&quot;jboss.web&quot; defaultHost=&quot;localhost&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then
change it as follows.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;lt;Engine
name=&quot;jboss.web&quot; defaultHost=&quot;localhost&quot;
jvmRoute=&quot;node1&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then
uncomment following tag in the server.xml file. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;lt;Valve
className=&quot;org.jboss.web.tomcat.service.sso.ClusteredSingleSignOn&quot;
/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Do these
changes for all the nodes of the cluster.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Now we completed session replication part also..&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Cheers.. :)&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/7307118786222639918/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/session-replication-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/7307118786222639918'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/7307118786222639918'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/session-replication-in-jboss.html' title='Session Replication in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-5360295982039498870</id><published>2012-10-14T22:46:00.000-07:00</published><updated>2012-10-14T22:46:04.745-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clustering and load balancing"/><title type='text'>Farming in JBOSS</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;We need not to copy the same ear file to all the nodes. There is a method call farming. So we can deploy to&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;only one server and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;automatically deploy to other nodes also. Go to a node and open farm folder&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;inside “all”&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;directory. Then paste into that folder. Then that project automatically deploy to other&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;nodes. Remember, we&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;we need to start all the servers to&amp;nbsp;achieve&amp;nbsp;this. Once start the servers, we can copy our ear file in to one&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&quot;farm&quot; folder inside one server.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif;&quot;&gt;Cheerss..!!!&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/5360295982039498870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/farming-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/5360295982039498870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/5360295982039498870'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/farming-in-jboss.html' title='Farming in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-3254045529169624563</id><published>2012-10-14T22:34:00.001-07:00</published><updated>2012-10-14T23:23:36.195-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clustering and load balancing"/><title type='text'>Testing cluster with three computers in JBOSS</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;First we
have to create a cluster with three nodes. One node means one machine. That all
three computers should be jboss installed. Then we need to start jboss with all
configuration and bind with computer IP address. Therefore open the command
prompt and go to the jboss bin directory. Then run following command.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Run.bat
–c all –b 192.168.1.140 –Djboss.messaging.ServerPeerID=1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;This
serverPeerId should be unique within a cluster. Since we have three computers
in our cluster, we need to start jboss with different peerIDs and corresponding
IP’s by running above code. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Now we
have created a cluster. Then we need to create a load balancer. So we need to
install apache http server on one of above three machine or separate machine.
We need not to install apache on every computers. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Go to
the following link to download apache http server. Then download and install
win32 MSI installer.&amp;nbsp; It is better not to
install inside program files. Because the is a space between “Program file”
directory. So in could be a problem. So create a new folder called apache
inside C drive and install into that folder. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;a href=&quot;http://httpd.apache.org/download.cgi#apache22&quot;&gt;http://httpd.apache.org/download.cgi#apache22&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;We are
going to use mod_jk.so connecter for load balancing. We have to download
mod_jk.so file from following link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;a href=&quot;http://www.alliedquotes.com/mirrors/apache/tomcat/tomcat-connectors/jk/binaries/windows/&quot;&gt;http://www.alliedquotes.com/mirrors/apache//tomcat/tomcat-connectors/jk/binaries/windows/&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;you need to download &lt;/span&gt;&lt;a href=&quot;http://www.alliedquotes.com/mirrors/apache/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.37-windows-i386-httpd-2.2.x.zip&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 11.0pt;&quot;&gt;tomcat-connectors-1.2.37-windows-i386-httpd-2.2.x.zip&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 11pt;&quot;&gt;. Because we used apache 2.2.22. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then
unzip the downloaded file and copy that mod_jk.so file into modules folder
inside apache installed directory. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then go
to the apache conf folder. Now create a file called mod_jk.conf and add
following code to that file.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #b8cce4; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;LoadModule
jk_module modules/mod_jk.so &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #b8cce4; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;JkWorkersFile
conf/workers.properties &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #b8cce4; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;JkShmFile
logs/mod_jk.shm &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #b8cce4; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;JkLogFile
logs/mod_jk.log &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #b8cce4; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;JkLogLevel
info &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #b8cce4; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;JkMount
/FarmTest-war/* loadbalancer&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Most
important part of above code is jkMount part. /FarmTest-war/* is the URL
pattern of the clustered resource. So you need to specify your clustered
resource here. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then
create another file called workers.properties inside the conf folder. This is
the file that we specify cluster details. Add following code to that file. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;#
Define list of workers that will be used&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # for mapping requests&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.list=loadbalancer,status&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Define Node1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # modify the host as your host IP or DNS
name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node1.port=8009&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node1.host=192.168.1.140&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node1.type=ajp13&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node1.lbfactor=1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node1.cachesize=10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Define Node2&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # modify the host as your host IP or DNS
name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node2.port=8009&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node2.host= 192.168.1.141&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node2.type=ajp13&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node2.lbfactor=1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node2.cachesize=10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;#define node3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;worker.node3.port=8009&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node3.host=192.168.1.142&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node3.type=ajp13&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node3.lbfactor=1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #worker.node1.local_worker=1 (1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.node3.cachesize=10&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Load-balancing behavior&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.loadbalancer.type=lb&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
worker.loadbalancer.balance_workers=node1,node2,node3&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; worker.loadbalancer.sticky_session=1&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then
open the httpd.conf file which located inside the conf folder. Then add
following line of code to the bottom of that file. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Include
conf/mod_jk.conf&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Now
restart the apache server.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Then
start all jboss nodes. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;We have created a load balancer
and cluster with three nodes. Now we need to deploy an application to the
cluster.&amp;nbsp; Create a small enterprise
application and deploy it with one machine. Then go to the deploy folder inside
the “all” folder. Now copy the application “war” file and paste it to the farm
folder inside the “all” folder.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;Now we deployed an application to
the cluster. Now open a web browser and go to following link. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;a href=&quot;http://192.168.1.140/FarmTest-war/yourServler&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;http://192.168.1.140/FarmTest-war/yourServler&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.5in; text-indent: -0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;This IP address is the IP address
of apache installed computer.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/3254045529169624563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/testing-cluster-with-three-computers-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/3254045529169624563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/3254045529169624563'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/testing-cluster-with-three-computers-in.html' title='Testing cluster with three computers in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-5594687877156587217</id><published>2012-10-14T21:53:00.001-07:00</published><updated>2012-10-14T21:53:42.045-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clustering and load balancing"/><title type='text'>Understanding Load balancing</title><content type='html'>&lt;br /&gt;
Imagine you have a retail web application running on a single application server&lt;br /&gt;
instance and that you average 10,000 customers a month. Your company decides to&lt;br /&gt;
run a TV advertisement and predicts that you may start getting 100,000 customers a&lt;br /&gt;
month. You’re tasked with making sure that the application can support this number&lt;br /&gt;
of users. In addition, your application needs to be highly available. To accomplish&lt;br /&gt;
these goals, you have to deploy multiple application server instances and balance&lt;br /&gt;
requests across them.&lt;br /&gt;
Load balancing is a way of balancing incoming load, or concurrent requests, across&lt;br /&gt;
multiple application server instances, making your applications scalable and highly&lt;br /&gt;
available. Scalability is a term used to describe the ability to make your application&lt;br /&gt;
handle more user load by adding hardware and/or creating redundant instances of&lt;br /&gt;
your application without having to change code. Load balancing can help scale your&lt;br /&gt;
application because you can add more servers for the load balancer to balance the&lt;br /&gt;
load across, increasing the amount of traffic your application can handle. High availability&lt;br /&gt;
is the ability to continue processing requests in the face of server failure.&lt;br /&gt;
&lt;br /&gt;
The load balancer acts as a single point of entry into an application environment&lt;br /&gt;
as well as a traffic director for requests.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKsBpir3209peiU0sSFlYC1x32m83LjcOHEqcXXQDUpOEroEgV5ZlJyjB5I1nTJOkWwgJC_8sYrfhu3yuojXuS04cd0pvmOnQPKm-F67vMdCyAz9BUyCB3dGvxr3ojPA51N5vYjsBX-bvf/s1600/cluster.gif&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKsBpir3209peiU0sSFlYC1x32m83LjcOHEqcXXQDUpOEroEgV5ZlJyjB5I1nTJOkWwgJC_8sYrfhu3yuojXuS04cd0pvmOnQPKm-F67vMdCyAz9BUyCB3dGvxr3ojPA51N5vYjsBX-bvf/s320/cluster.gif&quot; width=&quot;279&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TYPES OF LOAD BALANCERS&lt;br /&gt;
Load balancing can be done in two primary ways: with a hardware load balancer or&lt;br /&gt;
with a software load balancer. Hardware load balancers are typically more expensive&lt;br /&gt;
but are also more reliable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Load balancers typically make a single IP address for a cluster visible to clients. The&lt;br /&gt;
load balancer maintains a map of internal (or virtual) IP addresses for each machine&lt;br /&gt;
in the cluster. When the load balancer receives a request, it rewrites the header to&lt;br /&gt;
point to a particular machine in the cluster. If a machine in the cluster is removed or&amp;nbsp;fails, the&lt;br /&gt;
hardware load balancer has the ability to recognize the failure and avoid&lt;br /&gt;
routing requests to it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/5594687877156587217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/understanding-load-balancing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/5594687877156587217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/5594687877156587217'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/understanding-load-balancing.html' title='Understanding Load balancing'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKsBpir3209peiU0sSFlYC1x32m83LjcOHEqcXXQDUpOEroEgV5ZlJyjB5I1nTJOkWwgJC_8sYrfhu3yuojXuS04cd0pvmOnQPKm-F67vMdCyAz9BUyCB3dGvxr3ojPA51N5vYjsBX-bvf/s72-c/cluster.gif" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-2936745096897713243</id><published>2012-10-14T21:48:00.000-07:00</published><updated>2012-10-14T21:48:11.437-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clustering and load balancing"/><title type='text'>Understanding JBOSS Clustering</title><content type='html'>&lt;br /&gt;
Clustering is the act of running the same application on multiple application server&lt;br /&gt;
instances simultaneously with each application server being aware of the others in the&lt;br /&gt;
cluster. An application server that’s part of a cluster is known as a node. But just having&lt;br /&gt;
nodes aware of other nodes in a cluster isn’t interesting. The nodes in the cluster must&lt;br /&gt;
be able to communicate with each other to do something useful, such as replicating&lt;br /&gt;
state or providing failover capabilities. Before we dive into the specifics of the clustering&lt;br /&gt;
features that JBoss offers, let’s examine some of the fundamental concepts behind&lt;br /&gt;
clustering. And, because you can’t seem to talk about clustering without talking about&lt;br /&gt;
load balancing, let’s start with that.</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/2936745096897713243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/understanding-jboss-clustering.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/2936745096897713243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/2936745096897713243'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/understanding-jboss-clustering.html' title='Understanding JBOSS Clustering'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-4173068340519207187</id><published>2012-10-14T21:47:00.000-07:00</published><updated>2012-10-14T21:47:22.677-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="clustering and load balancing"/><title type='text'>Introduction to jboss clustering and load balancing</title><content type='html'>&lt;br /&gt;
A single JBoss server can handle several hundred concurrent requests; but, if your&lt;br /&gt;
application has to scale to support multiple thousands of concurrent requests or&lt;br /&gt;
multiple millions of requests a day, then a single application server probably won’t&lt;br /&gt;
do the trick. JBoss enables you to simultaneously run your application on multiple&lt;br /&gt;
application servers. Requests going to your application can then be balanced across&lt;br /&gt;
these servers, and your application can also withstand individual server failures.&lt;br /&gt;
This deployment architecture allows you to achieve maximum scalability with minimal&lt;br /&gt;
downtime. Clients need not know that their different requests may be handled&lt;br /&gt;
by different servers.&lt;br /&gt;
Java EE doesn’t specify any standards for how clustering services should work.&lt;br /&gt;
Every application server implements clustering differently and provides a different&lt;br /&gt;
set of clustering capabilities and services. Red Hat has set out to make cluster setup&amp;nbsp;a simple task. As you’ll learn in this chapter, clusters are easy to create in JBoss and&lt;br /&gt;
require minimal configuration. Adding nodes requires no administrative management&lt;br /&gt;
because nodes detect each other automatically over network protocols. JBoss&lt;br /&gt;
also provides a sophisticated distributed cache that allows stateful components to replicate&lt;br /&gt;
their states across multiple nodes in a cluster, enabling you to easily develop&lt;br /&gt;
fault-tolerant applications, with very little code.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirR236Fovo5cwVUjawb_VgeOIUKjRyHxtc3iPfXvoz44InrYvdvdNo6A4dpDQhNcwzst1_P4XycW51amADfwpmSPZ1-_goLGiisP_bxtIcXIW7ZVe1VypP42IX-UC20BsOqv0IrXVSO-00/s1600/image2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirR236Fovo5cwVUjawb_VgeOIUKjRyHxtc3iPfXvoz44InrYvdvdNo6A4dpDQhNcwzst1_P4XycW51amADfwpmSPZ1-_goLGiisP_bxtIcXIW7ZVe1VypP42IX-UC20BsOqv0IrXVSO-00/s320/image2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/4173068340519207187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/introduction-to-jboss-clustering-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/4173068340519207187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/4173068340519207187'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/introduction-to-jboss-clustering-and.html' title='Introduction to jboss clustering and load balancing'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirR236Fovo5cwVUjawb_VgeOIUKjRyHxtc3iPfXvoz44InrYvdvdNo6A4dpDQhNcwzst1_P4XycW51amADfwpmSPZ1-_goLGiisP_bxtIcXIW7ZVe1VypP42IX-UC20BsOqv0IrXVSO-00/s72-c/image2.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-7639010287246580799</id><published>2012-10-14T20:05:00.001-07:00</published><updated>2012-10-14T20:05:28.781-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security in JBOSS"/><title type='text'>Client cert authentication mechanism in JBOSS</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;This authentication mechanism is almost same as
mutual authentication. But there are some differences between those two
authentication mechanisms. In client cert authentication, we don’t have to
enter usernames and passwords. Web browser keeps server certificates and
verifies with certificate that the server sends at the beginning of a
conversation. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Let’s see how to implement client cert
authentication.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;We have to edit some configuration files to achieve
client cert authentication. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;First we have to change the web.xml in the
application. Add following authentication method within login-config tag. Other
tags are remaining same as the mutual authentication. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;lt;login-config&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;auth-method&amp;gt;CLIENT-CERT&amp;lt;/auth-method&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;realm-name&amp;gt;JBoss
JMX Console&amp;lt;/realm-name&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/login-config&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Go to following directory and open the server.xml
file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;C:\jboss\jboss-eap-5.1\jboss-as\server\default\deploy\jbossweb.sar&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Then find following tag and edit it as follows. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&amp;lt;Realm
className=&quot;org.jboss.web.tomcat.security.JBossWebRealm&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
certificatePrincipal=&quot;org.jboss.security.auth.certs.SubjectCNMapping&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
allRolesMode=&quot;authOnly&quot;/&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Then create a security domain in login-config.xml as
follows.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;lt;application-policy
name=&quot;simple-security-domain&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;lt;authentication&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;login-module
code=&quot;org.jboss.security.auth.spi.BaseCertLoginModule&quot; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
flag=&quot;required&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module-option
name=&quot;password-stacking&quot;&amp;gt;useFirstPass&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module-option
name=&quot;securityDomain&quot;&amp;gt;java:/jaas/simple-security-domain&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/login-module&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;login-module
code=&quot;org.jboss.security.auth.spi.UsersRolesLoginModule&quot; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
flag=&quot;required&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module-option
name=&quot;password-stacking&quot;&amp;gt;useFirstPass&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module-option
name=&quot;usersProperties&quot;&amp;gt;props/cert-user.properties&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module-option
name=&quot;rolesProperties&quot;&amp;gt;props/cert-role.properties&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/login-module&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/authentication&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;lt;/application-policy&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;We need to create two new properties files inside
the props directory called cert-user.properties as cert-role.proerties. but the
names can be any names whatever you like. In this case, cert-user.properties
file should be empty.&amp;nbsp; Then open the
cert-role.properties file and following things to that file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Username=admin&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Username2=guest&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;This username has some special things. This username
should be same as the client certificate’s common name and the alias of client
certificate that saved in server.trustore. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Then go to jboss-web.xml file in the application add
security domain as discussed in early login module topics.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;After that we have to add mbean into jboss server.
This mbean is a service. So we have to add new xml file into following
directory. File name of that xml should be somename-service.xml. In my case,
the file name is jboss-service.xml.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;C:\jboss\jboss-eap-5.1\jboss-as\server\default\deploy
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Then add following code into the jboss-service.xml
file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;lt;mbean
code=&quot;org.jboss.security.plugins.JaasSecurityDomain&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
name=&quot;jboss.ch8:service=SecurityDomain&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;constructor&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;lt;arg
type=&quot;java.lang.String&quot; value=&quot;simple-security-domain&quot;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/constructor&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;attribute
name=&quot;KeyStoreURL&quot;&amp;gt;${jboss.server.home.dir}/conf/server.truststore&amp;lt;/attribute&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;attribute name=&quot;KeyStorePass&quot;&amp;gt;password&amp;lt;/attribute&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&amp;lt;/mbean&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;This password is the password for server.trustore. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;We have described about client.pfx files in mutual
authentication section. As described in that section, we have to import
client.pfx file into the browser. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Now we are done with the client-cert login.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/7639010287246580799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/client-cert-authentication-mechanism-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/7639010287246580799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/7639010287246580799'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/client-cert-authentication-mechanism-in.html' title='Client cert authentication mechanism in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-281879221892178516</id><published>2012-10-14T18:49:00.002-07:00</published><updated>2012-10-14T18:50:04.749-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security in JBOSS"/><title type='text'>Mutual authentication in JBOSS</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Run the commands below in the command prompt within
default\conf directory. Copy keytool.exe, all the files in openssl/bin folder.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;Create a self signed
client certificate&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;1).Create
private key:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #4f81bd; line-height: 115%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;openssl genrsa -des3
-out client.key 1024&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;2).Create a csr: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;openssl req -new -key client.key -out client.csr
–config openssl.cnf &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;3).Create the
client certificate: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin-left: .5in;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;openssl x509 -req -days 365 -in client.csr -signkey
client.key -out client.crt&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 4). Convert client.key to client.pem&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;openssl rsa -in client.key -out client.pem&lt;/span&gt;&lt;span style=&quot;line-height: 115%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5).&amp;nbsp;&lt;span style=&quot;background-color: white; line-height: 115%;&quot;&gt;Convert the certificate to .pfx&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;openssl pkcs12
-inkey client.pem -in client.crt -export -out&amp;nbsp;&amp;nbsp;&amp;nbsp;
client.pfx&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Go to internet explorer and import
client.pfx. You will have to provide the password which you introduced when
creating the pfx. &amp;nbsp;You can see it under
personal certificates. Then you can save the client.crt inside server.keystore
in default/conf.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Courier New;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/281879221892178516/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/mutual-authentication-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/281879221892178516'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/281879221892178516'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/mutual-authentication-in-jboss.html' title='Mutual authentication in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-8107490961321137006</id><published>2012-10-14T07:49:00.000-07:00</published><updated>2012-10-14T20:02:20.887-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security in JBOSS"/><title type='text'>Security certificates and authentication in JBOSS</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Before moving onto the client-cert authentication let’s have
a basic idea about public key certificates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In the previous authentication methods we could only encrypt
authentication details at the best case. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
That is insecure because an eavesdropper can read our
content easily if they have the tools. So the content should also be encrypted
as well. Server first sends its public key to the browser and browser encrypts
the content with that key and the server decrypts. Problem with this protocol
is that we don’t have the data source integrity. &amp;nbsp;Certification authorities are there to certify
the identity of web servers. &amp;nbsp;Browser can
verify that certificate with the available certificates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
The above mentioned authentication mechanism is called server
only authentication because only the identity of the server is specified. Note
that this authentication is done at the protocol level. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;First you have to find keytool.exe located at “C:\Java\jdk1.6.0_32\bin”
and copy it to “C:\jboss-eap-5.1\jboss-as\server\default\conf”.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Change your command line working directory to the above and
execute&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;keytool -genkey -alias serverCert -keyalg RSA
-validity 1500 –keystore server.keystore&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This command creates a server certificate which is valid for
1500 days and stores it in server.keystore.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
When you execute this you will be asked to fill some details
and add a password to the key store.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&amp;nbsp;Locate server.xml at “C:\jboss-eap-5.1\jboss-as\server\default\deploy\jbossweb.sar”
and include&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 10.0pt; line-height: 115%;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Connector
port=&quot;8443&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;scheme=&quot;https&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;secure=&quot;true&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;clientAuth=&quot;false&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;keystoreFile=&quot;${jboss.server.home.dir}/conf/server.keystore&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;keystorePass=&quot;serverpass&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;sslProtocol = &quot;TLS&quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Under an existing connector element.&amp;nbsp; For the keystoreFile attribute you must
provide the name of the key store you created before, to store server
certificates and keystorepass should be key store’s password.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Calibri, sans-serif; font-size: 11pt; line-height: 115%;&quot;&gt;&amp;nbsp;Add a transport
guarantee in the web.xml’s security constraint element.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;lt;user-data-constraint&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;nbsp;
&amp;lt;description&amp;gt;Require SSL&amp;lt;/description&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;nbsp;
&amp;lt;transport-guarantee&amp;gt;CONFIDENTIAL&amp;lt;/transport-guarantee&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;lt;/user-data-constraint&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This guarantees that even we connect to an insecure port we
are redirected to a secure port as specified in server.xml. You can either specify
an auth-method in the web.xml or not. Now you can open the URL in your browser
and see the http request is redirected to a port which handles https. &lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
In addition to the server you can also authenticate the
client. We have two type of mechanisms.. Those mechanisms will discussing in future articles.&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/8107490961321137006/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/client-cert-authentication-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/8107490961321137006'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/8107490961321137006'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/client-cert-authentication-in-jboss.html' title='Security certificates and authentication in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-1715523536004654412</id><published>2012-10-14T07:18:00.003-07:00</published><updated>2012-10-14T20:05:56.803-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security in JBOSS"/><title type='text'>Digest Authentication in JBOSS</title><content type='html'>&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;This authentication mechanism is almost same as the
basic authentication. But the different is, in basic authentication, we store
password as plaintext. In digest, we store password after encrypted using encryption
algorithm such as MD5. Let’s see how to create digest authentication login
module.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;First we have to change web.xml file. We have to add
following code instead of basic authentication code.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;lt;login-config&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;nbsp;
&amp;lt;auth-method&amp;gt;DIGEST&amp;lt;/auth-method&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;nbsp; &amp;lt;realm-name&amp;gt;
My Secure Content Authentication &amp;lt;/realm-name&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&amp;lt;/login-config&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;Then we should create new application policy for
digest authentication. So we have to edit&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
login-config.xml file. So add following application-policy to the
login-config.xml file.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;lt;application-policy
name=&quot;MyApp&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;authentication&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;login-module
code=&quot;org.jboss.security.auth.spi.UsersRolesLoginModule&quot;
flag=&quot;required&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;module-option
name=&quot;usersProperties&quot;&amp;gt;props/digest-users.properties&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;module-option
name=&quot;rolesProperties&quot;&amp;gt;props/digest-roles.properties&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;module-option
name=&quot;hashAlgorithm&quot;&amp;gt;MD5&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;module-option name=&quot;hashEncoding&quot;&amp;gt;rfc2617&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;module-option
name=&quot;hashUserPassword&quot;&amp;gt;false&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;module-option
name=&quot;hashStorePassword&quot;&amp;gt;true&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;module-option
name=&quot;passwordIsA1Hash&quot;&amp;gt;true&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;module-option
name=&quot;storeDigestCallback&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;org.jboss.security.auth.spi.RFC2617Digest&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;/login-module&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;lt;/authentication&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&amp;lt;/application-policy&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;According
to the application policy name, edit the security domain in jboss-web.xml. In
my case, security domain in MyApp.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Then
we should encrypt the password. Because we need to store encrypted password.
Then type following command. Then you will get encrypted password.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 115%;&quot;&gt;java –cp
C:\jboss\jboss-eap-5.1\jboss-as\common\lib\jbosssx-server.jar /
org.jboss.security.auth.spi.RFC2617Digest username &quot;Realm name&quot;
password&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Username= we have to give username &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Password=Real password &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;Realm name= the realm name that we
specify in web.xml.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; text-indent: 0.5in;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Finally you have to store the hashed password as opposed to
the plaintext password, in the users.properties file specified in the
application policy. roles.properties file&amp;nbsp;&amp;nbsp;
remains same as that of basic authentication implemented with
UserRolesLoginModule.&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/1715523536004654412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/digest-authentication.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/1715523536004654412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/1715523536004654412'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/digest-authentication.html' title='Digest Authentication in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-275504235191287554</id><published>2012-10-14T06:00:00.003-07:00</published><updated>2012-10-14T06:00:57.998-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security in JBOSS"/><title type='text'>Form Based authentication in JBOSS</title><content type='html'>&lt;br /&gt;
We discussed about basic authentication in JBOSS. Now we are going to discuss about form based authentication. As we discussed earlier, we have four types of authentication mechanisms.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
As the name suggests, credentials are taken from a user filled form.&amp;nbsp; In addition to the changes done above we have to add a login config element to the web.xml outside the security constraint element and inside web-app element. It should be noted that only one login config block should be there.&lt;o:p&gt;&lt;/o:p&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;login-config&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;auth-method&amp;gt;FORM&amp;lt;/auth-method&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;form-login-config&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;form-login-page&amp;gt;/login.jsp&amp;lt;/form-login-page&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;form-error-page&amp;gt;/loginfail.jsp&amp;lt;/form-error-page&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;/form-login-config&amp;gt;&lt;br /&gt;
&amp;lt;login-config&amp;gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
We have to create different jsp files, login.jsp, loginfail.jsp and logout.jsp.&amp;nbsp; We should add a login form in the body of login.jsp.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 10pt; line-height: 14px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;form method=&quot;post&quot; action=&quot;j_security_check&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&quot;text&quot; name=&quot;j_username&quot; /&amp;gt;&amp;lt;br/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&quot;password&quot; name=&quot;j_password&quot; /&amp;gt;&amp;lt;br/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=&quot;submit&quot; value=&quot;Login&quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;lt;/form&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
If the login is failed code in the loginfail.jsp will get executed.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;lt;%&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;String redirectURL = &quot;/Form-Base-Auth-war/FormServlet&quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; response.sendRedirect(redirectURL);&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;%&amp;gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;span style=&quot;color: #4f81bd;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
This code is written between jsp tags. In case of failure user is redirected to the login page. &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: #4f81bd; font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;I&lt;/span&gt;n the servlet we have given a link to logout.jsp.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;out.println(&quot;&amp;lt;br/&amp;gt;&amp;lt;a href=&#39;logout.jsp&#39;&amp;gt;logout&amp;lt;/a&amp;gt;&quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Following is the body of logout.jsp.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;lt;body&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session.invalidate();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;%&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;h1&amp;gt;Log Out successfully&amp;lt;/h1&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href=&quot;/Form-Base-Auth-war/FormServlet&quot;&amp;gt;home&amp;lt;/a&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/body&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;Other things are reamain unchanged as Basic authentication. We have to add security domain to the jboss-web.xml, need to create two properties files, need to add security constrains as basic authentication. If you miss it you can see&amp;nbsp;&lt;a href=&quot;http://jbossas5.blogspot.com/2012/10/basic-authentication-mechanism-in-jboss.html&quot;&gt;Basic authentication in JBOSS&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
Session is successfully invalidated in form-based authentication unlike basic authentication. This works in any browser.&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/275504235191287554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/form-based-authentication-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/275504235191287554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/275504235191287554'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/form-based-authentication-in-jboss.html' title='Form Based authentication in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-5912557239862527101</id><published>2012-10-14T05:54:00.002-07:00</published><updated>2012-10-14T05:54:41.423-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security in JBOSS"/><title type='text'>Basic authentication mechanism in JBOSS</title><content type='html'>&lt;br /&gt;
Name implies that this is the basic authentication mechanism type in JBOSS. When we trying to access to secured resource, then application will ask about username and password. If username and password are correct, then user can access to the resource. Lets see how to enable basic authentication for a resource.&lt;br /&gt;
&lt;br /&gt;
First create an enterprise application like earlier discussed. Then we have to do some configurations. So first open the web.xml file under configuration files of testApp-war. Then add following code within &amp;lt;web-app&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;security-constraint&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;web-resource-collection&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;web-resource-name&amp;gt;Admin Pages&amp;lt;/web-resource-name&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;url-pattern&amp;gt;/protected_resource/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;http-method&amp;gt;POST&amp;lt;/http-method&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;http-method&amp;gt;GET&amp;lt;/http-method&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/web-resource-collection&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;auth-constraint&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;description&amp;gt;Only allow users from following roles&amp;lt;/description&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&amp;lt;role-name&amp;gt;guest&amp;lt;/role-name&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;lt;role-name&amp;gt;admin&amp;lt;/role-name&amp;gt;&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&amp;lt;/auth-constraint&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;br /&gt;
&amp;lt;/security-constraint&amp;gt;&lt;br /&gt;
&amp;lt;login-config&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;auth-method&amp;gt;BASIC&amp;lt;/auth-method&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;lt;realm-name&amp;gt;My Secure Content Authentication&amp;lt;/realm-name&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;/login-config&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the URL pattern tag you have to specify the URL of the secured webpage. You can specify more than&lt;br /&gt;
one URL pattern. A URL pattern beginning with ‘/’ and ending with ‘/*’ specifies a path mapping and ‘*.’&lt;br /&gt;
Specifies an extension mapping. String containing only ‘/’ specifies default server while all other strings&lt;br /&gt;
denote the exact matches.&lt;br /&gt;
&amp;lt;role-name&amp;gt; is the allowed rolls for secured resource.&lt;br /&gt;
Then we have to edit jboss-web.xml file also. That config file also locate in the previous directory. Open the jboss-web.xml file and add following code inside &amp;lt;jboss-web&amp;gt; tag.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;security-domain&amp;gt;java:/jaas/test_policy&amp;lt;/security-domain&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to create a security domain in login-config.xml file which located under following directory.&lt;br /&gt;
&lt;br /&gt;
{JBOSS_HOME}\&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 18px;&quot;&gt;server\default\conf\login-config.xml&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 18px;&quot;&gt;Then add following application policy into login-config.xml&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;lt;application-policy name = &quot;testPolicy&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;authentication&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;login-module code=&quot;org.jboss.security.auth.spi.UsersRolesLoginModule&quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; flag = &quot;required&quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module-option name=&quot;usersProperties&quot;&amp;gt;props/&lt;span style=&quot;color: #c00000;&quot;&gt;testuser.properties&lt;/span&gt;&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;module-option name=&quot;rolesProperties&quot;&amp;gt;props/&lt;span style=&quot;color: #c00000;&quot;&gt;testrole.properties&lt;/span&gt;&amp;lt;/module-option&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/login-module&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/authentication&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #c6d9f1;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Times New Roman&amp;quot;,&amp;quot;serif&amp;quot;; font-size: 12pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/application-policy&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we need to create two more properties file to&amp;nbsp;achieve Basic authentication. Therefore go to following directory and create to properties files called testuser.properties and testrole.properties.&lt;br /&gt;
&lt;br /&gt;
{JBOSS_HOME}\&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 18px;&quot;&gt;server\default\conf\props&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 18px;&quot;&gt;then add following username names and passwords to testuser.properties file.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;, serif; font-size: 12pt; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;akila=akila&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;sithum=sithum&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;akila is the username and the password is akila.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;Then add following username with the role inside the testrole.properties file.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;akila=admin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;sithum=guest&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;akila is the username and admin is the role of akila.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;now we need to test basic authentication. So go to web browser and request to protected&amp;nbsp;resource. Now you will see a pop-up box that asking about user name and password like below. Then enter your username and password. Now you can access your protected resource.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ0z7eyX5En2na0gpm9zgmszX2QfpGDFp54ysDYLj6C3Fop68cHBiPQlFTvZjab5NpUBGW1gblnPmILYG64wQMZhkFs1ZsCk4gTagZ9JifEoXmuhjX9pQAw8DfLr8ZEVQu-gkBwdsQiLrq/s1600/BasicAuthentication.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;283&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ0z7eyX5En2na0gpm9zgmszX2QfpGDFp54ysDYLj6C3Fop68cHBiPQlFTvZjab5NpUBGW1gblnPmILYG64wQMZhkFs1ZsCk4gTagZ9JifEoXmuhjX9pQAw8DfLr8ZEVQu-gkBwdsQiLrq/s320/BasicAuthentication.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
:)&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/5912557239862527101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/basic-authentication-mechanism-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/5912557239862527101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/5912557239862527101'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/basic-authentication-mechanism-in-jboss.html' title='Basic authentication mechanism in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ0z7eyX5En2na0gpm9zgmszX2QfpGDFp54ysDYLj6C3Fop68cHBiPQlFTvZjab5NpUBGW1gblnPmILYG64wQMZhkFs1ZsCk4gTagZ9JifEoXmuhjX9pQAw8DfLr8ZEVQu-gkBwdsQiLrq/s72-c/BasicAuthentication.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-8183776698354610605</id><published>2012-10-14T05:49:00.000-07:00</published><updated>2012-10-14T05:50:20.750-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="security in JBOSS"/><title type='text'>Security in JBOSS</title><content type='html'>&lt;br /&gt;
We have discussed about how to create a simple enterprise application and how to deploy it into JBOSS server. In this article, we are going to discuss about how security&amp;nbsp;achieve from JBOSS. So I am going to discuss about&amp;nbsp;logging modules in jboss. Basically we have four logging modules. Those are,&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Basic authentication mechanism&lt;/li&gt;
&lt;li&gt;Form based authentication mechanism&lt;/li&gt;
&lt;li&gt;Digest authentication mechanism&lt;/li&gt;
&lt;li&gt;Client cert authentication mechanism&lt;/li&gt;
&lt;/ul&gt;
Those are the basic authentication mechanisms. Since next article, we are talking about those&amp;nbsp;mechanisms. </content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/8183776698354610605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/security-in-jboss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/8183776698354610605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/8183776698354610605'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/security-in-jboss.html' title='Security in JBOSS'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-3528451107069058091</id><published>2012-10-14T05:41:00.000-07:00</published><updated>2012-10-14T05:41:41.704-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ejb"/><category scheme="http://www.blogger.com/atom/ns#" term="Getting Started"/><title type='text'>Create Enterprise Application with JBOSS and Netbeans</title><content type='html'>&lt;br /&gt;
We have discussed about how install jboss and how to start jboss with netbeans in previous topics. We are going to discuss about how to create an enterprise application, how to create an EJB , how to call that EJB from a servlet and how to deploy that enterprise application into jboss server.&lt;br /&gt;
As the first step, lets see how to create an enterprise application in netbeans.&lt;br /&gt;
Open netbeans add go to file and click on New Project. Then click on JAVA EE and select Enterprise Application as show in figure below.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCn2Me5kv6hoiOpsKdYhGfIVgHDllSFhWuvstURu4tcXH4pBuL_X_CAVQjM8HFqrhDaPJLgXTtNn9aXC2Jh5EQDRpHIa-7oB7gftzczqo5wZZxOYb96o5OEHlKedhj3PzUGhitv4YSKt-q/s1600/Untitled.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;218&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCn2Me5kv6hoiOpsKdYhGfIVgHDllSFhWuvstURu4tcXH4pBuL_X_CAVQjM8HFqrhDaPJLgXTtNn9aXC2Jh5EQDRpHIa-7oB7gftzczqo5wZZxOYb96o5OEHlKedhj3PzUGhitv4YSKt-q/s320/Untitled.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then click next. After that add a name for your enterprise application and click next. Then select jboss-as as the server and select create EJB module and create web module tick buttons. Now click Finish. Now you will see three new nodes appear project tab.&lt;br /&gt;
Then we need to create an EJB. We are going to create stateless session bean in this example. My enterprise application name is &quot;test&quot;. Then you can see a node called &quot;test-ejb&quot; in the project tab. Right click on that tab and click session bean.&lt;br /&gt;
Now you will see a window like below. Give a suitable name to your session bean. Then&amp;nbsp;specify a package name. Then select stateless and local as shown below.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMv5qF-cF7boRCbUFCigKf1CuihSvB0WNqQGOtKaU-075i4XRqspIZ-jvdhDVLtb6LvQcUYM7S93hEsomx0tox7_xuJOm7GtU4DAfmeYhqB8qMyoQYvWUiOt0t0Z2plTYUNp_oqb8KPFoD/s1600/sessionBean.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMv5qF-cF7boRCbUFCigKf1CuihSvB0WNqQGOtKaU-075i4XRqspIZ-jvdhDVLtb6LvQcUYM7S93hEsomx0tox7_xuJOm7GtU4DAfmeYhqB8qMyoQYvWUiOt0t0Z2plTYUNp_oqb8KPFoD/s320/sessionBean.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&amp;nbsp;Now you will see two classes created under source&amp;nbsp;package-&amp;gt; ejb directory. click on&amp;nbsp;testSessionBean.java &amp;nbsp;and right click on work area and select add business method as shown in the following figure.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuO7z41MmfMeIDz1gTsNRsGCJ97gSghLkuXDtomm1_Urs5ARn_FeYnE1zn9aNwTlgYsjyTVxajXAS7uALj5HDCWevxKn6rioGAI-uGfKpmSE2A1YnLCckHj4Dm8VROmFW1kio-K-1JlRBr/s1600/method.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;270&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuO7z41MmfMeIDz1gTsNRsGCJ97gSghLkuXDtomm1_Urs5ARn_FeYnE1zn9aNwTlgYsjyTVxajXAS7uALj5HDCWevxKn6rioGAI-uGfKpmSE2A1YnLCckHj4Dm8VROmFW1kio-K-1JlRBr/s320/method.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Then you will see a windows like below figure. We are going to create small session bean that returns addition of two numbers. So we need to get two integer values as parameters and we need to return the addition of those two numbers as a integer.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG4YeBE-YiFj895KY4ua6LJVWFXGBK7FUjX1Q_p-LfU6fLp6FrB037uTCj_PJ9Ac_wYgApCpmVeWtk2GIlRyw003kRNCJAxxSktkBM3JXBxenzuSl0MQzrG21ep5t7TZS41XDn5cfV_36d/s1600/bussiness.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;256&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjG4YeBE-YiFj895KY4ua6LJVWFXGBK7FUjX1Q_p-LfU6fLp6FrB037uTCj_PJ9Ac_wYgApCpmVeWtk2GIlRyw003kRNCJAxxSktkBM3JXBxenzuSl0MQzrG21ep5t7TZS41XDn5cfV_36d/s320/bussiness.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Now you will see a method call businessMethod in the&amp;nbsp;testSessionBean.java and&amp;nbsp;testSessionBeanLocal.java classes. Change the return statement as follows. Then that method will return the addition of given two numbers.&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;public int businessMethod(int num1, int num2) {&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return num1+num2;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
Then save the java file. We created a session bean. Now we need to create a web application. This web app will use above session bean.&lt;br /&gt;
Right click on testApp-war node in project tab and go to New and select Servlet. Then you will get a window. Give a suitable name for your servlet such as testServlet and give a package name. Then click next and click finish on next window. Now we can see a new servlet java class created under the source package and your package name directory.&lt;br /&gt;
Now we need to call above sessionBean. So right click on work area and select insert code as&amp;nbsp;mentioned&amp;nbsp;above. Then select call Enterprise Bean. Then you will see a window and you have to select our ejb that we created as shown in the figure.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-dk4fQuR7Vg4CUD0gwzW6ebL07cRNozf13gFtTx3Kc58W0CwOkX1fhmZdphoreh6FdtqwhjLDrhHeIILBtNAAvW1j78Sa5HIw4I2RpuP2_GQp6VoynIGxHdrGnVU6t0R1RCNg6SKTkL6B/s1600/selectBean.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-dk4fQuR7Vg4CUD0gwzW6ebL07cRNozf13gFtTx3Kc58W0CwOkX1fhmZdphoreh6FdtqwhjLDrhHeIILBtNAAvW1j78Sa5HIw4I2RpuP2_GQp6VoynIGxHdrGnVU6t0R1RCNg6SKTkL6B/s320/selectBean.jpg&quot; width=&quot;225&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Now you will see&amp;nbsp;following&amp;nbsp;code added to the servlet class.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@EJB&lt;br /&gt;
&amp;nbsp; &amp;nbsp; private testSessionBeanLocal testSessionBean;&lt;br /&gt;
&lt;br /&gt;
Since we need to call session bean, we need to add following code in side the try catch block that created in the servlet.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.println(&quot;&amp;lt;html&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.println(&quot;&amp;lt;head&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.println(&quot;&amp;lt;title&amp;gt;Servlet testServlet&amp;lt;/title&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.println(&quot;&amp;lt;/head&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.println(&quot;&amp;lt;body&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;out.println(&quot;&amp;lt;h1&amp;gt;Addition of 10 and 15 is &quot;+testSessionBean.businessMethod(10, 15)+&quot;&amp;lt;/h1&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.println(&quot;&amp;lt;/body&amp;gt;&quot;);&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; out.println(&quot;&amp;lt;/html&amp;gt;&quot;);&lt;br /&gt;
&lt;br /&gt;
We are&amp;nbsp;almost&amp;nbsp;finished. Now we need to deploy our enterprise application to the server. Right click on testApp node in the project tab and click deploy. Then deploy our web application and start the jboss server. After deploying we can access our web application through a web browser. Open a web browser and enter following URL.&lt;br /&gt;
&lt;a href=&quot;http://localhost:8080/testApp-war/testServlet&quot;&gt;http://localhost:8080/testApp-war/testServlet&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now you will see the addition of 10 and 15 display in web browser.&lt;br /&gt;
&lt;br /&gt;
Cheers..!!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/3528451107069058091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/create-enterprise-application-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/3528451107069058091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/3528451107069058091'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/create-enterprise-application-with.html' title='Create Enterprise Application with JBOSS and Netbeans'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCn2Me5kv6hoiOpsKdYhGfIVgHDllSFhWuvstURu4tcXH4pBuL_X_CAVQjM8HFqrhDaPJLgXTtNn9aXC2Jh5EQDRpHIa-7oB7gftzczqo5wZZxOYb96o5OEHlKedhj3PzUGhitv4YSKt-q/s72-c/Untitled.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-7900682702210635788</id><published>2012-10-14T05:33:00.002-07:00</published><updated>2012-10-14T05:38:49.740-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Getting Started"/><title type='text'>JBOSS with NetBeans</title><content type='html'>We discussed about how to install JBOSS in your computer in&amp;nbsp;previous&amp;nbsp;post.
 But we didn&#39;t talk about how to start JBOSS server. We are going to 
talk about how to use JBOSS with netbeans IDE. Most of the JBOSS 
tutorials are based on eclipse IDE. But this article series is based on 
Netbeans IDE.&lt;br /&gt;
&lt;br /&gt;
First open netbeans IDE. Then go to service tab and right click on servers node. Then click on add server as shown in the image.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPFMbRhsRmatxjFYdyvJkUTK4pqxqJEGnT0cPwmXIC6ZcjZyqWYSWXmmtzhpSq30qd0e-VBOgAx9R1xSu8U7Numx58uZV-SvJ5XP0M3GiXsFXvCppGVOcVfG91aQAuHAoBdTuWH3O7I5Dr/s1600/server.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;197&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPFMbRhsRmatxjFYdyvJkUTK4pqxqJEGnT0cPwmXIC6ZcjZyqWYSWXmmtzhpSq30qd0e-VBOgAx9R1xSu8U7Numx58uZV-SvJ5XP0M3GiXsFXvCppGVOcVfG91aQAuHAoBdTuWH3O7I5Dr/s320/server.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Then you have to select&amp;nbsp;JBoss Application Server from pop up box. Then 
press next. Now you have to browse your JBOSS stored folder. You have to
 select jboss-as directory. After that press finish. Now we successfully
 added JBOSS server to netbeans. Now we can start our JBOSS server from 
Netbeans. For that, write click on newly added jboss server and press 
start. Now we can see jboss-console. It will show starting JBOSS server.&lt;br /&gt;
&lt;br /&gt;
We will see how to create small EJB and how to deploy that EJB to the JBOSS AS from netbeans.</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/7900682702210635788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/jboss-with-netbeans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/7900682702210635788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/7900682702210635788'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/jboss-with-netbeans.html' title='JBOSS with NetBeans'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPFMbRhsRmatxjFYdyvJkUTK4pqxqJEGnT0cPwmXIC6ZcjZyqWYSWXmmtzhpSq30qd0e-VBOgAx9R1xSu8U7Numx58uZV-SvJ5XP0M3GiXsFXvCppGVOcVfG91aQAuHAoBdTuWH3O7I5Dr/s72-c/server.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2902796171332551349.post-3442011091995236211</id><published>2012-10-14T05:28:00.002-07:00</published><updated>2012-10-14T05:48:00.677-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Getting Started"/><title type='text'>Install JBOSS in your computer</title><content type='html'>This article describes how to install JBOSS AS in your computer. This is
 the first article of series of article. I am going to cover login 
modules, Clustering and load balancing in JBOSS. First let&#39;s see how to 
install JBOSS in your computer.&lt;br /&gt;
In this tutorial series, I am using JBOSS AS 5.1. You can download JBOSS
 AS 5 from JBOSS website. This is the link for JBOSS website.&lt;br /&gt;
&lt;a href=&quot;http://www.jboss.org/jbossas/downloads/&quot;&gt;http://www.jboss.org/jbossas/downloads/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
According to your OS you can download zip or tar file. Installing JBOSS 
is very easy. We don&#39;t have to do anything. First we need to create a 
folder called &quot;jboss&quot; in C drive. If you want, you can create this 
folder in any of your partition. Then you have to extract that 
downloaded zip file into that folder. Now we installed JBOSS in your 
computer.&lt;br /&gt;
&lt;br /&gt;
My next post will be on how to start jboss server from netbeans and command prompt.</content><link rel='replies' type='application/atom+xml' href='http://jbossas5.blogspot.com/feeds/3442011091995236211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://jbossas5.blogspot.com/2012/10/install-jboss-in-your-computer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/3442011091995236211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2902796171332551349/posts/default/3442011091995236211'/><link rel='alternate' type='text/html' href='http://jbossas5.blogspot.com/2012/10/install-jboss-in-your-computer.html' title='Install JBOSS in your computer'/><author><name>akila sithum</name><uri>http://www.blogger.com/profile/01474159297408201613</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmaUBiSf683sjuma4hrVmq73Zoz4Yq6VtV_eILGo4GqGhSmFrZKNtAJzyhbmcsY_0B95U4n7mOPWbPQ27UkKPp9HTTIPKt00k_f2LHaahZEbxheXchv3lRwjOFVNYxTfM/s220/Image2596.jpg'/></author><thr:total>0</thr:total></entry></feed>