[JBoss Portal] - Singleton Failover
by chanyungwan
I have a jboss cluster with 2 members. The OS is Redhat Linux Advanced Server 4 and the jboss version is 3.2.5. There are 3 singletons being put in deploy-hasingleton folder in each member. I want to test the singleton failover in this cluster and 2 cases are observed:
1) In the master node, I use the command "ps -auxwww | grep run.sh' to kill the jboss service, the 3 singletons can be launched in the 2nd node within 2 minutes and it is acceptable for us.
2) In the master node, I quit the jboss service using normal exit, i.e."Ctrl-C". However, the 3 singletons can also be launched in the 2nd node but it almost needs 10 - 15 minutes to complete the launching process. I tried to decrease the value of the linux kernel parameters like /proc/sys/net/ipv4/tcp_rmem or /proc/sys/net/ipv4/tcp_wmem or /proc/sys/net/ipv4/tcp_retries2, but none of them help.
Please give an advice on tackling the 2nd case timing issue.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958691#3958691
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958691
19 years, 9 months
[Security & JAAS/JBoss] - Re: Integration of Custom Client and Server Login Modules
by kearns
hi,
The jsp page where the client enters the data is shown below. You will see that I extract the credential 'customer id' from the subject to use in a call to a BankMgr Bean via a delegate (BankMgrDelegate). The BankMgr bean is in the 'securBankDomain' which uses the CustomServerLogin module to map the 'customer id' credential to a role. Specific roles have access to specific methods.
<!--
jaas.jsp: Simple JSP page to test custom JAAS RdbmsLoginModule.
-->
<%
if (request.getParameter("user") == null) {
%>
<input type=text name=user>
<input type=text name=pass>
<input type=submit value=submit>
<%
} else {
// just so you can see the debug messages
//System.setOut(new PrintStream(response.getOutputStream()));
try {
// Get the form's username & password fields
//
String user = request.getParameter("user");
String pass = request.getParameter("pass");
// Use the username/password to initialize the
// callback handler and then do the authentication.
//
PassiveCallbackHandler cbh = new PassiveCallbackHandler(user, pass);
LoginContext lc = new LoginContext("Example", cbh);
lc.login();
// Loop through all Principals and Credentials.
//
Iterator it = lc.getSubject().getPrincipals().iterator();
while (it.hasNext())
out.println("Authenticated: " + it.next().toString() + "");
// as the credential is not any specific class, but can be any object the type is
// past as an augument. Here RdbmsPrinciple extends java.util.Properties.
it = lc.getSubject().getPublicCredentials(Properties.class).iterator();
out.println("Credentials: ");
String id = null;
Properties credential = null;
while (it.hasNext())
credential = (Properties)it.next();
id = credential.getProperty("customer id");
out.println(credential.toString());
// initialise bank manager delegate
BankMgrDelegate bankMgrDelegate = new BankMgrDelegate();
bankMgrDelegate.init();
// call BankMgr bean
if (id != null) {
int custId = Integer.parseInt(id);
try {
out.println(bankMgrDelegate.getCustomerData(custId).toString());
} catch (Exception e) {
out.println("jaas: call BankMgr bean - "+e.getMessage());
}
} else {
out.println("Controller: processRequest - INVALID parameter *** userId ***");
}
lc.logout();
} catch (Exception e) {
out.println("Caught Exception: " + e);
}
}
%>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958687#3958687
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958687
19 years, 9 months