[Security & JAAS/JBoss] - Re: SecurityAssociaton.getSubject is null
by AbhayaJha
*************
***URGENT***
*************
Hi ,
Please help at your earliest. Below are the detailed description for tbe above.
We have a two ear deployed in JBoss. One ear contains all EJBs. Second Ear contains war file and internally invokes EJBs.
When my system receives (Using MDBs) messages it?s processed perfectly but when I am unable to login in web application.
I thought during migration just I can deploy my ear files but I found some class loader problems. But when I removed all the EJB client jars from the .war/web-inf/lib, It worked.
But login problem is still there, I believe this problem is due to JAAS/SSL configuration.
We have a problem with JAAS in new version of JBoss-4.0.5. The same approach is working in JBoss-3.2.3 version.
We are using customized login module and this login module is invoked properly and subject is populated
subject.getPrivateCredentials().add(userBean);
logger.info("Adding role '" + userBean.getRole() + "' to context");
userRoles.addMember(new SimplePrincipal(userBean.getRole()));
Login module returns true.
But from action class, when we call below code subject is null.
EntryUser user = EISDataHelper().getUser();
signature of getUser is as below:
public EntryUserBean getUser() throws CustodyException, RemoteException {
Subject subj = SecurityAssociation.getSubject(); //Here subject is null(in JBoss-4.0.5.GA), while same code is running in JBoss-3.2.3
if (subj == null) {
logger.debug("subject is null");
return null;
}
:
:
:
}
Configuration for login module in login-config.xml is as below :
<application-policy name="settlement">
<login-module code="com.db.dcs.model.settlements.jboss.security.LdapDBLoginModule" flag="required">
<module-option name="validatePWD">true</module-option>
</login-module>
</application-policy>
Configuration for JAAS in conf/jboss-service.xml is as below :
<!-- ==================================================================== -->
<!-- Security -->
<!-- ==================================================================== -->
jboss.security:service=XMLLoginConfig
login-config.xml
<!-- JAAS security manager and realm mapping -->
<!-- change JaasSecurityManager by JaasSecurityDomain -->
org.jboss.security.plugins.JaasSecurityDomain
<!--JaasSecurityDomain -->
jboss.security:service=JaasSecurityManager
${jboss.server.home.dir}/ssl/abc.keystore
XYZ
Configuration for SSL in deploy/jbossweb-tomcat55.sar/server.xml is as below :
Configuration for security domain in deploy/settlement-webapp.ear/settlement-webapp.war/jboss-web.xml is as below :
<jboss-web>
<security-domain>java:/jaas/settlement</security-domain>
</jboss-web>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043629#4043629
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043629
19 years
[Clustering/JBoss] - Request not redirecting to the server in the cluster.. Help
by PriyaP
I have configured loadbalancer as belows and I the request are not redirecting to the correct servers. Please help me on this.
We have 2 jboss machines running on
1) 10.239.20.193 Port 8080
2) 10.239.96.181 Port 8080
We have installed Apache with mod_jk in another machine (10.239.19.149)
and have done the following configurations:
Configuration changes in JBoss Node 1 (10.239.20.193 Port 8080)
a) In server/all/deploy/jbossweb-tomcat55.sar/server.xml
we have modified the jvmRoute tag in <Engine tag to "node1"
b) Modified the useJK in the /server/all/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml to true
true
Configuration changes in JBoss Node 2 (10.239.96.181 Port 8080)
a) In server/all/deploy/jbossweb-tomcat55.sar/server.xml
we have modified the jvmRoute tag in <Engine tag to "node2"
b) Modified the useJK in the /server/all/deploy/jbossweb-tomcat55.sar/META-INF/jboss-service.xml to true
true
Configuration changes in Load balancer machine:
a) Modified httpd.conf
Included the following block at the end:
# Include mod_jk's specific configuration file
Include conf/mod-jk.conf
b) Create mod-jk.conf with the following contents:
# Load mod_jk module
# Specify the filename of the mod_jk lib
LoadModule jk_module modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
# JkOptions indicates to send SSK KEY SIZE
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat
JkRequestLogFormat "%w %V %T"
# Mount your applications
JkMount /ppm/* loadbalancer
# You can use external file for mount points.
# It will be checked for updates each 60 seconds.
# The format of the file is: /url=worker
# /examples/*=loadbalancer
JkMountFile conf/uriworkermap.properties
# Add shared memory.
# This directive is present with 1.2.10 and
# later versions of mod_jk, and is needed for
# for load balancing to work properly
JkShmFile logs/jk.shm
# Add jkstatus for managing runtime data
<Location /jkstatus/>
JkMount status
Order deny,allow
Deny from all
Allow from 127.0.0.1
c) Created uriworker.properties with the following contents:
# Simple worker configuration file
# Mount the Servlet context to the ajp13 worker
/jmx-console=loadbalancer
/jmx-console/*=loadbalancer
/web-console=loadbalancer
/web-console/*=loadbalancer
d) Created worker.properties with the following contents:
# Define list of workers that will be used
# for mapping requests
worker.list=loadbalancer,status
# Define Node1
# modify the host as your host IP or DNS name.
worker.node1.port=8080
worker.node1.host=10.239.20.193
worker.node1.type=ajp13
worker.node1.lbfactor=1
worker.node1.cachesize=10
# Define Node2
# modify the host as your host IP or DNS name.
worker.node2.port=8080
worker.node2.host=10.239.96.181
worker.node2.type=ajp13
worker.node2.lbfactor=1
worker.node2.cachesize=10
# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
#worker.list=loadbalancer
# Status worker for managing load balancer
worker.status.type=status
When we try to hit the apache mod-jd with the following url we get the output in the log file as
http://localhost:80/ppm/a.html
jk_map.c (432): The attribute 'worker.node1.cachesize' is deprecated - please check the documentation for the correct replacement.
jk_map.c (432): The attribute 'worker.node2.cachesize' is deprecated - please check the documentation for the correct replacement.
mod_jk.c (2743): mod_jk/1.2.22 initialized
jk_map.c (432): The attribute 'worker.node1.cachesize' is deprecated - please check the documentation for the correct replacement.
jk_map.c (432): The attribute 'worker.node2.cachesize' is deprecated - please check the documentation for the correct replacement.
mod_jk.c (2743): mod_jk/1.2.22 initialized
jk_map.c (432): The attribute 'worker.node1.cachesize' is deprecated - please check the documentation for the correct replacement.
jk_map.c (432): The attribute 'worker.node2.cachesize' is deprecated - please check the documentation for the correct replacement.
mod_jk.c (2743): mod_jk/1.2.22 initialized
jk_map.c (432): The attribute 'worker.node1.cachesize' is deprecated - please check the documentation for the correct replacement.
jk_map.c (432): The attribute 'worker.node2.cachesize' is deprecated - please check the documentation for the correct replacement.
mod_jk.c (2743): mod_jk/1.2.22 initialized
jk_ajp_common.c (945): (node1) Tomcat has forced a connection close for socket 844
jk_ajp_common.c (1592): (node1) Tomcat is down or refused connection. No response has been sent to the client (yet)
jk_ajp_common.c (1902): (node1) receiving from tomcat failed, recoverable operation attempt=0
jk_ajp_common.c (1941): (node1) sending request to tomcat failed, recoverable operation attempt=1
jk_ajp_common.c (945): (node1) Tomcat has forced a connection close for socket 844
jk_ajp_common.c (1592): (node1) Tomcat is down or refused connection. No response has been sent to the client (yet)
jk_ajp_common.c (1902): (node1) receiving from tomcat failed, recoverable operation attempt=1
jk_ajp_common.c (1941): (node1) sending request to tomcat failed, recoverable operation attempt=2
jk_ajp_common.c (1953): (node1) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
jk_lb_worker.c (1098): service failed, worker node1 is in error state
jk_ajp_common.c (945): (node2) Tomcat has forced a connection close for socket 844
jk_ajp_common.c (1592): (node2) Tomcat is down or refused connection. No response has been sent to the client (yet)
jk_ajp_common.c (1902): (node2) receiving from tomcat failed, recoverable operation attempt=0
jk_ajp_common.c (1941): (node2) sending request to tomcat failed, recoverable operation attempt=1
jk_ajp_common.c (945): (node2) Tomcat has forced a connection close for socket 844
jk_ajp_common.c (1592): (node2) Tomcat is down or refused connection. No response has been sent to the client (yet)
jk_ajp_common.c (1902): (node2) receiving from tomcat failed, recoverable operation attempt=1
jk_ajp_common.c (1941): (node2) sending request to tomcat failed, recoverable operation attempt=2
jk_ajp_common.c (1953): (node2) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
jk_lb_worker.c (1098): service failed, worker node2 is in error state
jk_lb_worker.c (1160): All tomcat instances are busy or in error state
st 82.125000
mod_jk.c (2254): Service error=0 for worker=loadbalancer
jk_map.c (432): The attribute 'worker.node1.cachesize' is deprecated - please check the documentation for the correct replacement.
jk_map.c (432): The attribute 'worker.node2.cachesize' is deprecated - please check the documentation for the correct replacement.
mod_jk.c (2743): mod_jk/1.2.22 initialized
jk_map.c (432): The attribute 'worker.node1.cachesize' is deprecated - please check the documentation for the correct replacement.
jk_map.c (432): The attribute 'worker.node2.cachesize' is deprecated - please check the documentation for the correct replacement.
mod_jk.c (2743): mod_jk/1.2.22 initialized
jk_map.c (432): The attribute 'worker.node1.cachesize' is deprecated - please check the documentation for the correct replacement.
jk_map.c (432): The attribute 'worker.node2.cachesize' is deprecated - please check the documentation for the correct replacement.
mod_jk.c (2743): mod_jk/1.2.22 initialized
jk_map.c (432): The attribute 'worker.node1.cachesize' is deprecated - please check the documentation for the correct replacement.
jk_map.c (432): The attribute 'worker.node2.cachesize' is deprecated - please check the documentation for the correct replacement.
mod_jk.c (2743): mod_jk/1.2.22 initialized
jk_ajp_common.c (945): (node1) Tomcat has forced a connection close for socket 844
jk_ajp_common.c (1592): (node1) Tomcat is down or refused connection. No response has been sent to the client (yet)
jk_ajp_common.c (1902): (node1) receiving from tomcat failed, recoverable operation attempt=0
jk_ajp_common.c (1941): (node1) sending request to tomcat failed, recoverable operation attempt=1
jk_ajp_common.c (945): (node1) Tomcat has forced a connection close for socket 844
jk_ajp_common.c (1592): (node1) Tomcat is down or refused connection. No response has been sent to the client (yet)
jk_ajp_common.c (1902): (node1) receiving from tomcat failed, recoverable operation attempt=1
jk_ajp_common.c (1941): (node1) sending request to tomcat failed, recoverable operation attempt=2
jk_ajp_common.c (1953): (node1) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
jk_lb_worker.c (1098): service failed, worker node1 is in error state
jk_ajp_common.c (945): (node2) Tomcat has forced a connection close for socket 844
jk_ajp_common.c (1592): (node2) Tomcat is down or refused connection. No response has been sent to the client (yet)
jk_ajp_common.c (1902): (node2) receiving from tomcat failed, recoverable operation attempt=0
jk_ajp_common.c (1941): (node2) sending request to tomcat failed, recoverable operation attempt=1
jk_ajp_common.c (945): (node2) Tomcat has forced a connection close for socket 844
jk_ajp_common.c (1592): (node2) Tomcat is down or refused connection. No response has been sent to the client (yet)
jk_ajp_common.c (1902): (node2) receiving from tomcat failed, recoverable operation attempt=1
jk_ajp_common.c (1941): (node2) sending request to tomcat failed, recoverable operation attempt=2
jk_ajp_common.c (1953): (node2) Connecting to tomcat failed. Tomcat is probably not started or is listening on the wrong port
jk_lb_worker.c (1098): service failed, worker node2 is in error state
jk_lb_worker.c (1160): All tomcat instances are busy or in error state
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4043621#4043621
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4043621
19 years