Invalidate Session at all Cluster Weblogic
hi all,
i try to save user session in a hashmap on every cluster. and when i need to invalidate it, i will take specified session id. and invalidate it where the session created with normal way to invalidate session.
public class SessionListener implements HttpSessionListener {
public HashMap<String, HttpSession> sessionHolder = new HashMap<String, HttpSession>();
@Override
public void sessionCreated(HttpSessionEvent se) {
sessionHolder.put(se.getSession().getId(), se.getSession());
public void invalidate(String sessionId){
if(this.sessionHolder.get(sessionId)!= null){
System.out.println("Invalidate session ID : " + sessionId);
HttpSession session = sessionHolder.get(sessionId);
session.invalidate();
} else {
System.out.println("Session is not created in this cluster ID : " + sessionId);
@Override
public void sessionDestroyed(HttpSessionEvent se) {
System.out.println("Session " + se.getSession().getId() + " has been destoryed");
sessionHolder.remove(se.getSession().getId());
session will perish where invalidate occur. but on other cluster session is still avaliable.
why the session on other cluster is still. and how to also invalidate session on other cluster.
thanks.
Edited by: jeggy on Jan 20, 2011 8:47 PM
Can you provide little bit more information on how many servers, clusters you have and what kind of replication etc?
Similar Messages
-
Invalidate session with weblogic.Admin
Hi,
I tried to invalidate sessions using weblogic.Admin using the command: java weblogic.Admin -url t3://localhost:8013 -username system -password *** GET -pretty -type ServletSessionRuntime. The output was:
MBeanName: "R3:Location=PIA,Name=B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731,ServerRuntime=PIA,Type=ServletSessionRuntime"
CachingDisabled: true
MainAttribute: [email protected]/ps
Name: B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731
ObjectName: B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731
Parent: PIA
Registered: true
TimeLastAccessed: 1102341410448
Type: ServletSessionRuntime
Then tried to invalidate it using:
java weblogic.Admin -url t3://localhost:8013 -username system -password *** INVOKE -mbean "R3:Location=PIA,Name=B0lYRDnVqlw1VzPZO1XszSFlIASW017b!1102341400731,ServerRuntime=PIA,Type=ServletSessionRuntime" -method INVALIDATE
ANd the error message: bash: !1102341400731: event not found
Do you know how to handle this? Or any other way to invalidate session from weblogic.Admin?
WLS 8.1 SP1
Regards
TomiHello,
I have a system consisting of three different departments, each department has its own login page with different username and password.
from the same browser, all three administrators can log in successfully, during there login, one session is created with different attributes for each of them, if any one administrator logs out, I invalidate the session, which logs out the other two administrators.
Can I use session Id to log out on administrator while the other two can stay logs in?
If I am using the wrong approach all together, can anyone suggest an alternative please?
here is my code to create session:
// if correct username and password entered then create session
String financeAdminSess = adminUsername;
session.setAttribute("financeAdminSess", adminUsername);
String redirectURL = "finance_admin_home.jsp";
response.sendRedirect(redirectURL);
and here is the code for loggin out:
// get session
String financeAdminSess=(String) session.getAttribute("financeAdminSess");
// remove session
session.removeAttribute("financeAdminSess<br />");
// invalidate session
session.invalidate();
Any suggestion would be much appreciated.
Thanks
Shaxo -
Hi!
I need to integrate BlazeDS security with an external security mechanism so I have implemented custom authentication as described in http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=services_security_1 .html. Now I need to invalidate user authentication on server upon certain circunstances. When this happens, I invalidate Session contained in Request parameter of invoke method of TomcatValve. This seems to work but I get a nasty "Duplicated Http Session" in Flex client telling that cookies where removed in server. Is there any clear way to invalidate current user login from BlazeDS?
I've also tried invalidating FlexSession but then Flex clients hangs.
Thank you very much.
Daniel.Ummm - isn't that exactly what a session timeout specifies?
ie how long should it stick around before it "expires" and should be invalidated?
You don't need to call session.invalidate() - it will do that all by itself. -
Invalidate session with specific sessionId
Hi there,
Is it possible to invalidate session with specific sessionId?
Thanks.Hello,
I have a system consisting of three different departments, each department has its own login page with different username and password.
from the same browser, all three administrators can log in successfully, during there login, one session is created with different attributes for each of them, if any one administrator logs out, I invalidate the session, which logs out the other two administrators.
Can I use session Id to log out on administrator while the other two can stay logs in?
If I am using the wrong approach all together, can anyone suggest an alternative please?
here is my code to create session:
// if correct username and password entered then create session
String financeAdminSess = adminUsername;
session.setAttribute("financeAdminSess", adminUsername);
String redirectURL = "finance_admin_home.jsp";
response.sendRedirect(redirectURL);
and here is the code for loggin out:
// get session
String financeAdminSess=(String) session.getAttribute("financeAdminSess");
// remove session
session.removeAttribute("financeAdminSess<br />");
// invalidate session
session.invalidate();
Any suggestion would be much appreciated.
Thanks
Shaxo -
Session.invalidate & session.removeAttribute()
hi,
i need a clarification....does session.invalidate() also remeove all the attributes and their values or do i need an explicit session.removeAttribute("var_name") ??????????
if i use session.removeAttribute i get cannot resolve symbol at compile time!
thank u,
ashnacheck out,
1. maybe you are trying to run removeAttribute, AFTER invalidate().
2. you have given wrong name as argument to removeAttribute().
just call invalidate(), you dont need to call removeAttribute(). -
Reload Page + Invalidate Session
(ADF 11gR1 ADFBC) I have an ADF application which can be run with different contexts.
Every user has a “last_selected_context” stored in the database.
When launching the application, I fetch this “last selected context” and in the “beforePhase” of the “PagePhaseListener”, I set all my session variables for this context.
Users may swap from a context to another by selecting it from a popup.
My problem is : when a user select another context, I have to invalidate the session and reload the page.
I did this in a function “reloadThePage()”
public static void reloadThePage()
FacesContext fContext = FacesContext.getCurrentInstance();
String viewId = fContext.getViewRoot().getViewId();
String actionUrl = fContext.getApplication().getViewHandler().getActionURL(fContext, viewId);
try
ExternalContext eContext = fContext.getExternalContext();
String resourceUrl = actionUrl;
// Invalidate Session
HttpSession session = (HttpSession)JSFUtils.getFacesContext().getExternalContext().getSession(false);
if (session != null) {
session.invalidate();
eContext.redirect(resourceUrl);
catch (IOException ioe)
System.err.println("Problem trying to reload the page:");
ioe.printStackTrace();
}It is working fine, but I have this Warning message every time a change the context: Because of inactivity, your session has timed out and is no longer active. Click OK to reload the page+.
Is there a way to avoid this Warning message?
Thanks & Regards
NicolasHi Timo,
Thanks for your help.
I've tried this but I still have the same warning message.
public static void reloadThePage()
FacesContext fContext = FacesContext.getCurrentInstance();
try
ExternalContext eContext = fContext.getExternalContext();
String resourceUrl = "/hr2/faces/home";
// Invalidate Session
HttpSession session = (HttpSession)JSFUtils.getFacesContext().getExternalContext().getSession(false);
if (session != null) {
session.invalidate();
eContext.redirect(resourceUrl);
catch (IOException ioe)
System.err.println("Problem trying to reload the page:");
ioe.printStackTrace();
}Any other suggestion ?
Thanks & Regards
Nicolas -
Is it possible to invalidate session when I click my browsers back button
Hai
I have a question.
I am building a jsp page with multiple forms.As of now,
no login system has been implemented.
I need my session to time out when the client click on the back
button on the browser to prevent data corruption.
Is there a possible way to do this in Java/ Script
I know the use of session.invalidate() but how to tie it up to the
browser's back button
A second problem
If I use session.invalidate() on Tomcat 3.2
I find that it is not invalidated.But this same function on tomcat 4
doesn't have any problem
Could anyone help on these issues
ThanksYou don't mean you want to invalidate session every time you move to a new page, do you? If you do, after implementation of login system the users will be asked for passwords at each page. If you don't, it's better to use headers for your response.
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires", "-1"); -
Hi All,
I am facing the below error while installing Oracle RAC in Silent Mode.
SEVERE: There are no common subnets represented by network interfaces across all cluster nodes.
SEVERE: [FATAL] [INS-40925] One or more nodes have interfaces not configured with a subnet that is common across all cluster nodes.
CAUSE: Not all nodes have network interfaces that are configured on subnets that are common to all nodes in the cluster.
ACTION: Ensure all cluster nodes have a public interface defined with the same subnet accessible by all nodes in the cluster.
My /etc/hosts is given below.
127.0.0.1 localhost localhost.localdomain
#Public
192.168.1.101 rac1 rac1.localdomain
192.168.1.102 rac2 rac2.localdomain
#Private
192.168.2.101 rac1-priv rac1-priv.localdomain
192.168.2.102 rac2-priv rac2-priv.localdomain
#Virtual
192.168.1.103 rac1-vip rac1-vip.localdomain
192.168.1.104 rac2-vip rac2-vip.localdomain
#SCAN
192.168.1.105 rac-scan rac-scan.localdomain
Could you please help me to get rid of the error INS-40925....Any Idea...???Hi Ramesh,
Please find the result of ifconfig -a from both nodes RAC1 & RAC2.
ifconfig -a in RAC1
[oracle@rac1 Desktop]$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 08:00:27:17:7A:D5
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe17:7ad5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:102 errors:0 dropped:0 overruns:0 frame:0
TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25472 (24.8 KiB) TX bytes:3322 (3.2 KiB)
Interrupt:19 Base address:0xd020
eth1 Link encap:Ethernet HWaddr 08:00:27:C0:AC:DB
inet addr:192.168.2.101 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fec0:acdb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240 (240.0 b) TX bytes:816 (816.0 b)
Interrupt:16 Base address:0xd240
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6394 (6.2 KiB) TX bytes:6394 (6.2 KiB)
virbr0 Link encap:Ethernet HWaddr 52:54:00:CC:BD:FB
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
virbr0-nic Link encap:Ethernet HWaddr 52:54:00:CC:BD:FB
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
ifconfig -a in RAC2
[oracle@rac2 Desktop]$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 08:00:27:C9:38:82
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fec9:3882/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:122 errors:0 dropped:0 overruns:0 frame:0
TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:32617 (31.8 KiB) TX bytes:5157 (5.0 KiB)
Interrupt:19 Base address:0xd020
eth1 Link encap:Ethernet HWaddr 08:00:27:90:B5:A0
inet addr:192.168.2.102 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe90:b5a0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:240 (240.0 b) TX bytes:746 (746.0 b)
Interrupt:16 Base address:0xd240
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:56 errors:0 dropped:0 overruns:0 frame:0
TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6390 (6.2 KiB) TX bytes:6390 (6.2 KiB)
virbr0 Link encap:Ethernet HWaddr 52:54:00:CC:BD:FB
inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
virbr0-nic Link encap:Ethernet HWaddr 52:54:00:CC:BD:FB
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b) -
Hardware Load Balancers and Cluster WebLogic Proxy Plug-in setting
Documentation states that we need to enable the Cluster WebLogic Proxy Plug-in setting when there is a proxy plugin or HttpClusterServlet configured.
We used to have Weblogic Proxy plugin and the setting is still there, also the proxy was replaced by the hardware loadbalancer. Everything works normally and no one complained, but I would assume that WebLogic Proxy Plug-in setting should not be applicable any longer.
Is it possibly harmful to have that setting there? Does it mean that the loadbalancer emulates WebLogic Proxy Plug-in and also need this set?
Thank youThe Weblogic Proxy Plug-in Enabled flag only affects the behavior of a WL proxy module (such as if you were using Apache to proxy to WL via the mod_wl.so module). The value controls what IP address is returned when you call request.getRemoteAddr() from your application. If not enabled, you will get the IP address of the web server that proxied the request. If enabled, you will get the remote client IP address (instead of the proxy IP address) facilitated by the WL-Proxy-Client-IP header. If you are no longer using a plug-in module, the setting will have no affect. Hope this helps...
-
Invalidate session in another context
Hi everyone,
In a nutshell, how to invalidate session of another context residing in another server?
If it is not possible, what is the best approach to achieve something similar to that?
Thanks for reading this.
Zu can as well use the MBean interface implementations for Tomcat (JBoss)
and call some public method of a MBean under name "jboss.web:type=Manager,path=/,host=localhost,*" - like 'expireSession' passing the sessionId string as param
Rafal Baton Zaczynski
http://baton.pop.e-wro.pl - Java/JSF/JavaScript - tips&tuts -
Revision: 1502
Author: [email protected]
Date: 2008-04-30 16:36:53 -0700 (Wed, 30 Apr 2008)
Log Message:
Bug: BLZ-148 - Repeat invocation of invalidate() on HttpFlexSession throws java.lang.IllegalStateException: invalidate: Session already invalidated
QA: Yes
Doc: No
Ticket Links:
http://bugs.adobe.com/jira/browse/BLZ-148
Modified Paths:
blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/HttpFlexSession.java -
Any way to communicate a message to all cluster members?
Is there any way I can communicate a message to all cluster members?
In my case I do some data caching within each cluster member. I'm trying to
implement a mechanism that will enable me to have every server flush their
cache. I was hoping that I could send the request to a servlet (on any
machine) that in-turn would send a 'multicast' message to all app servers
that would request a cache refresh.
Any ideas?
Thanks.
Marko.
JMS topics are great for multi-server synchronization.
Marko Milicevic <[email protected]> wrote in message
news:39dba2e7$[email protected]..
> Is there any way I can communicate a message to all cluster members?
> In my case I do some data caching within each cluster member. I'm trying
to
> implement a mechanism that will enable me to have every server flush their
> cache. I was hoping that I could send the request to a servlet (on any
> machine) that in-turn would send a 'multicast' message to all app servers
> that would request a cache refresh.
>
> Any ideas?
>
> Thanks.
>
> Marko.
> .
>
>
-
How can i invalidate Session when a browser crashes?
Hi
How can i invalidate session when a browser window closed or crashed unexpectedly.
If user closed the browser window using File->Close, then i'm calling javascript function .... and it is working fine. But when browser window is hanged and closed using ENDTASK, how can i kill that session.
Please help
Thanks
-VidyadharWell you can't. Execution halts, so anything you would want to do is made impossible: that's why crashes are the #1 enemy of any software developer (that and impossible deadlines). The webserver will remove the session manually when it times out though.
-
Hi,
I am using two cluster weblogic server(WLS 5.1,sp5,redhat 6.2),
when one weblogic server hang,the other one also hang,but when I restart one
server,the other one can work without restart.
And the two weblogic hang every day,who can help me?
Thanks.
Jason Shi([email protected])Without more information, it is difficult to diagnose your problem.
Thanks,
Michael
Michael Girdley
BEA Systems Inc
"Jason" <[email protected]> wrote in message
news:[email protected]..
Hi,
I am using two cluster weblogic server(WLS 5.1,sp5,redhat 6.2),
when one weblogic server hang,the other one also hang,but when I restartone
server,the other one can work without restart.
And the two weblogic hang every day,who can help me?
Thanks.
Jason Shi([email protected]) -
hi,
how can i run alter session for all users: i need to do follwoing:
alter session set "_fix_control"="7499258:off";
want to do it for all session can it be done?
thanksuser12020966 wrote:
Hi here is the solution they (Oracle Support) told me to do :
Most of the issues are solved just by Disabling cost based star transformation.
The remaining with alter session set "_fix_control"="7499258:off"; I was trying to set if off for all user because i don;t know which user might be causing the error (ora600)
also,, how to disable cost based star transformation?
thanksIf Oracle support told you to do this, don't you think it would be better to ask them your questions (how to best implement) instead of a forum of volunteers that has absolutely no context surrounding your question?
I think it would be, but that's just my opinion.
Maybe you are looking for
-
Package does not exist error-message
When I try to compile a java servlet with the following piece of code I get a compilation error referring to the import statement. I have just included the initial import statements. A large number of errors follow, as a result of this 'package does
-
Plug in Seagate USB drive and status goes from green to yellow
This is somewhat different from what others have posted. When I plug in or turn on my Seagate 160 gig drive on the base station USB, the status light switches to yellow and no more wireless. The disk works when direct connected to the iMac. Epson pri
-
Hi Using below sql get the columns discrepncy .I want to display the discprency of columns from two tables in form of flat file using pl/sql. select col1,col2 from A minus select * from B -- Rows in A that are not in B union all select col1,col2 from
-
General error and out of memory with Final Cut Pro 6
I just upgraded to a Mac mini i7. What setting should I use to avoid these errors?
-
Need to reinstall LR5 CC version it wont let me
out of the blue LR5 just wiped out all my presets. I deinstalled the app and want to redownlaod and reinstall, but it wont let me. Anyone know how to do this?