URL Session Problem

In my application i am URL class to connect to a application server and i read the performance summary
testURL = new URL(toFetchURL);
uc = testURL.openConnection();
in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
String inputLine;
StringBuffer sb = new StringBuffer("");
while ((inputLine = in.readLine()) != null) {
if(DEBUG) System.out.println(inputLine);
sb.append(inputLine).append("\n");
if(inputLine.startsWith(stopPattern))
break;
in.close();
This the piece of code i am using
I am executing this every 5 minutes this results in inflating the number of sessions in the application
the number of sessions get increased and these session will be closed only after 30 minutes which session timeout set in application server
How do i get rid of these sessions?
Any suggestions/

Thanks for the reply
can u give more insight how to cache session id and reuse it
Thanks in advance
Anil

Similar Messages

  • Session problem in jsp application

    I face a session problem. I setting everything in a session and when pass back to a main page, the value is not display in the screen. But after refresh the value will display in the screen and this kind of problem only come out very few time and i dun knw how to solve this...
    Anyone here can give me some idea and suggestion or the way to solve this kind of problem!!!

    define "2 different clients"
    1) You have 2 different PCs and it's using the same session ID for both? I doubt this. I think the server is advanced enough not to use give a session ID that's already been created.
    2) You have 1 PC and are using IE or Netscape and using File > New Window to open a new window and connect again. This you can't fix without using only URL rewriting to manage session, because the different windows will share the same session cookies.

  • Java Session problem while sending mail(using javamail) using Pl/SQL

    Hello ...
    i am using Java stored procedure to send mail. but i'm getting java session problem. means only once i can execute that procedure
    pls any help.

    props.put("smtp.gmail.com",host);I doubt javamail recognizes the 'smtp.gmail.com' property. I think it expects 'mail.host'. Of course since it cannot find a specified howt it assumes by default localhost
    Please format your code when you post the next time, there is a nice 'code' button above the post area.
    Mike

  • URL Session Tracking

    Hi,
    i want to make a group of JSP pages in a Web App, but assuming that the browser doesn't accept cookies.
    Is there anyway that i don't have to indicate every link as
    response.encodeUrl("index.jsp")I've heard something about a <url-session-tracking/> tag, but i've tried to put in the web.xml file, but it doesn't work.
    I just want to put Index and the App Server takes care of putting the jsessionid info in front of the url
    Thank you

    Cancelling this question.

  • URL Session Mapping

    Hi,
    i want to make a group of JSP pages in a Web App, but assuming that the browser doesn't accept cookies.
    Is there anyway that i don't have to indicate every link as
    response.encodeUrl("index.jsp")I've heard something about a <url-session-tracking/> tag, but i've tried to put in the web.xml file, but it doesn't work.
    I just want to put Index and the App Server takes care of putting the jsessionid info in front of the url
    Thank you

    Hi Justin,
    This should definitely work with the WebInstaller approach. In fact, we test this as part of our WebTest suite (on all certified containers, including Jetty 6). I believe you are not passing the jsessionid parameter correctly. From your post, you say your pass it like so:
    http[s]://<server_ip>/<path>/index.jsp?jsessionid=<session_id>
    The jessionid is not passed as a standard HTTP parameter - the correct syntax should be:
    http[s]://<server_ip>/<path>/index.jsp;jsessionid=<session_id>
    -David

  • URL cache problem in UCM and sitestudio

    Hi ,
    We have created Metadata Field : xPageName, and have configure an entry in config.cfg as SSUrlFieldName=PageName, Scenario is we have assigned abc.html to xPageName for a content item on suppose /oracle/cms1/ URL, by mistake we assigned abc.html to xPageName to another content item on suppose /oracle/cms2/ URL. Problem is abc.html is registered with two content item and on two URL's, and now we have changed it for /oracle/cms2/ URL to xyz.html, but when we hit /oracle/cms2/abc.html it is also served with blank page. Please suggest how we can get away with this ASAP.
    Thanks,

    That is definitely a limitation that each custom page name must be unique.
    If think what you are saying is that you have resolved this issue but the URL is still taking you to the wrong page...
    THis stuff is cached IIRC in some js files in the weblayout
    Have you tried, clearing browser cache, recreating the navigation in SS Designer, or restarting UCM and webserver?

  • Urgent: Sessions problem pls help me

    Hi all,
    Its already late to post this problem.pls help me urgently.
    I have a servlet & two jsp's. first i request servlet, it processes something and forwards request to my first jsp. In that jsp on a button click, i'm displaying a new popup by calling showModalDialog. this dialog gets data from the same servlet but it forwards to my second jsp.(second jsp can be seen in dialog)
    Now if i submit form from my second(dialog) jsp, the servlet reports that session has expired. I tried a lot but invain. any one who helps me is appreciated well by all of our forum.
    waiting 4 u r reply,

    It could be that you have cookies turned off and you're not using URL Rewriting.
    In J2EE, the first time your browser makes a request to the server, the server responds and appends a SESSION_ID parameter to the request as well as storing a cookie with the SESSION_ID.
    The second time your browser makes a request, the server checks for the cookie. If it doesn't exist it checks for the parameter. If neither exist the server assumes its the first time your browser has made a request and behaves as describe in the previous paragraph.
    In your case when you submit the form if you have disabled cookies and the action attribute doesn't have the SESSION_ID paramter appended to the url, the browser will assume it's a first request. The user will not be logged in, hence your session has expired error.
    To fix this you need to encode the URL in your JSP. You can use the struts html:rewrite tag or the HttpServletReponse.encodeURL method, or if you're using JSP 2.0 the JSTL c:url tag.

  • Sessions problem when deploying to AS 10g (10.1.2.0.2)

    Hello,
    I have a very simple Web Application where I have isolated an issue I have found. The application works fine when executed in JDeveloper 10g (10.1.2.2) but it does not work when deployed in the AS 10g (10.1.2.0.2). My Platform is Windows XP Professional x64.
    The application has been created in JDeveloper (New &gt;&gt; Web Project) and contains:
    - a simple jsp page (main.jsp) displaying a dummy message,
    - a simple filter class (authFilter.java) which only has the following code in the doFilter method:
    HttpServletRequest hreq = (HttpServletRequest)request;
    System.out.println("*** session id = " + hreq.getSession().getId());
    System.out.println("*** requested session id = " + hreq.getRequestedSessionId());
    - a web deployment descriptor (web.xml) where the reference to the filter has been added:
    &lt;filter&gt;
    &lt;filter-name&gt;Filter1&lt;/filter-name&gt;
    &lt;filter-class&gt;myfilters.authFilter&lt;/filter-class&gt;
    &lt;/filter&gt;
    &lt;filter-mapping&gt;
    &lt;filter-name&gt;Filter1&lt;/filter-name&gt;
    &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt;
    &lt;/filter-mapping&gt;
    When running this inside JDeveloper, the output is the following:
    08/12/09 17:54:03 *** session id = ac1663b9231c2936edded7df423f9161c223ee0d4246
    08/12/09 17:54:03 *** requested session id = null
    08/12/09 17:54:08 *** session id = ac1663b9231c2936edded7df423f9161c223ee0d4246
    08/12/09 17:54:08 *** requested session id = ac1663b9231c2936edded7df423f9161c223ee0d4246
    08/12/09 17:54:10 *** session id = ac1663b9231c2936edded7df423f9161c223ee0d4246
    08/12/09 17:54:10 *** requested session id = ac1663b9231c2936edded7df423f9161c223ee0d4246
    Each time I reload the page in the browser I get two messages where the session id and the requested session id are equal and the same.
    However, when running the application inside the AS, the output is the following (taken from the opmn/logs/OC4J~my_component~default_island~1):
    08/12/09 17:56:58 *** session id = ac16322030d6da9410e6348449449a4cf1f0e65956cf
    08/12/09 17:56:58 *** requested session id = null
    08/12/09 17:57:01 *** session id = ac16322030d6bc42fa22332e41818aa6ece1fd371361
    08/12/09 17:57:01 *** requested session id = null
    08/12/09 17:57:02 *** session id = ac16322030d60895af4c8cc44aef9ff6e6e3b3fd2e04
    08/12/09 17:57:02 *** requested session id = null
    That is, each time the page is reloaded, a new session is created.
    This problem is actually blocking me since I would like to use the session to store some data used for authentication in the filter (dynamic credentials). As a new session is being created for each access, the data stored in the session is lost and users cannot log on the application.
    Thank you in advance,
    Jorge.
    Edited by: Jorge Pacios on 10-dic-2008 0:31
    Platform information added.

    It couldn't be such difficult.
    I have the jar's, the drivers in, the jdbc url connection as
    url="jdbc:oracle:thin:[USERNAME/PASSWORD]@IP:PORT:SID"/>
    Also I can connect via sqlplus with this string conn.
    The main error I get is
    "Cannot lookup jdbc datasource.
    The process domain was unable to lookup the TX datasource "jdbc/BPELServerDataSource"."

  • Session problem in Enterprise Java / Weblogic application

    Background: we are using session variables in our enterprise java application running Weblogic application server.
    Issue: When we have more than one browser open in the same PC there is session variable conflict.
    Example:
    1) Variable v1 of browser b1 has state X.
    2) We open browser b2 and run the application, the variable v1 has session Y.
    3) We come back to browser b1. We notice that v1 has state Y, we are whereas expecting it to be X.
    Question:
    How do we maintain the various instances of session variables when using multiple browsers from a single PC?
    N.B. But this is not an issue when we check the application from multiple PCs each with a single browser open.

    I'm not sure about the ins and outs of the workings of Weblogic sessions, but:
    the sessions are probably being kept as cookies. This is probably what is causing the problem. That is why it works from different PCs.
    Try changing the session tracking from cookies to URL rewriting, and see if the problem remains. URL rewriting should make the URLs completely independent when run from different browsers.
    Let us know how you get on,
    Manuel Amago.

  • User self registration  - session problem?

    I have created a form which lets users register by themselves.
    The form calls a stored procedure which creates the user - sofar
    everything works ok. At the very end of the procedure I want to
    automatically login the user and direct him to the main page.
    That fails with a 'Page not found' error in the browser.
    i have done a lot of debugging and everything looks ok, the user
    is created. I can log in as the new user if I close the browser
    and restart it. I suspect I loose the session because the
    procedure that creates the user uses a set_context call to be
    able to work:
    portal30.wwctx_api.set_context(p_user_name
    => 'PORTAL30',
    p_password
    => 'PORTAL30');
    foo := wwsec_api.add_portal_user(p_user_name =>
    username,
    p_first_name =>
    first_name,
    p_last_name =>
    last_name,
    p_work_phone =>
    phone,
    p_organization =>
    organization,
    p_db_user => null,
    p_portal_user
    => 'Y');
    portal30.wwctx_api.clear_context;
    (I have a clear_context which I hoped should take me back to the
    original session)
    At the very end of the registration procedure I call the login
    function to log in the user:
    portal30.wwptl_login.login_url(ssousername =>
    username,
    password => password,
    p_requested_url =>
    url,
    p_cancel_url
    => 'http://myserver.com/');
    The browser is taken to this URL:
    http://myserver.com/pls/portal30/!
    PORTAL30.wwa_app_module.accept
    and the following error message is shown in the browser:
    Page Not Found...
    Anyone got any idea what might be the problem and what to do
    about it, or how to debug it???

    I managed to grant execute on the package using SQL/Plus as you
    suggested - but I'm still having problems. Using the following
    code:
    portal30.wwctx_api.set_context(p_user_name => 'PORTAL30',
         p_password => 'PORTAL30');
    my_special_procedure;
    portal30.wwctx_api.clear_context;
    -- Create a new session for the user
    portal30.WWCTX_SSO.clear_sso_session(sess_id);
    v_sess_id := portal30.WWCTX_SSO.set_sso_session(
    p_user_name => username,
    p_db_user => username,
    p_nls_language => 'us',
    p_http_language => 'en',
    p_nls_territory => null,
    p_trans_language => null,
    p_start_time => sysdate,
    p_active => 1,
    p_ip_address => v_ip_address,
    p_id => null,
    p_is_logged_on => false);
    No luck - no pages can be viewed. Have to restart the browser to
    get back to portal.
    I've also played around with some other functions in the
    WWCTX_SSO package, like create_session, but still no luck.

  • OC4J session problem - values not sticking in session

    OC4J 10g (9.0.4.0.0)
    I have been developing with JDeveloper and OC4J for a few years. My machine started to crap out last week (old laptop) so I purchased a new machine. I have installed the same versions of OC4J and JDeveloper on my new machine that were on my old machine. Everything seemed OK but I have noticed that none of the session values are "sticking" between requests, works fine on old machine by the way
    Example:
    a.jsp
    // put a simple value in the session
    session.setAttribute("firstName", new String("Chris"));
    // later in that same jsp I can retrieve tha value - no problem
    String fname = (String)session.getValue("firstName");
    b.jsp
    // but in a different jsp, the same call to retrieve the value from the session (after running other jsp to set the value) comes back null
    String fname = (String)session.getValue("firstName");
    The same exact code works great on one machine and not on the other - same versions of OC4J installed.
    Anyone seen this before?
    Thanks,
    Chris

    The urls appear to be correct:
    http://hostname:8888/contextroot/filename.jsp
    The same result can be seen if I re-run one JSP over and over:
    <%
    Integer bigInt = (Integer)session.getValue("counter");
    if (bigInt == null)
    session.setAttribute("counter", new Integer(1));
    bigInt = new Integer(1);
    else
    int newCounter = bigInt.intValue() + 1;
    session.setAttribute("counter", new Integer(newCounter));
    bigInt = new Integer(newCounter);
    %>
    Counter = <%= bigInt.intValue() %>
    If I run this over and over on one machine I see the counter value of 1 each time. On the other it increments.

  • Session problems on Windows

    Hi There,
    I'm using zend framework for doing the app which I developed on Mac but had to switch back to Windows 7. I tried to move the application as far as I can, but I'm not able to solve one big problem. This situation is as follow:
    -> I login with normal php / html site and placing a Zend Auth object into session (Normal Zend Framework mechanism)
    -> After detection of what kind of user logged in I redirect the site to given html site which contains the flash file for the user kind ( all within the same domain )
    -> I check on every RemoteObject request the user credentials existence in the session, if not present or timed out I send back an Event to get the flex application to log out
    -> In normal case ( on the mac and production site ) it works great, but in Windows 7 I always get logged out directly after login and loading the flash site.
    After further debugging I found that the requested site get's a new session id in flex's RemoteObject and after logging out the same session id is used than on login. On the Production Site it's still working great even on Windows.
    How is this possible? Is there a way that Flash in Windows uses the same session accross the same domain? Where else should I look? Nothing has changed in php code nor server settings, except 1 thing mainly I use now virtualhost on windows rather than a simple localhost/project url.
    r. Sandor

    Thanks jbf00 for your info, I'm doing this almost 4 days and no solution in sight. The only thing that I come a bit further is that the first check on the login credentials goes well (authorization check) but the next RemoteObject request get's a new session. The current situation is:
    -> login via PHP / Zend Framework
    -> redirect to an html site with Flex content
         -> request Authorization confirmation via RemoteObject goes well ( with authorization test )
         -> request Data via RemoteObject fails on authorization test
    according to the Network Monitor I can see that the last request gets a new session_id and I don't do any session_regeneration
    I did installed a new debian server to test the issue on Linux based system as well, but had no effect so, even the last working example has been recompiled with Windows FB4 instead of the Mac one.
    the only things I can think of is that the Windows version of the FalshBuilder 4 (trial) doesn't work well somehow
    If anybody has some other suggestions I will cover that as well.
    r. Sandor
    PS: As I mentioned I did the followings:
    -> instead of using the localhost entry I do use now a VirtualHost now ( .htaccess change for the MessageBroker controller :: ZendAMF
    Edit:
    I was completely wrong, I had a minor bug in the Authorization confirmation method, but the problem still remains so after login and redirection the first request has a wrong session_id

  • Multiple browsers open causes authentication or session problems

    Hi Folks,
    I have a strange problem. It's strange to me in any case as I'm primarily a back-end guy so I am not an expert on some of the web features of APEX. I have built an application that accesses many remote databases through database links. I open 4 instances of IE6, each is handed a seperate session id as can be seen in the url. The user provides the db name, user and password in the login page. I authenticate by creating a custom auth procedure which creates a temporary database link to test whether the user and password provided is correct for the chosen database. If correct, I authenticate. With 4 instances, this all works fine. Then I'm redirected to the first page in my application which runs a query against the remote database selected at login. ( table@db_link). If I hit the button to submit the query on the 4 browsers, the 4th one reverts me to the login page as if I am not authenticated. This does not seem to happen if I open 4 browsers on 4 different computers all accessing the APEX application.
    Has anyone experienced similar issues or does anyone know if there is some limit on how many sessions from the one computer can be handled. I thought initially that it might have been an issue with some spfile parameters but I'm thinking now that it must be either how APEX handles requests from the same machine or some network/http issue? As I said, when it come to http sessions etc, I am no guru!!
    Thanks for any help!

    Sounds like those browser windows are using the same OS process. Did you start them with CTRL-N ? Try starting them from the Start menu. If they aren't using separate processes they'll share cookies and that would result in the kinds of things you described.
    Scott

  • ?x=y arguments to URLs, sessions and JSF

    An on-line magazine would like their subscribers to be able to access, and bookmark articles with URLs such as
    http://www.example.com/article.jsf?article_id=12345
    Users shall be able to e-mail these URLs to their friends. When clicking on the received URL, the friend shall be directed directly to the article.
    However, accessing any article requires registration (so "directly" here means "directly after logging in, potentially after a new user registration step").
    I'm stumped about how to pass the "?article_id=12345" around in a JSF context. I cannot find any examples. The Servlet examples don't seem to apply.
    (My application is not an on-line magazine but the structure of the problem is the same, so I used this well-known example).

    Turns out this very web application -- the sun forum system -- has exactly the problem that I described: URLs encode the identity of the forum or post using URL arguments so the URLs can be bookmarked, but at least for certain functionality, a session is required.
    How does one do that using JSF?

  • Multiple session problem

    Hi,
    I am using Sen One WEb Server 6.1 as web server, if i am logging in using two different browser instances with two different userids but web container is maintaining only one instance. could you pls help me in solving this.
    Thanks in advance
    chandra

    chandra,
    I think this problem is not related to the container. This is a browser problem!
    What kind of login mechanis do you use?
    With basic auth the browser share the login datas durign the complete browser session and ( firefox ) all tabs.
    IMHO the only way to solve this is, to use form based auth and don't use cookies for the sessiontracking. So you get the session in the url and this url isn't shared like cookies and basic auth informations.
    regard Dietmar

Maybe you are looking for