Link to home
Start Free TrialLog in
Avatar of COMPSUPP
COMPSUPP

asked on

bean not found within scope on tomcat

Hello,

My web app works fine on my localhost and when deployed as a war file to Oracle Application Server. We are now trying to switch from OAS to Tomcat 5.5.

I am seeing the error 'javax.servlet.ServletException: bean BTListGridSpeciesKeySitesBean not found within scope'.

I am putting the bean in the session in a servlet and then using the <jsp:useBean/> tag as below. Why can't it get the bean out of the session again ?

As this works on my localhost and OAS I am wondering if tomcat does not like the way the war file is packaged. The tomcat log says:

INFO: Deploying web application archive birdtrack.war
11-Feb-2009 11:27:17 org.apache.catalina.loader.WebappClassLoader validateJarFile
INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\birdtrack\WEB-INF\lib\geronimo-spec-j2ee-1.4-rc4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

Has my problem got something to do with this error, or is it completely unrelated ?

thanks






<!--servlet code putting the bean into the session-->
    protected void processListGridSpeciesKeySitesForm(HttpServletRequest request,
                                               HttpServletResponse response,
                                               BTSessionBean session) throws
        ServletException, BTException,
        SQLException, IOException
 
    {
      String op = (String)this.extractString(request, Constants.FORM_OP,
                                             null, false);
      Hashtable fieldTable = this.extractFieldsForKeySites(request, response);
      BTListGridSpeciesKeySitesBean listBean = new BTListGridSpeciesKeySitesBean(session, fieldTable);
 
      session.getServletSession().setAttribute("BTListGridSpeciesKeySitesBean", listBean);
    }
 
 
<!-- JSP code -->
<jsp:useBean id="BTSession" scope="session" type="Bto.BT.BTSessionBean"/>
<jsp:useBean id="BTListGridSpeciesKeySitesBean" scope="session" type="Bto.BT.DataBeans.BTListGridSpeciesKeySitesBean"/>
 
<!-- I then use the bean as below-->
String bufferSize = BTListGridSpeciesKeySitesBean.getBufferSize();

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial