Spring framework - Error with session scoped Beans

Hello guys,
I'm trying execute my Java Application inside Netweaver Application Server, but I'm having problems with serviceBeans with scope session. Anyone have already used Spring with session scope?
Thanks,
Cleiton.

After many attempt, when I declared the bean with <aop:scoped-proxy  /> it works, however it could cause performance problem. I don't need refer this bean by another singleton bean, i did a wrong configuration in order to make a work a round...
When I run my application on tomcat server, the DWR starts perfectly the "session scope bean form IOC container", but in the WEBAS maybe it's running in other thread. Is it possible?
Anyone had a problem like this?
I got a detailed error with log4j,
ERROR Application [1] org.directwebremoting.impl.DefaultCreatorManager - Error loading class for creator 'SpringCreator[CounterSpringFacade]'.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterSpringFacade': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:312)
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
     at org.directwebremoting.spring.SpringCreator.getInstance(SpringCreator.java:145)
     at org.directwebremoting.spring.SpringCreator.getType(SpringCreator.java:107)
Edited by: Cleiton dos Santos Garcia on Jan 7, 2009 5:02 PM

Similar Messages

  • Using Query String Parameters with Session Scoped bean

    I would like to pass query string parameters from a product page (user clicks on a specific product commandLink) that is request scope to a details page that is session scoped.
    The problem is that the session scoped page only handles the first request. If you view the details of a product and then navigate back to the product page and choose another product ... the details page will not handle the new query string parameters and display the details for the first product chosen.
    Is there a way to make the session scoped bean recognize the query string parameters past the first request?

    I was able to replicate this problem with a very simple app that performs a redirection... just like the real app. Here's the simple app that I put together:
    From request scope page:
    <f:view>
             <h:form>
               <h:commandButton value="Link 1" action="#{reqbean.Link1}"/>
               <br/><br/>
              <h:commandButton value="Link 2" action="#{reqbean.Link2}"/>
            </h:form>
           </f:view>
    From request scope bean:
    public String Link1() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=1");
        return null;
      public String Link2() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=2");
        return null;
      }At this point... I put a println in the constructor of the session scoped bean because this is where I want to get the query string params. The constructor only gets called the first time a redirect is performed.

  • Add FacesMessage to FacesContext in an session scoped bean HOWTO?

    I have an simple question. How can I add an FacesMessage to the FacesContext in a session scoped bean.
    This code works fine for request scoped beans.
    String message = "Some message";          
    FacesMessage curentMessage = new FacesMessage(message, message);
    curentMessage.setSeverity(FacesMessage.SEVERITY_ERROR); //Mark as ERROR
    context.addMessage(�userForm�, curentMessage);          When I change bean scope to "session" I am getting java.lang.IllegalStateException at the last line when adding message to context.
    Thanks:
    -- Nermin

    I have an simple question. How can I add an
    FacesMessage to the FacesContext in a session scoped
    bean.
    This code works fine for request scoped beans.
    String message = "Some message";          
    FacesMessage curentMessage = new FacesMessage(message,
    message);
    curentMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
    //Mark as ERROR
    context.addMessage(�userForm�, curentMessage);          When I change bean scope to "session" I am getting
    java.lang.IllegalStateException at the last line when
    adding message to context.
    Thanks:
    -- NerminHow do you get "context"? If you are storing it as an instance variable of the bean, then you
    should expect to get an exception. The FacesContext is scoped only to one request. Instead
    of storing it in the bean, use FacesContext.getCurrentInstance() each time you need to use it.

  • NullPointerException When trying to Get Session Scoped Bean data in another ManagedBean

    hello
    i wont to access to some data in my session scoped bean from a request bean so when i try to get this data all i get is 
    com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection
    on managed bean «discussionlaoder»
    in the end of the exception there is
    Caused by: java.lang.NullPointerException at Hiber.discussionlaoder.init(discussionlaoder.java:35)
    this is my code:
    1-the request scoped bean
    @ManagedBean
    @RequestScoped
    public class discussionlaoder {
      private MyadmninHelper halper;
    @ManagedProperty(value="#{serviceBean}")
         private ServicesBean  serviceBean;
        @PostConstruct
        public void init() {
          halper=getServiceBean().getHalper();  // line 35
    //seter and geter code
    2-the sesions scoped bean
    @ManagedBean (eager=true)
    @SessionScoped
    public class ServicesBean {
        private MyadmninHelper halper;
    //seter and geter code
    am using glassfish server 3.1
    thank's for help

    What you need to do is fix all those typos in your code, then you don't have to override names.
    - the proper Java class name is DiscussionLoader, not discussionlaoder (fix english typo also)
    - if you want to inject a class named ServicesBean, then also call the property the same.
    @ManagedProperty
    public ServicesBean servicesBean;
    But what you're doing now is call the class 'ServicesBean' and then in your managed bean declaration you seem to change your mind and it should all of a sudden be 'serviceBean'. Well then rename the class so you don't have your typo anymore!

  • Are session-scoped beans singleton

    Hi all, I miss something in the bean lifecycle within JSF. Assume that a page action navigates toward another page, linked to a session-scoped bean: this is created for the duration of this session. Then a button leads back to the original page, so that another action will lead to another page with its associated bean. Is this a new bean or the previous one ?
    This question is linked to the topic of bean dependencies through managed properties: it works fine, but since a bean is declared per class and not per instance, I miss the overall instantiation philosophy.

    Once the bean is created the first time in session, it will not be created again (until the session dies and you attempt to access the bean again of course).
    So in your scenario, the first time you access the page the bean gets created. When you go back and then go forward to the page again, a new bean is not created. The originally created one is re-used. Which means the constructor is not called again.
    CowKing

  • Unexplainable Error with Session...SIMPLE, but unexplainable..!!

    I can't understand why Session maintaining between my Servlet and another Jsp page worked when I tried everything with Tomcat 5.5.
    ..until I decided to restart Tomcat, and it worked no more..!!
    The problem, now, is that Jsp page can't recognize user's ID passed with Session Object ( It says "Utente:null" in top of the page)
    SERVLET's CLASS
    public class Login extends HttpServlet{
         private Connection con;
         private Statement st;
         private ResultSet rs,rs2;
         public void doGet(HttpServletRequest req,HttpServletResponse res) {
              try{
              Class.forName("com.mysql.jdbc.Driver");
              con=DriverManager.getConnection("jdbc:mysql://localhost:3306/gecoprova","root","argoilcane");
              st=con.createStatement();     
              rs=st.executeQuery("SELECT * FROM anagrafe_procuratori WHERE ragsoc='"+req.getParameter("ID")+"'");          
              if(rs!=null){
                   if(rs.next())try {
                        st=con.createStatement();
                        rs2=st.executeQuery("SELECT * FROM privilegi_procuratore WHERE (userid='"+req.getParameter("ID")+"' AND pass='"+req.getParameter("pass")+"')");
                        if(rs2!=null){
                             if(rs2.next())try {
                                            HttpSession session=req.getSession();
                                            String ID=req.getParameter("ID");
                                            String pass=req.getParameter("pass");
                                            session.putValue(ID,ID);
                                            session.putValue(pass,pass);                    
                                            rs2.close();     
                                            con.close();
                                                    res.sendRedirect("Inserimento.jsp");
                   }catch (Exception e){e.printStackTrace();}
                   res.sendRedirect("errorlogin.html");
              else{
                   res.sendRedirect("errorlogin.html");
                   }catch (Exception e){e.printStackTrace();}
                   res.sendRedirect("errorlogin.html");
              else{
                   res.sendRedirect("errorlogin.html");
              res.sendRedirect("errorlogin.html");
              catch(Exception e){
                   try {
                        e.printStackTrace();
                        res.sendRedirect("errorlogin.html");
                   catch(Exception e1){}
    JSP PAGE
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <link rel="stylesheet" href="emx_nav_left.css" type="text/css">
    <style type="text/css">
    <!--
    .Stile6 {font-style: italic; color: #FF0000; font-size: 12px; }
    .Stile17 {
         color: #0033FF;
         font-weight: bold;
    .Stile15 {
         color: #FF0000;
         font-weight: bold;
    .Stile18 {color: #FFFFFF; font-weight: bold; }
    .Stile19 {color: #007FAA}
    .Stile21 {
         color: #007FAA;
         font-weight: bold;
         font-style: italic;
    .Stile22 {color: #FF0000}
    .Stile23 {
         color: #FFFFFF;
         font-style: italic;
         font-weight: bold;
    .Stile25 {font-size: 130%}
    .Stile34 {color: #FFFFFF}
    .Stile35 {font-size: 24px}
    .Stile36 {color: #000000}
    -->
    </style>
    <head>
    <title>Administrator Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    </head>
    <body>
       <%
         HttpSession ses=request.getSession();
       if (ses.getId()!=null){
         out.print("Utente: ");
         out.println(ses.getValue("ID"));
    %>
         <p>
         </p> 
         <div align="right"><form action="Redirect" method="get">
           <br>
          <input name="submit5" type=submit class="Stile21" value="INSERIMENTO nuovi UTENTI" />
          <input type=hidden name="session" value="<%= request.getParameter("session") %>" />
          </form></div>
    <td align="right">�</td>
        </p>
    <tr>
      <td> 
      <td align="right"><br>
    </tr><tr>
    <tr>
                   <form action="InsertDelOrder" method="get">
                   <tr>
                   <td width=286> <h2 align="center" class="Stile15">� </h2>
                     <div align="center">
                       <table width="769" border="1" bordercolor="#999999" bgcolor="#007FAA">
                      <tr>
                        <td width="286" height="28" bordercolor="#FFFFFF" bgcolor="#007FAA" class="Stile18 Stile34" border="1"><span class="Stile35"><font color="#FFFF00">Inserimento Ordine </font></span> </td>
                      </tr>
                    <tr> </tr>
                    </table>
                    </div>
                   <td align="right"></td>
              </tr>
                  <td>
                     <div align="center">
                    <table width="769" border="1" bordercolor="#FFFFFF" bgcolor="#007FAA">
                       <tr>
                        <td width="315" class="Stile18"  >ID ordine : </td>
                        <td width="438" align="right"><input type=text name="idordine" /></td>
                      </tr><tr>
                        <td width="315" class="Stile18"  >Data ordine : </td>
                        <td width="438" align="right"><input type=text name="data" /></td>
                      </tr>
                      <tr>
                        <td class="Stile18">Data consegna pattuita : </td>
                        <td width="438" align="right"><input type=text name="consegna" /></td>
                      </tr>
                    </table>
                    <table width="769" border="1" bordercolor="#FFFFFF" bgcolor="#007FAA">
                      <tr>
                        <td width="315" height="28" class="Stile18"> Percentuale: </td>
                        <td width="438" align="right">
                          <input type=text name="percentuale" />
                        </td>
                      </tr>
                      <tr>
                        <td width="315" height="28" class="Stile18"> Sconto: </td>
                        <td width="438" align="right">
                          <input name="sconto" type=text />
                        </td>
                      </tr>
                      <tr> </tr>
                        </table>
                    <table width="769" height="87" border="1" bordercolor="#FFFFFF" bgcolor="#007FAA">
                      <tr>
                        <td width="315" class="Stile18">Nome dipendente (presente nel DB): </td>
                        <td width="438" align="right"><input type=text name="nome" /></td>
                      </tr>
                      <tr>
                        <td class="Stile18">Cognome dipendente (presente nel DB): </td>
                        <td width="438" align="right"><input type=text name="cognome" /></td>
                      </tr>
                            <tr>
                        <td class="Stile18">Fornitore : </td>
                        <td width="438" align="right"><input type=text name="fornitore" /></td>
                      </tr>
                    </table>
                    <table width="769" height="63" border="1" bordercolor="#2F0044" bgcolor="#007FAA">
                      <tr>
                        <td width="36" class="Stile23">Note</td>
                        <td width="720"><div align="center">
                          <input type=text size="120" name="note">
                      �</div></td>
                      </tr>
                    </table>
                    </div>
                  <tr>
                                                                                     <td width="191" class="Stile19">�</td>
                          <td width="189" align="right" class="Stile19">�  </td>
                   <tr>
                  <td width="191" class="Stile19">�</td>
                      <td width="189" align="right" class="Stile19">�  </td>
                      </tr><tr>
                      <td width="191" class="Stile19">�</td>
                      <td width="189" align="right" class="Stile19">�  </td>
                      </tr><tr>
                      <td width="191" height="28" class="Stile19">�</td>
                      <td width="189" align="right" class="Stile19">�  </td>
                      </tr><tr>
                      <td width="191" height="28" class="Stile19">�</td>
                      <td width="189" align="right" class="Stile19">�  </td>
                   </table>                                         
                   <br>
                      <br>
            </tr><tr></tr><tr>
                      </tr><tr>
                      </tr><tr>
                      </tr><tr>
            <td>�</td>
                   <td class="Stile21">
                     <input type=hidden name="session" value="<%= request.getParameter("session") %>" />
                  <input name="submit1" type=submit class="Stile21" value="Inserisci Ordine"   submit>
                </td>
                     </tr>
    <tr><br>
      <br>
    </form>
    </tr>
    <tr><br>
    </tr>
    <tr><br>
    </tr>
                   <tr>
                   <td> <h2 class="Stile25"> Cancellazione ordine</h2>
                     <td align="right">
              </tr><tr>
    <tr>
                   <form action="InsertDelOrder" method="post">
                    <td><input name="submit22" type=submit class="Stile21" value="Cancella ordine" /></td>
                    <tr>
                  <td width="191" class="Stile17"> ID Ordine </td>
                      <td width="189" align="right"> <input type=text name="IDord"> </td>
                      </tr><tr>
                       <td></td>
                   <td align="right"><input type=hidden name="session" value="<%= request.getParameter("session") %>"></td>
                   </tr>
                </form>
      <br>
                    <hr>
    </tr>
                  <div align="center"><br>
    </div>
                  <h2 align="center" class="Stile25 Stile36"> Interrogazioni DB </h2>
                    <div align="center"><br>
    </div>
                    <form action="Query.jsp">
                     <div align="center">
                      <input name="submit232" type=submit class="Stile17" value="Visualizza pratiche associate all operatore" />
                      <input type=hidden name="session" value="<%= request.getParameter("session") %>">
                       <input type=hidden name="my_query" value="SELECT * FROM affidamenti_procuratore WHERE anagrafe_procuratore_ID=32">
                     �               
                       </div>
                    </form>
                     <form action="Query.jsp">
                      <div align="center">
                          <input name="submit23" type=submit class="Stile17" value="Visualizza ordini gi� splittati" />
                          <input type=hidden name="session" value="<%= request.getParameter("session") %>">
                        <input type=hidden name="my_query" value="SELECT * FROM ordine WHERE flag=1">
                    </div>
                     </form>
                     <div align="center"><br>
    </div>
                     <form action="Query.jsp">
                       <div align="center">
                     <input name="submit232" type=submit class="Stile17" value="Visualizza fatture di merce NON ANCORA inviata" />
                     <input type=hidden name="session" value="<%= request.getParameter("session") %>">
                         <input type=hidden name="my_query" value="SELECT * FROM fattura WHERE inviato=0">
                         </div>
                     </form>
                     <form action="Query.jsp">
                      <div align="center">
                           <input name="submit23" type=submit class="Stile17" value="Visualizza fatture della merce inviata" />
                           <input type=hidden name="session" value="<%= request.getParameter("session") %>">
                        <input type=hidden name="my_query" value="SELECT * FROM fattura WHERE inviato=1">
                    </div>
                     </form>
                       <div align="center"><br>
                         </div>
                     <form action="Query.jsp">
                        <div align="center">
                          <input name="submit23" type=submit class="Stile17" value="Visualizza fatture NON ANCORA pagate" />
                          <input type=hidden name="session" value="<%= request.getParameter("session") %>">
                        <input type=hidden name="my_query" value="SELECT * FROM fattura WHERE pagato=0">
                      </div>
                    </form>
                     <form action="Query.jsp">
                       <div align="center">
                      <input name="submit232" type=submit class="Stile17" value="Visualizza fatture pagate" />
                      <input type=hidden name="session" value="<%= request.getParameter("session") %>">
                       <input type=hidden name="my_query" value="SELECT * FROM fattura WHERE pagato=1">
                     �                
                       </div>
                     </form><br>
                   <form action="Query.jsp">
                        <div align="center">
                          <input name="submit23" type=submit class="Stile17" value="Visualizza clienti conosciuti (Nome & Cognome)" />
                          <input type=hidden name="session" value="<%= request.getParameter("session") %>">
                        <input type=hidden name="my_query" value="SELECT * FROM dipendente">
                      </div>
                    </form>
                     <form action="Query.jsp">
                       <div align="center">
                      <input name="submit232" type=submit class="Stile17" value="Visualizza aziende clienti conosciute" />
                      <input type=hidden name="session" value="<%= request.getParameter("session") %>">
                       <input type=hidden name="my_query" value="SELECT * FROM azienda">
                     �                
                       </div>
                     </form>
                <div align="right">
                </div>
            <h2 align="right" class="glink">�</h2>
    <div align="right">
      <div align="left">          </div>
    </div>
            <h2 align="right" class="glink">�</h2>
    <form action="Login" method="post">
       <h2 align="right" class="glink"><span class="Stile10 Stile22">Disconnetti�</span>
    <input type="hidden" name="session" value="<%= request.getParameter("session") %>" />
      <input name="submit2" type="submit" class="Stile21" value="Logout" />   
      </h2>
      </div>
      </h2>
       <h2>� </h2>
    </form>
    <%}
    else
    response.sendRedirect("index.html");
         %>          
    </body>
    </html>

    It's OK to ask questions.
    But I gotta say that this is not very-well designed code. Honestly, it hurts my eyes to look over it. It is almost impossible something not to go wrong with that code. Here's some tips :
    1. Instead of using private instance fields for db connection parameters, use the ServletConfig or ServletContext parameters.
    2. use get/set/removeAttribute instead of put/getValue. Those methods are deprecated.
    3. Your JSP relies heavily on hidden form fields. Any client with just a right click on your jsp, and View Source, will get a look of your underlying database implementation. And that is not good :).
    4. Try not to add many responsibilities to the JSP. JSP are there for presentation, servlets do all the logic. Also, avoid using scriplets in your JSP. Use the Expression Language and JSTL, instead.
    Apply those tips, and you'll see how your code will be less error-prone.
    Have fun,
    Ice

  • Create session scoped bean in servlet?

    I am working on a log in porgram for a jsp page using servlet.
    I need to create a bean in that servlet after user enter correct username and password, and the bean must have scope of session.
    How do I do this?
    How do I control the scope of variables in a servlet?
    thank you

    come on people! i just answered this 2 minutes ago! search the forums first! or a servlet book.
    servlet...
    Bean bean = new Bean();
    bean.setValue("value");
    request.getSession().setAttribute("bean", bean);
    jsp...
    <jsp:useBean id="bean" class="Bean" scope="session" />
    <%= bean.getValue() %>
    OR
    <%
    Bean bean = (Bean)session.getAttribute("bean");
    %>

  • Composite invoking Spring Context errors with Missing class indicator field

    Hi. I’m working on a composite with a Spring Context component that is referenced in a BPMN process and have run into some issues and I was hoping you may have some insight.
    I’m able to deploy the composite successfully, however when I try testing it on the SOA Server, it fails with the exception below:
    <auditQueryPayload auditId="17008" ciKey="12">
    <dataState>
    <dataObject name="FaultMessage" isBusinessIndicator="false">
    <value> com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}remoteFault} messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage} parts: {{ summary=<summary>Exception [EclipseLink-44] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DescriptorException Exception Description: Missing class indicator field from database row [UnmarshalRecord()]. Descriptor: XMLDescriptor(com.bea.infra.events.ExtendedData --> [DatabaseTable(ns2:ExtendedData)])</summary> ,detail=<detail> Exception Description: Missing class indicator field from database row [UnmarshalRecord()]. Descriptor: XMLDescriptor(com.bea.infra.events.ExtendedData --> [DatabaseTable(ns2:ExtendedData)])</detail>} </value>
    </dataObject>
    </dataState>
    </auditQueryPayload>
    The class referenced in the error, ExtendedData, is a very simple, abstract class. Here it is:
    @XmlSeeAlso( { AssetUnregistered.class, ExtractionReassign.class,
    RelatedAssetRegister.class, ExtractionSubsequentNotify.class,
    ExtractionIntialNotify.class, AssetSubmission.class,
    ExtractionStatusChanged.class, MultiUse.class,
    ALERExtendedData.class })
    public abstract class ExtendedData {
    Do you have any thoughts or would know someone who could help?
    Thanks,
    Mike

    I've tried adding the jar to the classpath, installing the jar on the weblogic server, adding all the dependencies, and adding the jar to the project sourcepath. None of these worked either. Any Help would be appreciated.

  • EJBC error with CMP enitity beans

    Hi All,
    I am using weblogic 6.1 with ejb 2.0. I have defined 3 cmp fields in my ejb-jar.xml file and have corresponding get and set methods defined in my bean class for each cmp field. I am able to compile the bean, but get this ejbc error which i cannot understand.
    ERROR: Error from ejbc: In EJB IndustryEjb, Abstract get and set methods must be defined for each CMP Field. method: 'getIndCode' is missing.
    I do have getIndCode() defined as follows...
    public String getIndCode() {
    return indCode;
    is the error coming because i have not declared them as abstract?
    Please help, i cannot see where I have gone wrong.
    Niranga

    ERROR: Error from ejbc: In EJB IndustryEjb, Abstract get and set methods must be defined for each CMP Field. method: 'getIndCode' is missing. In the remote/local interface the method should be
    public int getIntCode();
    In the Bean class the method should be
    public abstract int getIntCode();

  • Error with nvoking a bean using jsp

    Hi,
    I am getting following excepion:
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSPE:\e-data\tomcat40\bin\..\work\localhost\examples\jsp\SimpleJSPBean_jsp.java:59: Undefined variable or class name: counter
    out.print( counter.getCounter() );
    ^
    1 error
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
    at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:523)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:175)
    at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:187)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
    at java.lang.Thread.run(Thread.java:484)
    My bean code is as follows:
    package test;
    import java.io.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    public class SimpleJSPBean extends HttpServlet
    implements Serializable
    private long m_counter=0L;
    public long getCounter(){
    return m_counter;
    public void service (HttpServletRequest req, HttpServletResponse res)
    throws IOException, ServletException
    m_counter++;
    & jsp code is :
    <html>
    <body>
    <BEAN name="counter" scope="session"
    type="test.SimpleJSPBean" create="yes" introspect="yes'>
    </Bean>
    You have accessed this page
    <%= counter.getCounter() %> times
    </body>
    </html>
    Zulfi.

    Following error occurred:
    A Servlet Exception Has Occurred
    Exception Report:
    javax.servlet.ServletException: Cannot create bean of class test.SimpleJSPBean
         at org.apache.jsp.SimpleJSPBean_jsp._jspService(SimpleJSPBean_jsp.java:71)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
         at java.lang.Thread.run(Thread.java:484)
    Root Cause:
    java.lang.ClassNotFoundException: class test.SimpleJSPBean : java.lang.IllegalAccessException: test.SimpleJSPBean
         at java.beans.Beans.instantiate(Beans.java:211)
         at java.beans.Beans.instantiate(Beans.java:51)
         at org.apache.jsp.SimpleJSPBean_jsp._jspService(SimpleJSPBean_jsp.java:69)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:200)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
         at java.lang.Thread.run(Thread.java:484)
    Zulfi.

  • Error with invoking a bean

    Hi,
    I am getting following excepion:
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSPE:\e-data\tomcat40\bin\..\work\localhost\examples\jsp\SimpleJSPBean_jsp.java:59: Undefined variable or class name: counter
    out.print( counter.getCounter() );
    ^
    1 error
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:523)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:175)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:187)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
         at java.lang.Thread.run(Thread.java:484)
    My bean code is as follows:
    package test;
    import java.io.*;
    import javax.servlet.http.*;
    import javax.servlet.*;
    public class SimpleJSPBean extends HttpServlet
    implements Serializable
    private long m_counter=0L;
    public long getCounter(){
    return m_counter;
    public void service (HttpServletRequest req, HttpServletResponse res)
    throws IOException, ServletException
    m_counter++;
    & jsp code is :
    <html>
    <body>
    <BEAN name="counter" scope="session"
    type="test.SimpleJSPBean" create="yes" introspect="yes'>
    </Bean>
    You have accessed this page
    <%= counter.getCounter() %> times
    </body>
    </html>
    Zulfi.

    Its not obligatory for me to use Bean tag. I have modified my JSP:
    <html>
    <body>
    <jsp:useBean id="counter" scope="session" class="test.SimpleJSPBean" /jsp:useBean>
    You have accessed this page
    <%= counter.getCounter() %> times
    </body>
    </html>
    & bean
    stored in
    examples\WEB-INF\classes\test directory.
    is given below:
    package test;
    public class SimpleJSPBean {
    public int count;
    SimpleJSPBean(){
    count=0;
    public int getCount() {
    return count;
    public void setCount() {
    count=9;
    count++;
    I am getting following error:
    A Servlet Exception Has Occurred
    org.apache.jasper.compiler.ParseException: E:\e-data\tomcat40\bin\..\webapps\examples\jsp\SimpleJSPBean.jsp(2,69) Attribute has no value
         at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:567)
         at org.apache.jasper.compiler.JspReader.parseTagAttributesBean(JspReader.java:620)
         at org.apache.jasper.compiler.Parser$Bean.accept(Parser.java:642)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1126)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1091)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:1087)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:220)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:207)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:523)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:175)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:187)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:379)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:453)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:254)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:194)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:255)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:225)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2252)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:446)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:875)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:952)
         at java.lang.Thread.run(Thread.java:484)
    Zulfi.

  • Session scoped beans other than SessionBean1

    Let's say I want to provide a logout action. I can end the session by using the below in my logoutButton_action method:
    try {
    FacesContext context = FacesContext.getCurrentInstance();
    HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
    session.invalidate();
    this.getExternalContext().redirect("Page1.jsp");
    } catch (Exception e) {
    log("Logout exception: " + e.getMessage());
    I would not have been able to figure out even that much if it wasn't for this forum. BUT, what about if I have other managed beans (i.e. just plain classes registered in managed-beans.xml) that have session scope, such a class to a hold a logged-in user's details during the session. How do I destroy that when the user logs out?

    {color:#333399}*hi*
    you can set any Object in ur sessionBean1 to be NULL,, by this way , ur session will hold no more data.
    {color}

  • PLZ Help: how to get value of a request scoped Bean/Attribute in JSF ?!!!

    hi,
    I noticed this part of code to retrieve session scoped beans/vars in an ActionListener or other jsf classes, but it does not work for request scoped beans/vars :( what's the problem then ? what shall i do ?
    Type var = (Type)Util.getValueBinding("myBeanInRequest")).getValue(context);
    I have also set that getPhaseId() returns UPDATE_MODEL_VALUES or APPLY_REQUEST_VALUES.
    Any comment or idea ?

    I have declared my Bean in my JSP page not in the
    faces-config.xml. Does this make any problem ? Also I
    have tried the way you told me as well, but still the
    returned attribute is null.
    P.S. My bean is declared in my JSP page this way:
    <jsp:useBean id="newSurveyVar" class="SurveyModel"
    scope="request" />
    This declaration causes the SurveyModel instance to be created in request scope when the page is rendered, but that doesn't help you when the form is submitted -- that is going to happen on the next request (so the request attribute created here goes away). Basically, <jsp:useBean> is not typically going to be useful for request scope attributes (it's ok for session or application scope, though).
    and further I have this jsf code:
    <h:command_button label="Create" commandName="create"
    action="create" >
    <f:action_listener
    r type="CreateNewSurveyActionListener"/>
    </h:command_button>
    and this is my
    CreateNewSurveyActionListener.processAction(ActionEvent
    e) {
    if (actionCommand.equals("create_the_survey")) {
    FacesContext context =
    t = FacesContext.getCurrentInstance();
    SurveyModel survey =
    y =
    (SurveyModel)(Util.getValueBinding("newSurveyVar")).get
    alue(context);
    if (survey==null) // returns true :(((
    And since I've declared my beans here there is nothing
    special declared in my faces-config.xml
    For me again it is really strange why it is not
    working !!!
    Any idea ? Because the event listener is fired in a separate request, so the one you created in the page is gone.
    This is why the managed bean creation facility was created. If your component contains a valueRef that points at the bean name (or you evaluate a ValueBinding as illustrated earlier in the responses to your question), then the bean will get instantiated during the processing of the form submit.
    Craig McClanahan

  • JSF problem Session Scoped and dialog

    Hello All! i have one problem with using ajax and session scoped .
    I'm using JSF 2.0 and Primefaces for build 2 dialog.
    I have one icon to click on it dialog 1 will display and show all list of customers and when i click details of customer on dialog 1, dialog 2 will display , and details of customer show base on <h:form>
    but my problem is when i click details of customer with id #1 it not show details of customer it return null, i must refresh this page and click on customer #1 and it display, but when i click on customer with id #3 it still display customer with id #1,and i must refresh page again to view customer with id #3 and after that if i want see details of other customer such as customer with id #5 i must click and refresh page, after refresh page i click on any id of customer if always show the last id of customer before refresh page, it mean because i use p:commandButton with ajax and 2 dialog inside one page, i know , if using session scoped i must pass value from one page to another page. But i want get id in the same page with session scoped this mean when i use p:commandButton call dialog 2 for pass id value from dialog one to dialog two it will get value don't refresh page . How can i do it? or can i call dialog from another show on the same page contain dialog 1?
    Primefaces dialog http://www.primefaces.org/showcase/ui/dialogHome.jsf

    Hello All! i have one problem with using ajax and session scoped .
    I'm using JSF 2.0 and Primefaces for build 2 dialog.
    I have one icon to click on it dialog 1 will display and show all list of customers and when i click details of customer on dialog 1, dialog 2 will display , and details of customer show base on <h:form>
    but my problem is when i click details of customer with id #1 it not show details of customer it return null, i must refresh this page and click on customer #1 and it display, but when i click on customer with id #3 it still display customer with id #1,and i must refresh page again to view customer with id #3 and after that if i want see details of other customer such as customer with id #5 i must click and refresh page, after refresh page i click on any id of customer if always show the last id of customer before refresh page, it mean because i use p:commandButton with ajax and 2 dialog inside one page, i know , if using session scoped i must pass value from one page to another page. But i want get id in the same page with session scoped this mean when i use p:commandButton call dialog 2 for pass id value from dialog one to dialog two it will get value don't refresh page . How can i do it? or can i call dialog from another show on the same page contain dialog 1?
    Primefaces dialog http://www.primefaces.org/showcase/ui/dialogHome.jsf

  • We should NEVER use the session back bean?

    Because the user can open a new window by right click the link, and the session scope back bean is not thread-safe.
    So we should forget it?

    Your concern makes really no sense, or you must be storing request scoped data in a session scoped bean instead of a request scoped bean, which can indeed lead to undesireable behaviour in multiple requests on the same session.

Maybe you are looking for

  • Photos Not Appearing On My Iphone

    Hi just wondering if anyone can help when i sync all my photos from iphoto through itunes onto my iphone hardly any of the photos actually appear in there albums on my iphone i select them all on itunes and it says sync complete but still hardly any

  • At end of

    hi experts i have a problem with my code: SORT i_data by lifnr grund. loop for summing quantity for each vendor and reason for movment: LOOP at i_data INTO wa_data.     if i_data-shkzg = 'H'.       i_data-erfmg = i_data-erfmg  * -1.       modify i_da

  • Using sData in C# to post sales

    Hi, I would like to anyone tried to knows where to get details on how to post sales into Sage 50 Accounting using C# and sData. Thanks, Jassim

  • 2012 SP2 FTF for GWAVA Retain

    I know that GW 2012 SP1 just came out and I'm in preparation for upgrading to it, just doing my internal testing. In working with GWAVA they've told me that there is a known issue between 2012 SP1 and their Retain email archive product that a FTF tha

  • BRI-to-PRI Connectivity issues

    I'm having some serious BRI-to-PRI connectivity issues, and I was hoping someone out there could offer some assistance. The devices call one another perfectly, but they just both send magic numbers out and never get the data from the other device so