aspose file tools*
The moose likes BEA/Weblogic and the fly likes Can't replicate session on clustered weblogic Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Can Watch "Can New topic
Author

Can't replicate session on clustered weblogic

agung iswara
Greenhorn

Joined: Jan 12, 2011
Posts: 1
hi all,

i try to simulate weblogic cluster on single machine. but why my weblogic installation can't replicate the session to another manage server? i try to listen from HttpSessionListener for any event (session create or destroy), but only one manage server that handling request and create the session. the other don't. where is my configuration wrong?

and when i try to access web without session, server will switched to handle the request. but when the already have the session, request will only stick on one server per session
i try to use weblogic 9 and 10.3. both behavior is the same.

here is my weblogic configuration :

Manage Server :

1. address (localhost:7004); name (ms1); machine (mcn1)
2. address (localhost:7005); name (ms2); machine (mcn1)

every session object on managed server is serializable.
and weblogic.xml on every manage server :


Cluster:
Cluster messaging mode is multicast. i try MulticastTest, and its working fine.

Load balancing :
i create new domain (localhost:7002) and use weblogic proxy for load balancing. just copy paste from the documentation.

weblogic.xml on proxy domain (load balancing)




web.xml (load balancing)



thank you!
Mohammad Al Hadid
Greenhorn

Joined: Jan 05, 2011
Posts: 10
dear ,

I think that you need to add the following tag to the weblogic.xml

<wls:session-descriptor>
<wls:cookie-name>MYJSESSIONID</wls:cookie-name>
<wls:persistent-store-type>replicated_if_clustered</wls:persistent-store-type>
</wls:session-descriptor>

I hope that helps you, and let me know whether it is working fine or not


SCJP, SCWCD
Mohammad Al Hadid
Greenhorn

Joined: Jan 05, 2011
Posts: 10
I think that you can do one thing (but make it temp) and remove it when deploy to production

private void saveToSession(String name, Object value){

if(value == null){
removeFromSession(name);
}else{
if (!(value instanceof Serializable)) {
\\log("The Object --->>>" + name + " is not serialized");
}
getSession().setAttribute(name, value);
}

}
Tarun Boyella
Greenhorn

Joined: Jun 15, 2009
Posts: 6
Can you just by modifying weblogic.xml with below content, remove the debug inside weblogic.xml.

Also you can refer to knowledge article Note 1157842.1 in my oracle support portal which has sample for testing different types of session replication.
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=SAMPLE%20CODE&id=1157842.1

<session-descriptor>
<persistent-store-type>replicated</persistent-store-type>
</session-descriptor>

Hope this helps.

- Tarun
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can't replicate session on clustered weblogic
 
Similar Threads
In-memory replication of http session is not working in BEA7 cluster
What's wrong with my deployment descriptor?
JSP not picking up getAttribute from Servlet
Jsf Error for simple jsf program in web application.
Web application clustering