Request in a SessionBean

Hello all !!!
I am developing an application with File Upload, using the Java Creator ONE based in servelet.com. In the example below, the archive is moved successfully, but I would like to have the name of the archive in a SessionBean for use in another page.
Somebody has an idea of as can make this?
They follow the codes:
Anexar.jsp
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page">
<jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
<f:view><![CDATA[
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
]]><html
lang="pt-BR" xml:lang="pt-BR">
<head>
<meta content="no-cache" http-equiv="Cache-Control"/>
<meta content="no-cache" http-equiv="Pragma"/>
<title>ANEXAR</title>
<link href="resources/stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body style="-rave-layout: grid">
<f:verbatim>
<form action="./pagina2" enctype="multipart/form-data" method="post">
Documento 1 <input name="file1" type="file"/>
<input type="submit"/>
</form>
</f:verbatim>
<h:form binding="#{Anexar.form1}" id="form1"/>
</body>
</html>
</f:view>
</jsp:root>
pagina2.Java
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.oreilly.servlet.*;
public class pagina2 extends HttpServlet {
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML>");
out.println("<HEAD><TITLE>UploadFile</TITLE></HEAD>");
out.println("<BODY>");
out.println("<H1>UploadFile</H1>");
// Parameters can now be read the same way for both
// application/x-www-form-urlencoded and multipart/form-data requests!
out.println("<H3>Request Parameters:</H3><PRE>");
Enumeration enum = req.getParameterNames();
while (enum.hasMoreElements()) {
String name = (String) enum.nextElement();
String values[] = req.getParameterValues(name);
if (values != null) {
for (int i = 0; i < values.length; i++) {
out.println(name + " (" + i + "): " + values);
out.println("</PRE>");
// Files can be read if the request class is MultipartWrapper
// Init params to MultipartWrapper control the upload handling
if (req instanceof MultipartWrapper) {
try {
// Cast the request to a MultipartWrapper
MultipartWrapper multi = (MultipartWrapper) req;
// Show which files we received
Enumeration files = multi.getFileNames();
while (files.hasMoreElements()) {
String name = (String)files.nextElement();
String filename = multi.getFilesystemName(name);
String type = multi.getContentType(name);
File f = multi.getFile(name);
out.println("name: " + name);
out.println("filename: " + filename);
out.println("type: " + type);
if (f != null) {
out.println(" | length: " + f.length()+"\r");
out.println("File Uploaded Successfully");
out.println();
catch (Exception e) {
out.println("Could not upload file/files");
out.print(e.getMessage());
//out.println("<PRE>");
e.printStackTrace(out);
//out.println("</PRE>");
out.println("</BODY></HTML>");
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<!--
Copyright 2002, 2003 Sun Microsystems, Inc. All Rights Reserved.
-->
<web-app>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/navigation.xml,/WEB-INF/managed-beans.xml</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>com.sun.faces.verifyObjects</param-name>
<param-value>true</param-value>
</context-param>
<filter>
<filter-name>multipartFilter</filter-name>
<filter-class>com.oreilly.servlet.MultipartFilter</filter-class>
<init-param>
<param-name>uploadDir</param-name>
<param-value>/tmp</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>multipartFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup> 1 </load-on-startup>
</servlet>
<servlet>
<servlet-name>uploadFile</servlet-name>
<servlet-class>pagina2</servlet-class>
</servlet>
<!-- Error Handler Servlet -->
<servlet>
<servlet-name>ExceptionHandlerServlet</servlet-name>
<servlet-class>com.sun.errorhandler.ExceptionHandler</servlet-class>
<init-param>
<param-name>errorHost</param-name>
<param-value>localhost</param-value>
</init-param>
<init-param>
<param-name>errorPort</param-name>
<param-value>4444</param-value>
</init-param>
</servlet>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
<!-- <url-pattern>*.faces</url-pattern> -->
</servlet-mapping>
<servlet-mapping>
<servlet-name>uploadFile</servlet-name>
<url-pattern>/pagina2</url-pattern>
</servlet-mapping>
<!-- Error Handler Servlet Mapping -->
<servlet-mapping>
<servlet-name>ExceptionHandlerServlet</servlet-name>
<url-pattern>/error/ExceptionHandler</url-pattern>
</servlet-mapping>
<!-- Welcome File List -->
<welcome-file-list>
<welcome-file>faces/Anexar.jsp</welcome-file>
</welcome-file-list>
<!-- Catch ServletException -->
<error-page>
<exception-type>javax.servlet.ServletException</exception-type>
<location>/error/ExceptionHandler</location>
</error-page>
<!-- Catch IOException -->
<error-page>
<exception-type>java.io.IOException</exception-type>
<location>/error/ExceptionHandler</location>
</error-page>
<!-- Catch FacesException -->
<error-page>
<exception-type>javax.faces.FacesException</exception-type>
<location>/error/ExceptionHandler</location>
</error-page>
<resource-ref>
<description>Rave generated DataSource Reference</description>
<res-ref-name>jdbc/Intranet</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
Regards
Alexandre Araujo

Hi,
See the below threads might helps
http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=47982
http://swforum.sun.com/jive/thread.jspa?threadID=64621&tstart=0
MJ

Similar Messages

  • Need urgent help: how to avoid concurrent calls on statefull session beans

    Hi,
    I need a little advice in designing a EJB session facade using JSPs, servlets, session and
    entity beans.
    My current design is:
    - JSP pages: here are only getMethods for the session bean used. All set-methods are handled by a
    - servlet: I have got one servlet handling several JSP pages. The servlet basically takes the
    form fields and stores them in the session bean and than dispatches to the next JSP-page
    - stateful session bean: here is, where all the business logic is conducted. There is one session
    bean per servlet using several
    - CMP entity beans: to talk to the database (Oracle 8i)
    The application server is JBoss 3.0.3.
    My problem is, if a user clicks on a submit button of a JSP page more than once before the next
    page builds up, I may get a "javax.ejb.EJBException: Application Error: no concurrent calls on
    stateful beans" error. I already synchronized (by the "session") the code in the servlet, but
    it happens in the JSP pages as well.
    I know, that Weblogic is able to handle concurrent calls, by JBoss isn't and it's clearly stated
    in the spec, that a user should avoid to have concurrent calls to a stateful bean.
    The big question is now: How can I avoid this? How can I prohibit the user to submit a form several
    times or to ignore anything, which arrives after the first submit?
    Thanks for any help,
    Thorsten.

    Synchronizing on the session is probably your best bet.
    You'll need to do all the data access and manipulation in the servlet. Cache any data you need using request.setAttribute() and then not access the EJB on the JSP page.
    If performance is an issue, you may also want to use create a user transaction to wrap all the EJB access in, otherwise each EJB call from the servlet is a new transaction. Just make sure you use a finally block to properly commit/rollback the transaction before you redirect to the JSP.
    UserTransaction utx    = null;
    synchronized (request.getSession())
      try {
        Context ctx = new InitialContext();
        utx = (UserTransaction) ctx.lookup("javax/transaction/UserTransaction");
        utx.begin();
        // ... Create session bean ...
        request.setAttribute("mydata", sessionBean.getMyData());
        try {
          utx.commit();
        catch (Exception ex) {
          log.warn("Transaction Rolled Back (" + ex.getClass().getName() + "): "
            + ex.getMessage(), ex);
        utx = null;
      } // try
      finally {
        if(utx != null)
          try {
            utx.rollback();
          catch (Exception e) {
            log.warn(e.getMessage(), e);
          } // catch
        } // if
      } // finally
    } // syncrhonized(session)

  • SessionBean is executing another request

    I get an exception from the servlet is making ejb stateful session bean calls. The message of the exception is "SessionBean is executing another request" when multiple calls from browser client are made.
    I'm using Tomcat for servlets and Sun j2EE server Reference Implementation for EJBs.
    I don't know if this is a multithread problem or some mulfunction from de ejb container.

    You can keep the reference variables as instance variables , but you have to synchronise access to this. This can be achieved by synchronized blocks or using single threaded model servlet.
    --Ashwani                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to get the value of sessionbean's properties in JSP?

    Hi,All
    I want to invoke setInterval() in JSP,and invoke clearInterval() when sessionbean's property is not null.But I don't know how to get the sessionbean's property.
    Thanks
    Smile.

    I'm not sure you can directly access a session bean from JSP.
    Although I haven't tried this with sessionBean1, you might try using JSP's useBean tag.
        <jsp:useBean id=<localName> type=<classPath> scope=<scope> />localName is the name you want to use to refer to the bean. classPath is the fully qualified class path. scope is either page, request, session, or application.
    I use this approach for accessing Java Beans. But before you can use the bean you have to add it as a session attribute. This makes it accessible to the page.
        FacesContext facesContext = FacesContext.getCurrentInstance();
        ExternalContext externalContext = facesContext.getExternalContext();
        HttpSession session = (HttpSession)externalContext.getSession(false);
        session.setAttribute(<attributeName>, <attributeValue>);You can then access the bean. I use scriptlets although you could also use JSP expressions or EL. I use scriptlets because I'm more comfortable with it.
    <jsp:scriptlet>
        Address address = (Address)session.getAttribute("Address");
        if(address != null) {
            value = address.getAddress1();
            if(value != null) {
                out.println(value);
            value = address.getAddress2();
            if(value != null) {
                out.println(" " + value);
    </jsp:scriptlet>I use this approach for accessing Java Beans. But before you can use it you have to add it as a session attribute.
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalContext = facesContext.getExternalContext();
    HttpSession session = (HttpSession)externalContext.getSession(false);
    session.setAttribute(<attributeName>, <attributeValue>);

  • Web Service Request Failed

    Hello,
    Errors in the EE 4 with RedHat ES 3.
    Web Service Request Failed
    The following fault was returned from the web service call:
    Code HTTP
    String (404)/axis/services/rpc/webtopsession
    ------ log -----
    Starting service Tomcat-Standalone
    Apache Tomcat/4.1.29
    Apr 15, 2005 12:26:03 PM org.apache.jk.common.ChannelSocket init
    INFO: JK2: ajp13 listening on /0.0.0.0:8009
    Apr 15, 2005 12:26:03 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/86 config=null
    AxisFault
    faultCode: {http://xml.apache.org/axis/}HTTP
    faultSubcode:
    faultString: (404)/axis/services/rpc/webtopsession
    faultActor:
    faultNode:
    faultDetail:
    {}string: return code: 404
    <html><head><title>Apache Tomcat/4.1.29 - Error
    report</title><STYLE><!--H1{font-family :
    sans-serif,Arial,Tahoma;color : white;background-color : #0086b2;}
    H3{font-family : sans-serif,Arial,Tahoma;color : white;background-color :
    #0086b2;} BODY{font-family : sans-serif,Arial,Tahoma;color :
    black;background-color : white;} B{color : white;background-color :
    #0086b2;} HR{color : #0086b2;} --></STYLE>
    </head><body><h1>HTTP Status 404 -
    /axis/services/rpc/webtopsession</h1><HR size="1"
    noshade><p><b>type</b> Status
    report</p><p><b>message</b>
    <u>/axis/services/rpc/webtopsession</u></p><p><b>description</b>
    <u>The requested resource (/axis/services/rpc/webtopsession) is not
    available.</u></p><HR size="1"
    noshade><h3>Apache
    Tomcat/4.1.29</h3></body></html>
    (404)/axis/services/rpc/webtopsession
    at
    org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:630)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:128)
    at
    org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2564)
    at org.apache.axis.client.Call.invoke(Call.java:2553)
    at org.apache.axis.client.Call.invoke(Call.java:2248)
    at org.apache.axis.client.Call.invoke(Call.java:2171)
    at org.apache.axis.client.Call.invoke(Call.java:1691)
    at
    com.tarantella.tta.webservices.client.apis.apache.BaseRequest.callServiceWork(BaseRequest.java:316)
    at
    com.tarantella.tta.webservices.client.apis.apache.BaseRequest.callService(BaseRequest.java:213)
    at
    com.tarantella.tta.webservices.client.apis.apache.BaseRequest.callService(BaseRequest.java:205)
    at
    com.tarantella.tta.webservices.client.apis.apache.WebtopSessionRequest.startSession(WebtopSessionRequest.java:62)
    at
    com.tarantella.tta.webservices.client.views.SessionBean.startSession(SessionBean.java:545)
    at
    org.apache.jsp.sessionmanager_jsp.createNewSession(sessionmanager_jsp.java:276)
    at
    org.apache.jsp.sessionmanager_jsp.joinSessionByClientId(sessionmanager_jsp.java:236)
    at
    org.apache.jsp.sessionmanager_jsp._jspService(sessionmanager_jsp.java:619)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
    at
    org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)
    at
    org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498)
    at
    org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:822)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:483)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at
    org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at
    org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at
    com.tarantella.tta.webservices.valves.InputFilter.invoke(InputFilter.java:74)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at
    org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
    at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at
    org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at
    org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:309)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:387)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:673)
    at
    org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:615)
    at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:786)
    at
    org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)
    at java.lang.Thread.run(Thread.java:534)

    Hello,
    We have same problem on SGD4.2 on Solaris 10 with IE HTML Client.
    Do you solve it ?
    How ?
    Please help.
    Regards.

  • Auto Login With Request Parameters

    Hello
    I am working on a test JSF application in NetBeans 5.5 using the visual web pack. Currently there are only two pages in the app, a login page and a main page.
    I am trying to figure out how I could set up an auto login to a JSF based web app. I would like the app to be able to take username and password parameters on the URL and automatically attempt to log into the app with those values. When the URL contains these parameters and they're valid, instead of displaying the login page, it would start up with the main page displayed. If the paramters were not present or invalid, the login page would be displayed.
    I've read about how to pull request parameter values into from a JSP page, but I don't think that would helpful for this case. I have instances of ApplicationBean, SessionBean and RequestBean in the project. I'm wondering if any of these would be the appropriate place to add some code to check for the parameters, attempt to login and display the correct page based on the login result.
    And advice greatly appreciated.
    Shelli

    I'll be so kind to share a basic example I've been playing with a while ago :)
    public class UserFilter implements javax.servlet.Filter {
        @SuppressWarnings("unused")
        private FilterConfig filterConfig;
        public void init(FilterConfig filterConfig) {
            this.filterConfig = filterConfig;
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
            throws IOException, ServletException
            // Check PathInfo.
            HttpServletRequest httpRequest = (HttpServletRequest) request;
            String pathInfo = StringX.trim(httpRequest.getRequestURI(), httpRequest.getContextPath());
            if (pathInfo.indexOf(PATH_INC + "/") == 0 || pathInfo.indexOf(MAIN_JSF) == 0) {
                // If include files are loaded (subviews, images, css, js) or if unfriendly URL is
                // requested somehow, then continue the chain and abort this filter. In case of
                // unfriendly URL's, the next filter in the chain is the FriendlyUrlFilter which
                // translates the URL and will redirect back to this filter.
                chain.doFilter(request, response);
                return;
            // Get UserSession from HttpSession.
            HttpSession session = httpRequest.getSession();
            UserSession userSession = (UserSession) session.getAttribute(SESSION_ID);
            if (userSession == null) {
                // No UserSession found in HttpSession; lookup SessionId in cookie.
                String sessionId = Context.getCookieValue(httpRequest, COOKIE_ID);
                if (sessionId != null) {
                    // SessionId found in cookie; lookup UserSession by SessionId in database.
                    userSession = new UserSession();
                    userSession.setSessionId(sessionId);
                    LoadQuery<UserSession> loadQuery = new LoadQuery<UserSession>(userSession);
                    try {
                        Dao.execute(loadQuery);
                        userSession = loadQuery.getOne(); // This can be null.
                        // If this is null, then session is just deleted from DB or the cookie is fake.
                        Logger.info("Loading usersession succeed: " + userSession);
                    } catch (DaoException e) {
                        Logger.error("Loading usersession failed.", e);
                if (userSession == null) { // loadQuery.getOne() can return null.
                    // No SessionId found in cookie, or no UserSession found in DB; create new UserSession.
                    sessionId = StringX.getUniqueID();
                    userSession = new UserSession(sessionId);
                    try {
                        Dao.execute(new SaveQuery<UserSession>(userSession));
                        Logger.info("Creating usersession succeed:" + userSession);
                    } catch (DaoException e) {
                        Logger.error("Creating usersession failed.", e);
                    // Put SessionId in cookie.
                    HttpServletResponse httpResponse = (HttpServletResponse) response;
                    Context.setCookieValue(httpResponse, COOKIE_ID, sessionId);
                // Set UserSession in current HttpSession.
                session.setAttribute(SESSION_ID, userSession);
            // Add hit and update UserSession.
            userSession.addHit();
            try {
                Dao.execute(new SaveQuery<UserSession>(userSession));
                Logger.info("Updating usersession succeed:" + userSession);
            } catch (DaoException e) {
                Logger.error("Updating usersession failed.", e);
            // Continue filtering.
            chain.doFilter(request, response);
        public void destroy() {
            this.filterConfig = null;
    }By the way, the 'User' DTO is wrapped in the UserSession which can be retrieved in the backing bean by:
    public User getUser() {
        return ((UserSession) Context.getSessionAttribute(SESSION_ID)).getUser();
    }If the User is not logged in, then this is null. If the user is logged in, then put the User in the UserSession object.

  • Session bean executing another request

    Dear All
    I am facing following exception in statefull session bean.
    When i acceess any function of statefull session bean concurrently.
    I am using sun ONE application Server.
    javax.ejb.EJBException: SessionBean is executing another request
    at com.sun.ejb.containers.StatefulSessionContainer.getContext(StatefulSessionContainer.java:733)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:452)
    at com.softwerc.werclet.corporate.ejb.session.corpadminwerclet.CorpAdminWercletBean_EJBObjectImpl.getWercletDeta
    ils(CorpAdminWercletBean_EJBObjectImpl.java:1245)
    at com.softwerc.werclet.corporate.ejb.session.corpadminwerclet._CorpAdminWerclet_Stub.getWercletDetails(Unknown
    Source)
    at jasper.RefreshWerclet_jsp._jspService(_RefreshWerclet_jsp.java:446)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
    at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
    at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    SEVERE: EJB5017: Exception while running preinvoke : ejbName = [CorpAdminWerclet]
    INFO: CORE3282: stdout: after SingleLoginBeanPKsoftwerc | D71AD2D8ACF0F72467AFBDFD24AF9967
    SEVERE: EJB5017: Exception while running preinvoke : ejbName = [CorpAdminWerclet]
    SEVERE:
    Nadeem Yousaf

    hi
    i am also facing the same exception in sun one app server 7.0. This is happening only in BMP Beans . Resource not available error is coming.
    If you use continously 15 minutes and above error is coming. Is problem withour code or appserver bug. CMP Beans are working fine.
    pls help.
    javax.ejb.EJBException: SessionBean is executing another request
    at com.sun.ejb.containers.StatefulSessionContainer.getContext(StatefulSessionContainer.java:733)
    at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:452)
    at LDAP.LDAPBean_EJBObjectImpl.getAllEmployees(LDAPBean_EJBObjectImpl.java:933)
    at LDAP._LDAPRemote_Stub.getAllEmployees(Unknown Source)
    at MMCampaignSearch.doGet(MMCampaignSearch.java:136)
    at MMCampaignSearch.doPost(MMCampaignSearch.java:247)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
    at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)

  • JAVASCRIPT:  Accessing the sessionbean - how ??? can it be done?

    Hi,
    I need to access the sessionBean from javawscript. I have trawled throughj all posts and have got no satisfactory code.
    Can this be done?
    I have tried for eg alert(#{sessionBean.firstName}) and get a syntax error, i assume due to # symbol. do i need to CDATA this request?
    Any help, much appreciated.
    Regards,
    LOTI

    Your problem is trying to access server side information from the client side, so that alert is never gonna work in that simple form. If you want javascript access to a sessionbean variable, that variable will have to be present in the final rendered page....meaning bring it into your page as either a visible or inviisble field and then using javascript to read that. Thats one solution?

  • Can standard JSP access Faces SessionBean and ApplicationBean? How?

    Hello,
    I have a situation where in I have some JSF based pages in my web app, along with with some standard JSP pages - these are all part of the same webapp.
    Is it possible to access the SessionBean (the web session bean that is - netbeans default is SessionBean1 which extends AbstractSessionBean) and likewise ApplicationBean(1) objects from these standard JSPs that are part of the same web application? Any help on how this could be accomplished?
    Thanks

    Scriptlets runs at another scope than JSP EL. Scriptlets runs like as a local Java method. JSP EL lookups the references in pageScope (pageContext.getAttribute()), requestScope (request.getAttribute()), sessionScope (session.getAttribute()) and applicationScope (servletContext.getAttribute()).
    'app' is not available as a local variable in scriptlets. To get it in a scriptlet, you should be doingObject app = session.getAttribute("app");
    // or rather without the useBean thing, assuming that it is been put in application scope.
    Object applicationBean1 = getServletContext().getAttribute("ApplicationBean1"); and cast it back to the desired type.
    Having said that, doing that so in a scriptlet is a bad idea. Also, your jsp:useBean tag is creating a new instance instead of reusing the ApplicationBean1, because you assigned it a different 'id' (it must be the same as the managed bean name) and you are looking it up in the session scope instead of application scope (of which I assume that the ApplicationBean1 is put in, looking at its name).
    It might be a good idea to take a step back and elaborate about the bigger picture what you're trying to accomplish. The code as you've posted as far is really a smell. Better do it in JSTL or in a Servlet instead of in a scriptlet.

  • Get all values from request.getParameter

    In ASP, I can do something like that...
    For each item in Request.Form
    Response.write "Name is:" & item & " value is:" & Request(item)
    Next
    How about in JSP? How do i get the names and values of the form using a loop?

    You can use request.getParameterNames() which will return an enumeration, then you can iterate through the enumeration and use request.getParameterValue(String paramName) method to get the values.

  • Error while releasing a request.

    Hi All,
    I'm facing an error while releasing a request.
    The request contains an ABAP programs along with two INCLUDDE programs as well as a TCode to run the same.
    It is running successfully in dev. server. But, while releasing ths request it shows me the following error :
    " Object REPT ZBAPI_SD_SERV_SALES_ORDER is inactive " ,
    where ZBAPI_SD_SERV_SALES_ORDER is the program name. When I checked out in ABAP editor it shows the program active.
    But, I'm unable to understand why its showing me an inactivation error.
    Guys, help me out in this.

    Hi,
    Check if the INCLUDE program are also ACTIVE. They must be in inactive state. Try activating them and release the request.
    Regards,
    Vikranth

  • Error:  "Could not complete your request because of a program error" (photoshop CS2 9.0.2 on MAC OSX

    Today I started my program (photoshop CS2 9.0.2) and opened a JPG file. When I went to print the file the program crashed and closed. When I restarted the program and went to open the file I got this error message, "Could not complete your request because of a program error".
    I have tried several different file types/sizes and all result in the same error message since the program crashed. It will not open any file I try to open. As I indicated above I am using Photoshop CS2 9.0.2 it is on a MAC with OSX 10.4.11.
    I called Adobe and the Rep directed me to Tech Note 331307 and told me to Re-create the Photoshop preferences files. Which I did and restarted the program, but when I tried to open a file (any file) I still get the same error message so it doesn't appear to be the preferences.
    Does anyone have any info as to what the problem may be and how to correct it.
    Thanks

    Thanks for the response. OK... This is the first day I have been able to get back to the problem.
    My system I am running Photoshop on is a Power Mac G4, AGP Graphics ATY Rage 128Pro chip set 16MB VRAM LCD 1280x1024 32-bit color, 500MHz, 1.75GB of memory, 1 MB L2 Cache, 100 MHz Bus Speed. I had installed the latest security update and repaired the permissions the day the problem started.
    Now to day I started the system and went in and created a Guest Account. I logged into the guest account and started Photoshop. Low and behold it worked just fine. So I logged out of guest and logged into my main user account And started Photoshop. Wouldn't you know it.... It works just fine. I can open any file I want with now problems.
    I got to thinking after I had done all of this that I wished I had tried to open a file in Photoshop today prior to creating the guest account to see if it still had the problem in my main user account.
    I did not change anything else on the system and all seems to work fine now. So at his point I am really not sure what the problem was.
    Again thanks for taking the time to respond to this issue.

  • Can not view data in a request from psa

    Dear experts,
    I have a problem with data in psa. If a select a mange of PSA, I see some request. I select one of them to see data. But there is no data. How is it possible?
    If you delete a reques from psa, that request desappears from the psa, doesn't it?
    Thanks in advance,
    yeberri

    it dosn't work. The problem is that you can see  different green requests in manage from psa, but it is not possible to see internal data.
    If I try to see data with se16 and the psa table, there are data for one request, but not for request that i need.
    any idea? is very important to rescue this request.
    thanks for your help.

  • Unable to capture the Data Source into a Transport Request

    Hi All,
    We have a product hierarchy and we are using the data source :4R_PRODH_D_LGEN_HIER for the hierarchy.
    Now we need to transport this structure to the quality environment but we were not able to capture the datasource:4R_PRODH_D_LGEN_HIER into a transport request.
    When ever we activate the data source:4R_PRODH_D_LGEN_HIER it is asking for the Package and the Transport Request Number.If we give these details and save it, data source is not getting captured in the request, only the "bject Directory Entry" is getting captured.
    Can someone please guide me on how to capture the datasource under "Data Sources in BW" in a transport request.
    Regards,
    Sachin Dehey.

    Hi Sachin,
    Hierarachy datasource is not captured as Attributes and Text Datasource. So what ever you have done is correct.
    What ever is captured in Object Directory Entry is correct. So go ahead with your transports, once transport is done check the Hierarchy Infopackage with Available OLTP hierarchies and load the data.
    Most important thing first see that the all Master & Transactional Datasources are transported in R/3 Dev to QA to PRD
    In BW, datasources are not transported, only their replica is transported.
    Transportation of Datasource is done in R/3. Only their replica is transported in BW.
    So wht ever you have done till now is correct. So go ahead.
    While attaching Hierarchy Datasource it is captured only in "Object Directory Entry"
    Regards,
    Vishnu.

  • EH&S WWI for GLM print request processing

    Hi all,
    we installed EH&S WWI for GLM print request processing scenario, following the note:"1394553", but when we try to print we receive this error from WWI:
    Start Function 'WWI_PRINTREQUEST_CREATE'
      Initializing parameters
      Receiving data from client
       calling RfcGetData returned 0
        receiving data lasted: 0.0 sec.
        Retrieving print request data from RFC interface
        Using Temp Directory E:\WWI\TEMP\BSV100000000000062
       Delete files in E:\WWI\TEMP\BSV100000000000062
        Creating text file E:\WWI\TEMP\BSV100000000000062\r000000000062.val
        Writing data to text file 39 lines, 1009 characters
        Updating print request status from 0 to 1
        [DB time] Writing print request lasted 9 ms
      Start processing command 'Create print request' in synchronous mode
      Creating print request 000000000062
    WwiSapDms::retrieveDocument: RFC error when calling ABAP function moduleRFC connection is not Unicode
    WwiSapDms::retrieveDocument: RFC error when calling ABAP function module
    key     : RFC_ERROR_SYSTEM_FAILURE
    message : See RFC trace file or SAP system log for more details
    Reading SBV document IB0120510 from Cache failed
        WwiCacheRead resulted with -1
        Updating print request status from 1 to 5
        [DB time] Writing print request lasted 4 ms
      ##### Command 'Create print request' finished with status E #####
        Storing ERR file E:\WWI\TEMP\BSV100000000000062\l000000000062.err into DMS succeeded
        22 lines
      Sending data to client
       calling RfcSendData returned 0
        sending data lasted: 0.0 sec.
    Elapsed time : 0.1 sec.
    We don't understand what kind of RFC or what part of customizing we have to check, could you please help us?
    Thanks,
    Christian

    Dear Pugal
    we are not using GLM + and I am not sure about the technqiue used there to handle load balancing. Regarding general WWI setup I assume you know this Note: EH&amp;amp;S: Availability and performance of WWI and Expert servers
    On the top there is a further SAP Note abvailable which might be of interest. This is referenced here:
    http://de.scribd.com/doc/191576739/011000358700000861002013-e
    May be check OSS note: 1958655; OSS Note 1155294 is more related to normal WWI stuff; but may be check it as well. May be 1934253 might help better
    May be this might help.
    C.B.
    PS: may be check as well: consolut - EHS_MD_140_01 - EH&amp;amp;S-Management-Server einrichten
    The load balancing of synchron WWi servers is donein the "RFC" layer, therefore you have no inffluence here, for asynchron WWI servers you can do a lot to manage the WWI load balancing by using "exits" etc.

Maybe you are looking for

  • How do i transfer iTunes  from one Macbook to another?

    Hello. How can I transfer my itunes account from one Macbook to another.  They are not in the same household for sharing etc. Please advise.

  • ITunes Library and apple TV

    I have recently bought my self - Mac Mini - Time Capsule - Apple TV My objective is to be able to run the mac mini as a media center for the living room television and the apple tv to have access to the movies in a different room. The point of the ti

  • Can I recover lost app data after restore?

    Hi everyone and thank you in advance to anyone who can offer some help! Apple recently told me some issues I was having with my phone were software based and they refused to issue me a replacement phone until I attempted to setup the phone as a new p

  • IWeb File Saving Location?

    I want to backup my iWeb files as I do most of my data. Trouble is I cant find where Apple stores my site files, it just magically happens. Anyone figure this out yet? Also, could these file(s) be stored on .mac itself allowing editing from multiple

  • Compounding Attribute Issue

    Hello Experts, I have the following scenario and need some guidance/feedback on this. ZOCDIPN Masterdata IO has ZOCDSTTEM as Nav.attribute. ZOCDSTTEM has 0SOLD_TO compounded to it. I wasn't sure why this was modeled in this way earlier. But, now the