bean not found within scope on tomcat

Posted on 2009-02-11
Last Modified: 2013-11-19

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 ?


<!--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

Question by:COMPSUPP
    1 Comment
    LVL 92

    Accepted Solution

    its unrelated to that error
    you just have a jar in your lib directory that does not need to be there


    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now