Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

chandr prakash

Ranch Hand
+ Follow
since Jan 29, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by chandr prakash

@sabrish......Am i clear?
5 years ago
JSP
@Sabarish, thankx for reply..... This is my fault, I should have to mention following lines in my above post

I will do it(Fetching value from database) later,currently i have hardcoded it, later on i will replace it with api(fetching database value.)
currently i want to test it with hardcoded value just to check whether all the things are correctly working or not.
database value is updating by some other modules.
5 years ago
JSP
@Sabarish, @Seetharaman
I tried, code as suggested by you and followings are modified jsps.


SessionValidate.jsp


On body onload i am calling 'callFunction' java script function and this functions is calling function 'abc' in the interval of 22 seconds.This abc function is directing to 'SessionValidate.jsp' using ajax. In 'SessionValidate.jsp' i am fetching value from database(whether sessionExpiration is enabled or disabled) and checking the diference of session last accessed time and current time. On basis of above two condition(database value,difference of session.lastAccessedTime and currentTime) I am passing this responseText to 'index.jsp' and if responseText is true then i am forwarding control to 'DestroySession.jsp'.

But when i executed the code,it is not happening like as i was expecting,logs are



I didnt interact with browser session and as we can see from logs even without interactio of user with session '{sesion last accessed time}' is continuously changing.
So,I was relying on session.getLastAccessedTime, which is continuously changing.......
Am i on right direction? or i have to change the code?
5 years ago
JSP
@sabrish..thankx for reply,not able to undersand your solution ....! Can you give me your code or you can do changes in the example which i have given in my post
5 years ago
JSP
@Sabrish : Thankx for reply,kindly please read following lines once again.
My requirement is : When there is no interaction of user with the session for 1 minute, i want to invalidate session depending on some database value. If database value is false then session should not be invalidated. If database value is true then session should be invalidated. But after 1 minute(when there is no interaction of user with the session), sessionDestroyed function of SessionListener class is automatically called and i am not able to check database value. How can i do this?

so,Sesion should be expired or not,This decision will be taken only after checking db value, so i think i have to remove 'session-timeout' parameter from web.xml files OK.


@Venkatasamy : Thankx for reply, you understood my problem correctly,but i dont know how ajax will do request after 1 minute to check my db value.Can you please give me your piece of code or you can please direct me to some link(or some simple example) explaining about this.Waiting for your reply?
5 years ago
JSP
Seems like i am not able to understand you the problem
Thnankx for reply
Session should be expired (timedout-when there is no interaction of user with the session) depending on some database value,
{This database value is updating by some other module} if expiraton of session is disabled in database then should not be
expired. If it is enabled then only session should be expired. At the time of calling of 'sessionExpired' method of SessionListener class (and this method is automatically called after session-timeout period) ,session is already expired, so i am not able to check database value before session expiration
5 years ago
JSP
I have written a test.jsp,web.xml and Session listener.For session timeout i am using HttpSessionListener feature.My session is getting invalidated after 1 minute,when there is no user interaction with the session. Technology used : JSP,Servlet









My requirement is : When there is no interaction of user with the session for 1 minute, i want to invalidate session depending on some database value. If database value is false then session should not be invalidated. If database value is true then session should be invalidated. But after 1 minuter(when there is no interaction of user with the session), sessionDestroyed function of SessionListener class is automatically called and i am not able to check database value. How can i do this?

I am getting crazy with this problem.It is really awful.Im pretty new to this, so Im trying to post everything you need to understand my problem:

5 years ago
JSP
Lets say message in queue1 are JmsMsg11,JmsMsg12,JmsMsg13,JmsMsg14
Lets say message in queue2 are JmsMsg21,JmsMsg22,JmsMsg23,JmsMsg24

I have to process JmsMsg11 and JmsMsg21 simultaneously. After processing of JmsMsg11, i have to process JmsMsg12 then JmsMsg13 then JmsMsg14. Same is also applicable for queue2.

I have done same thing in weblogic 10.x by some change in ejb-jar.xml and weblogic-ejb-jar.xml by following code. dont know how to do in jboss 5.x.
ejb-jar.xml



weblogic-ejb-jar.xml


5 years ago


Above code is my message driven bean and working fine for single queue 'Queue1'. Now i want to associate Queue2 to same mdb.
I can do the same thing by creating another mdb class "EJB3MessageDrivenBean2" and by just changing activationConfig property as follow.


but in this method i have to replicate my code and in future if i have to associate another queue Queue3 then i have to again replicate java file.

Any other method by changing in xml file or any other method.
5 years ago
As suggested by you i create a file in $JBOSS/server/default/deploy/messaging/myqueue-service.xml


But while deploying i am getting following error.Why i am getting this error and how can i solve it?

5 years ago



Till now I worked on weblogic 10.x, Now i am migrating my code from weblogic to JBOSS.
In weblogic i used to create connection factory and queue using weblogic console. Weblogic console provides link on its home for creation of same($Wl_console-->Messaging-->JMS Modules.)
After that by creating JMS module, there was a option of 'JMS module connection factory creation' and 'jms module queue creation' in weblogic console.
But i dont know how to do the same task in jboss. try to be more clear, i'm in lack of ideas in this problem, even it sounds like a classic Please outline the steps
5 years ago