CrossContext Bug on Tomcat?

Has anyone used crossContext successfully on Tomcat 4.1.12? I have not been able to. If you have, could you please let me know what I need to do besides the following:
Set crossContext="true" for contexts in same virtual host in server.xml:
<Context path="" docBase="webapp1" debug="0" crossContext="true"/>
<Context path="/resource" docBase="webapp2" debug="0" crossContext="true"/>
Use the following code in a jsp in webapp1:
<%
ServletContext thatctx= application.getContext("/webapp2");
RequestDispatcher rdpt=thatctx.getRequestDispatcher("/index.jsp");
rdpt.forward(request, response);
%>
Any help would be greatly appreciated.
Sam P.

See my response in, http://forum.java.sun.com/thread.jsp?forum=45&thread=335820

Similar Messages

  • Tomcat 4 bug in tomcat 5

    hi,
    What i have:
    - eclipse Version: 3.0.0
    Build id: 200406251208
    - lomboz 3.0.0
    - tomcat 5
    what i want to do is:
    i want to enable jsp-debugging in eclipse using lomboz, so i followed the steps on the objectlearn-website to achieve this.
    i changed the context path so every generated servlet goes into the /j2src folder and i can set breakpoints, which is fine, but now i got a problem which should not occur with tomcat 5 because it was a bug in tomcat 4.
    ------ quote from the sysdeo website ------
    Known problem 1 : Tomcat 4 and JSP in project subdirectories
    Generated servlets for JSP couldn't be compile by Eclipse. Subdirectories do not appear in Tomcat 4 generates servlets. Package definition is always package org.apache.jsp.
    ----- end quote ------------
    thats exactly the problem i got right now, package definition is always org.apache.jsp, but there is no patch for this problem for tomcat 5, it isnt even mentioned on the website for tomcat 5,
    so what is wrong and how can i change this?
    thanks in advance, timo

    is there nobody here familiar with lomboz and tomcat 5???
    if there is somebody in this forum who uses tomcat 5 and lomboz:
    did you get the same error like me, i.e. that lomboz automatically throws all generated servlets into the package org.apache.jsp??
    if the answer is yes, what did you do to fix this bug, there is no patch for tomcat 5 for this bug, since this bug doesnt seem to exsist officially in tomcat 5 ?!?
    if the answer is no, what tomcat-lomboz-environment did you set up? did you follow the guidelines on the objectlearn-website for activating jsp-debugging or did you do something else / more?
    damn, i posted this problem in a few forums and i seem to be the only person on the planet having this problem or using this combination...

  • BUG? tomcat & Solaris8 on Sparc

    Dear all,
    we have encounterd a problem we like to mark as a bug in Solaris8 and or in all versions of Apache Tomcat.
    What is te problem and how did we find out?
    We upgraded from Solaris7 to Solaris8 a couple of days ago. We started te server and let it run fore a couple of days in test enviroment. No problems to reporte so we switch the Solaris7 and the solaris8 server and where runninf fine the Solaris8 machine as a production server.
    After a setting change of Tomcat we suddenly encounterd a lot of crashes from Tomcat whitout any reason. After a day of searing on the web could not find a solution so we put the old version of Tomcat back to the Solaris8 server in the hope that the problem was solved. Then things where getting clear.... Tomcat was still crashing.
    What is the problem.
    On solaris8 Tomcat is unstabele when you start it from a telnet session. After you kill the telnet session tomcat is trying to write messages to the telnet session and is crashing when that session is gone.
    What is the solution.
    The solution is simpel use the NOHUP option to start tomcat. like this:
    nohup ./tomcat.sh start
    Why we think it is a bug.
    - The reason we think it is a bug is that this problem was never encounterd in Solaris7.
    - A second reason is that we not put new servlets so te bug is not in the software we have written, this software is already running fore a year on Solaris7.
    - We think it is a bug in Solaris because the problem is comming up with every version of Tomcat that we tested running on Solaris8.
    Are there more people that have encounterd this problem and are there people how think this is not a bug?
    Best regards,
    Johan Louwers.

    This is definitely **NOT** a Solaris bug.
    Most likely you've been trapped by a change to the shell that handles SIGHUP protection different in Solaris 8 than in Solaris 7.
    Generally, if you run a program in the backgound that does read from stdin and/or write to stdout/stderr you **MUST** redirect stdin/stdout/stderr to some file or /dev/null to avoid funnies and/or screen corruption. Additionally you must protect it from dying on SIGHUP reception if it does not handle it itself. This is what 'nohup' is for. Otherwise your program might die if you exit your shell and/or logout. 'nohup' automagically does i/o redirection for you, BTW.
    - What shell are you using?
    - SUN people: any comments?

  • Tomcat 6 failing to evaluate EL expressions, Tomcat 6 bug?!!!!

    Can someone please tell me this is not a bug in Tomcat 6, its too obvious and to some extend unacceptable I must be doing something wrong.
    Here is my problem, I have written my own custom component to display a div tag.
    the JSP is as follows:
    <faces:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>My Custom Tags</title>
        </head>
        <body>
          <html:form>
          <h2>Cat In The Rain</h2>
          <mine:mytag title="#{index.title}">Dancing in the rain.</mine:mytag>
          </html:form>
        </body>
    </html>
    </faces:view>The tag class is given below:
    This text #{index.title} is being interpreted as Literal text which is obviously wrong, when deployed in glassfish the code works fine.
    Output text in my tomcat console is
    MyTag.setProperties(): Title is literal text....
    MyTag.setProperties(): title value= #{index.title}
    MyTag.setProperties(): Title Value expression is null
    The Tag class.
    public class MyTag extends UIComponentELTag{
      private ValueExpression title;
      public String getComponentType() {
        return "test.MyOutput";
      public String getRendererType() {
        return "test.MyRenderer";
      @Override()
      protected void setProperties(UIComponent component) {
        super.setProperties(component);
        if (null!= title){
          if (!title.isLiteralText()){
            component.setValueExpression("component.title", title);
            System.out.println("MyTag.setProperties(): Its not literal text.");
            System.out.println("MyTag.setProperties ():              title value = "+ title.getValue(getELContext()));
          else{
            component.getAttributes().put("component.title", title.getExpressionString());
            System.out.println ("MyTag.setProperties(): Title is literal text....");
            System.out.println("MyTag.setProperties():              title value= "+ title.getExpressionString());
        System.out.println ("MyTag.setProperties(): Title Value expression is "+ component.getValueExpression("component.title"));
      }The component class.
    public class MyOutput extends UICommand{
      public MyOutput(){
        setRendererType("test.MyRenderer");
      @Override()
      public String getFamily() {
        return "test.MyOutput";
    }The tld file
    <?xml version=" 1.0 " encoding="UTF-8"?>
    <taglib version="2.0"
            xmlns="http://java.sun.com/xml/ns/j2ee "
            xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd">
      <tlib-version> 1.0</tlib-version>
      <short-name>mine</short-name>
      <uri>http://www.my-tests.com </uri>
      <tag>
        <name>mytag</name>
        <tag-class> test.MyTag</tag-class>
        <body-content>JSP</body
    -content>
        <description></description>
        <attribute>
          <name>binding</name>
          <required>false</required>
          <rtexprvalue>true</rtexprvalue>
          <deferred-value>
            <type>test.MyOutput</type>
          </deferred-value>
          <description>
              A ValueExpression that resolves to the UIComponent that corresponds
              to this tag. This binding allows the Java bean that contains the UIComponent
              to manipulate the UIComponent, its properties, and its children.
          </description>
        </attribute>
        <attribute>
          <name>title</name>
          <required>false</required>
          <deferred-value>
            <type>java.lang.String</type>
          </deferred-value>
          <description></description>
        </attribute>  
            <attribute>
                <name>rendered</name>
                <required>false</required>
                <deferred-value>
                    <type>boolean</type>
                </deferred-value>
                <description><![CDATA[ Use the rendered attribute to indicate whether the HTML code for the
    component should be included in the rendered HTML page. If set to false,
    the rendered HTML page does not include the HTML for the component. If
    the component is not rendered, it is also not processed on any subsequent
    form submission.
    ]]></description>
            </attribute>
            <attribute>
                <name>id</name>
                <required>false</required>
                <rtexprvalue>true</rtexprvalue>
            </attribute>
      </tag>  
    </taglib>

    Set the JSP version in your TLD to 2.1.
    Meaning from:
    <taglib version="2.0"
            xmlns="http://java.sun.com/xml/ns/j2ee "
            xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd">to:
    <taglib version="2.1"
            xmlns="http://java.sun.com/xml/ns/j2ee "
            xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd">Edited by: rlubke on Oct 15, 2007 9:32 PM

  • [svn:cairngorm3:] 15920: Adding the use of Spark component into ModuleC to add the scenario where a Module must be able to get its default spark skin  (currently this is failing due to a bug in the Module Lib)

    Revision: 15920
    Revision: 15920
    Author:   [email protected]
    Date:     2010-05-06 02:11:21 -0700 (Thu, 06 May 2010)
    Log Message:
    Adding the use of Spark component into ModuleC to add the scenario where a Module must be able to get its default spark skin (currently this is failing due to a bug in the Module Lib)
    Modified Paths:
        cairngorm3/trunk/libraries/ModuleTest/src/example/moduleC/ModuleC.mxml

    As the server.xml is big enough, I took the minimum portion of it. Hope u can proceed with it.
    <!-- Tomcat Root Context -->
    <Context path="" docBase="ROOT" debug="0"/>
    <!-- New contexts -->
    <Context path="/xyz" docBase="pathTo_xyz" debug="0" crossContext="true"/>
    <Context path="/pqr" docBase="pathTo_pqr" debug="0" crossContext="true"/>
    <!-- Tomcat Examples Context -->
    <Context path="/examples" docBase="examples" debug="0"
    reloadable="true" crossContext="true">
    You should also provide a WEB-INF folder under pqr or xyz folder.
    You should also provide a web.xml file under each WEB-INF folder.
    The minimal web.xml is
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/j2ee/dtd/web-app_2_3.dtd">
    <web-app>
    </web-app>
    That's it. Try it out. Hope it is OK.
    Hafizur Rahman
    SCJP

  • Tomcat autoreload doesn't work

    I am using Tomcat 4.1.24 on W2K OS. Every time when I modify a servlet, I need to restart Tomcat to see the changes. I already set the reloadable to true. Here is the part of the server.xml config file:
    <Context path="" docBase="laguna" debug="0" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_laguna_log." suffix=".txt" timestamp="true"/>
    </Context>
    Is this a known bug in Tomcat? Anyone suggest a fix for this?

    To turn on servlet reloading, edit install_dir/conf/server.xml and add a DefaultContext subelement to the main Service element and supply true for the reloadable attribute. The easiest way to do this is to find the following comment:
    <!-- Define properties for each web application. This is only needed
    if you want to set non-default properties, or have web application
    document roots in places other than the virtual host's appBase
    directory. -->
    and insert the following line just below it:
    <DefaultContext reloadable="true"/>
    Hope it helps.

  • Tomcat problem on redhat 9

    Hello, i have installed tomcat 4.0.1 in redhat9 and it worked properly for a while, i used to start it and stop it many times ,but now it is listening but not giving a response,the mozilla browser just says "Transfering Data from localhost:8080" and it loops forever, can any one help me please?

    Hm. I don't know why a fresh, unmodified version of tomcat hangs. I haven't even added network stuff yet.
    My guess is that maybe there are bugs in tomcat that causes this, or that there are bugs in linux itself.
    Check out the thread I posted earlier. You may try the ThreadPool patch from that thread.
    Plz, if you find anything, tell us in this forum.
    Ping

  • Image seems not loading in servlet running in tomcat 4 ... (win xp)

    This servlet basically takes a images file do some scaling then send out as outputstream.
    BUT the image dun since to load ... i keep getting a -1 for the width n height of the image .... seems that image cant load in tomcat....
    Is it something wrong wif my code or is there a bug in tomcat....
    Can someone help thanks
    This is the servlet code:
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.image.*;
    public class ImageOperater extends HttpServlet
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException
    { System.out.println("Start of post");
    OutputStream out = null;
    try{
    out = res.getOutputStream();
    catch(Exception e)
    e.printStackTrace();
    System.out.println("Start of imageprocessing");
    //image processing
    Image img = Toolkit.getDefaultToolkit().getImage("images/peppers.png");
    ImageFilter imf = new CropImageFilter(0,0,200,200);
    ImageProducer ip = new FilteredImageSource(img.getSource(),imf);
    img = Toolkit.getDefaultToolkit().createImage(ip);
    img =img.getScaledInstance(500,-1,Image.SCALE_AREA_AVERAGING);
    //image processing finish
    //check if the image is fully loaded
    System.out.println("Start of image loading");
    MediaTracker mediaTracker = new MediaTracker(new Container());
    mediaTracker.addImage(img, 0);
    try{
    mediaTracker.waitForID(0);
    System.out.println(mediaTracker.checkAll());
    System.out.println("thread sleep");
    Thread.sleep(1000);
    catch(Exception e)
    e.printStackTrace();
    try{
    mediaTracker.waitForID(0);
    System.out.println(mediaTracker.checkAll());
    System.out.println("thread sleep");
    Thread.sleep(1000);
    catch(Exception e)
    e.printStackTrace();
    //image fully loaded
    System.out.println("Start of buffered image ");
    System.out.println("width"+img.getWidth(null)+" Height "+img.getHeight(null));
    //preparing the buffered image to be send
    BufferedImage bimg = new BufferedImage(img.getWidth(null),img.getHeight(null),BufferedImage.TYPE_INT_RGB);
    Graphics gr = bimg.getGraphics();
    gr.drawImage(img, 0, 0, null);
    gr.dispose();
    //finished preparing
    //ig = Toolkit.getDefaultToolkit().createImage(bimg.getSource());
    System.out.println("Start of sending");
    //send out to client
    try{
    ImageIO.write((RenderedImage)bimg,"png",new File("c:\\test.png"));
    ImageIO.write((RenderedImage)bimg,"png",out);
    catch(Exception e)
    e.printStackTrace();
    try{
    out.flush();
    out.close();
    catch(Exception e)
    e.printStackTrace();
    System.out.println("post ended");
    but if the same code is put into an applet it works ... thw getWidth() and getHeight() returns the correct value:
    Image img = Toolkit.getDefaultToolkit().getImage("images/peppers.png");
    ImageFilter imf = new CropImageFilter(0,0,200,200);
    ImageProducer ip = new FilteredImageSource(img.getSource(),imf);
    img = Toolkit.getDefaultToolkit().createImage(ip);
    img =img.getScaledInstance(500,-1,Image.SCALE_AREA_AVERAGING);
    //image processing finish
    //check if the image is fully loaded
    System.out.println("Start of image loading");
    MediaTracker mediaTracker = new MediaTracker(new Container());
    mediaTracker.addImage(img, 0);
    try{
    mediaTracker.waitForID(0);
    System.out.println(mediaTracker.checkAll());
    System.out.println("thread sleep");
    Thread.sleep(1000);
    catch(Exception e)
    e.printStackTrace();
    try{
    mediaTracker.waitForID(0);
    System.out.println(mediaTracker.checkAll());
    System.out.println("thread sleep");
    Thread.sleep(1000);
    catch(Exception e)
    e.printStackTrace();
    //image fully loaded
    System.out.println("Start of buffered image ");
    System.out.println("width"+img.getWidth(null)+" Height "+img.getHeight(null));
    //preparing the buffered image to be send
    BufferedImage bimg = new BufferedImage(img.getWidth(null),img.getHeight(null),BufferedImage.TYPE_INT_RGB);
    Graphics gr = bimg.getGraphics();
    gr.drawImage(img, 0, 0, null);
    gr.dispose();
    //finished preparing
    //ig = Toolkit.getDefaultToolkit().createImage(bimg.getSource());
    System.out.println("Start of sending");
    //send out to client
    try{
    ImageIO.write((RenderedImage)bimg,"png",new File("c:\\test.png"));

    hi ganttan
    first you have to make sure your server is running xwindow. in most cases a linux/apache server does not run it by default. then there is a much simpler approach of scaling images with a servlet:
    Iterator readers = ImageIO.getImageReadersByFormatName("gif");
    ImageReader reader = (ImageReader)readers.next();
    ImageInputStream iis = ImageIO.createImageInputStream(new File(path));
    reader.setInput(iis, true);
    ImageReadParam param = reader.getDefaultReadParam();
    param.setSourceRenderSize(new Dimension(width, height));
    BufferedImage thumbnail = reader.read(0, param);
    ImageIO.write(thumbnail, "gif", response.getOutputStream());
    however this does not work for jpeg images. use setSourceSampling() instead of setSourceRenderSize() in this case but unfortunately it's limited and you can not scale to any size.

  • Connection pool + db2 + tomcat 5 migration problem

    I succeded in using connection pooling in Tomcat 4.0.x and IBM db2 6.xx and 7.xx.
    Now I am trying to use Tomcat 5 (released with netbeans 3.6) and I have some problems.
    I migrated the context information from server xml to context xml, but I have a username-password problem
    <Context docBase="D:\j2sdk_nb\NetBeans3.6\progetti\Pegaso2" path="/pegaso2" reloadable="true">
    <Resource auth="Container" name="jdbc/pegaso61" type="javax.sql.DataSource"/>
    <ResourceParams name="jdbc/pegaso61">
    <parameter>
    <name>factory</name>
    <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
    </parameter>
    <parameter>
    <name>driverClassName</name>
    <value>COM.ibm.db2.jdbc.app.DB2Driver</value>
    </parameter>
    <parameter>
    <name>url</name>
    <value>jdbc:db2:pegaso61</value>
    </parameter>
    <parameter>
    <name>username</name>
    <value>userxxxx</value>
    </parameter>
    <parameter>
    <name>password</name>
    <value>passxxxx</value>
    </parameter>
    </ResourceParams>
    </Context>
    When running my servlets, i get this error:
    Exception in PoolDB2Connector.getConnection():org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory, cause: [IBM][CLI Driver] SQL1403N The username and/or password supplied is incorrect. SQLSTATE=08004
    So it means ( I think !!) that the web-application i getting the right driver ( i got a db2 error) but is having problem with username and password.
    I am using getConnection() method ( with no argouments) in my PoolDB2Connecto class (according to the documentation the getConnection(user,password) method is not supported)
    I have a parallel installation of netbeans 3.5.1 (tomcat 4.0.6) with the same parameters (username, password, url...) and is still perfectly working
    Any help will be greatly appreciated,
    Andrea

    OK, I found the problem !
    It is not due to any configuration issue, but it is due to a BUG in tomcat 5.xx
    I reproduced the problem with mysql db server other than db2 db servver.
    The problem is the presence of the $ sign in the users' s password !!!!
    Probably the xml parser rading server.xml introduce some error finding $ sign.
    The problem is still present in the 5.028 version of tomcat.
    If i modify user's password REMOVING $ sign, everything is OK
    Perhaps $ sign should be escaped (?!?)
    Andrea

  • Data source error in Tomcat

    I have encountered a puzzle question with Tomcat,I setup a DSN with Microsoft OLE DB Provider for ODBC Drivers,when I start tomcat with C:\Tomcat5.5\bin\tomcat5w.exe,I get a error:
    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    Then I don't open the page "http://localhost:8080"
    But when I start tomcat with C:\Tomcat5.5\bin\tomcat5.exe,I can start tomcat and I don't get above error,and I can visit "http://localhost:8080"
    Why I can't start Tomcat with tomcat5w.exe and can start Tomcat with tomcat5.exe?
    I am puzzled with this question for a several days! I don't know how to solve it. Any body meet with my question?
    Any idea will be appreciated!
    Thanks in advance

    I use Microsoft Access Database,is it a bug of Tomcat?

  • Problems with tomcat 4.0.1

    hello,
    i�ve written some servlets using forte 3.0 with tomcat 3.2.
    everything works fine as long as I don�t run the servlets with tomcat 4.0.1.
    i use the request dispatcher / forward method - which dosn�t work reliable.
    it�s a list on which the user has to select one topic. the strange thing about it is that it works when you choose "back" after the error (dispatcher = null) has occured and select a different topic on that list - only the first choice makes en error.
    running on tomcat 3.2 with forte it works fine. but i get the following message in the tomcat output window:
    java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key dispatcher.forwardException
    and
    2002-01-13 11:40:05 - Ctx( /lg002234 ): Exception in: R( /lg002234 + /eingaben + null) - javax.servlet.ServletException: cannot find message associated with key : dispatcher.forwardException
    can somebody help?
    is use the dispatcher three times in that post-method - ist that a problem?

    ...sorry
    it�s not a problem with the requestdispatcher,
    problem is, that with tomcat 4.0.1 a parameter
    sometimes gets lost - but not with tomcat 3.2
    critical code is:
    String tierartAuswahl = request.getParameter("tierartAuswahl");
    is that a known bug of tomcat 4.0.1??

  • Problem of Tomcat 4.0

    I'm using Linux with Tomcat 4.0. I found that the counter of session has something wrong. The time counter is not reset when the user access the session.
    I try to use Tomcat 3.2.3 and my programs work fine. Is this the problem of Tomcat 4.0 ? anyone have the same problem ?
    plse, help.

    I'm using Tomcat 4.0 and Linux.
    I have a problem about the session.
    timeout = 600;
    session.setMaxInactiveInterval(timeout);
    ...When the user active the session, the "timeout" should be reset to 600. In fact, the session is still die even the user active the session.
    And this problem does not occurred in Tomcat 3.2.3.
    I guess is the bug of Tomcat 4.0.
    Is anyone use Tomcat 4.0 and Linux. Can anyone help me to check the timer of session is correct or not ?
    Thank you !
    Tomcat 3.2.3 is ok.
    The problem occurred in Tomcat 4.0.1 and 4.0.2.
    Please help !

  • Javax.servlet.ServletContext cannot be resolved in Tomcat 5.5.12

    I deployed my web application in Tomcat 5.5.12 (Solaris 10 platform), and found following error message:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 16 in the jsp file: /countrydetail.jsp
    Generated servlet error:
    javax.servlet.ServletContext cannot be resolved
    An error occurred at line: 16 in the jsp file: /countrydetail.jsp
    Generated servlet error:
    ctx cannot be resolved
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.12 logs.
    Apache Tomcat/5.5.12
    The application was developed by NetBeans 5 RC2 and runed well under Windows platform.
    The error appears when I click link . At first I thought it may be caused by JSF, but I tested the sample JSF web with simliar link, and there is no problem.
    I do saw servlet-api.jar (which contains javax.servlet.ServeletContext) in Tomcat common/lib. Why tomcat can not locate the class?

    I solved this problem by deploying the application in Tomcat 5.5.15. It seems that the problem in above post is a bug in Tomcat 5.5.12.
    Details please refer to http://issues.apache.org/bugzilla/show_bug.cgi?id=38211

  • Tomcat 4.1.12 and Tag Libraries

    I had tomcat 4.04 working great with a webapp, I changed to tomcat 4.1.12 and there are a lot of Custom Tags that stoped working.
    Does anybody knows what might be happening and how to solve it ???
    The Exception I am getting is the following:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 34 in the jsp file: /jsps/alumno/tareas/mistareas.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    E:\JBuilder6\jakarta-tomcat-4.1.12\Tomcat 4.1\work\Standalone\localhost\_\jsps\alumno\tareas\mistareas_jsp.java:289: unreachable statement
    out.write("\r\n ");
    ^
    1 error
    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:120)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:293)
    at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:313)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:324)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:240)
    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:260)
    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 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:2396)
    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:170)
    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:223)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:508)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:533)
    at java.lang.Thread.run(Thread.java:536)
    Apache Tomcat/4.1.12-LE-jdk14

    I have also had this problem. I had a number of JSP pages which used various tag librarys. They all worked perfectly with tomcat 4.04LE (for jdk1.4.1). I then updated to 4.1.12LE and started getting the errors mentioned above.
    From looking at the errors in the tomcat log I could see the problem was due to the generated servlet code (jspname_jsp.java) not being able to find the classes required for compilation...I ensured all the classpaths were correctly set, and I manually compiled the generated jspname_jsp.java files with no problem.
    I am pretty sure this is a bug in Tomcat.
    Paterico

  • BC4J: NullPointerException in Tomcat 4.1.24, but in OC4J it works fine

    Dear reader,
    I am having a weird exception in tomcat, which does not occur in the OC4J server (shipped with JDeveloper 9.0.3.1).
    I have a web-application built with BC4J/struts (struts final release) and this works fine in the OC4J server. In Tomcat it works fine until a certain row does not contain data (it looks like that). The code in the jsp where it goes wrong is the following:
    <jbo:RowsetIterate datasource="ConsultantModule.ConsultantGeneralView" changecurrentrow="true" userange="false">
    <jbo:Row id="generalRow" datasource="ConsultantModule.ConsultantGeneralView" action="current">
    <jbo:Row id="allocatiesRow" datasource="ConsultantModule.AllocatieRegistratiesView" action="current">
    The last row it goes wrong if there is no data in it (in OC4J it just works fine there). I've also looked up the generated servlet in tomcat, and the following lines are responsible (for the last jbo:Row tag):
    oracle.jbo.Row allocatiesRow = null;
    jspxallocatiesRow_1 = allocatiesRow;
    oracle.jbo.html.jsp.datatags.RowTag jspxth_jbo_Row_2 = new oracle.jbo.html.jsp.datatags.RowTag();
    jspxth_jbo_Row_2.setPageContext(pageContext); jspxth_jbo_Row_2.setParent(_jspx_th_jbo_Row_1); jspxth_jbo_Row_2.setId("allocatiesRow"); jspxth_jbo_Row_2.setDatasource("ConsultantModule.AllocatieRegistratiesView");
    jspxth_jbo_Row_2.setAction("current");
    int jspxeval_jbo_Row_2 = jspxth_jbo_Row_2.doStartTag(); // This line throws a NullPointerException in Tomcat
    Has anyone encountered a similar problem? And is it a bug in the tag libraries, or is it a bug in Tomcat? And most importantly can it be solved, so that I can still deploy to Tomcat.
    Thanks a lot for your time!
    Regards Martijn

    [UPDATE]
    I've done some more research to the problem of the NullPointerException in Tomcat.
    It seems to happen only when a certain View does not contain rows (no data, it is empty).
    Once the <jbo:Row id="anyID" ... > defines a row based on that view, this causes Tomcat to crash on the doStartTag, in the RowTag class. OC4J does not crash. The source tomcat crashes on in the RowTag class is:
       public int doStartTag() throws JspException
          initialize();
          handleAction();
          pageContext.setAttribute(id , row); // NULLPOINTER EXCEPTION
          return Tag.EVAL_BODY_INCLUDE;
       }Apparently row is null, which is the case as I know there is no row, which causes an exception (as per the setAttribute definition of pageContext).
    It seems that OC4J does never execute this tag, or it should have crashed as well, wouldn't it? As in the handleAction() method, the action 'current' is defined as follows:
    else
    if (ACTION_ROW_CURRENT.equalsIgnoreCase(sAction))
             row = rs.getCurrentRow();
             if (row == null)
                row = rs.first();
                if (row == null)
                   rs.executeQuery();
                   row = rs.first();
          } The row must always be null, as the view doesn't contain any rows (not even after executeQuery()).
    Can someone please have a look at this? I really need to know whether this is indeed a Tomcat bug, BC4J tag library bug or an OC4J bug (perhaps the code it generates is too kind to developers, and prevents errors, compared to normal specifications of jsp/servlets?).
    Using the <jbo:RowSetIterate ..> tag in front of the <jbo:Row ..> tag (empty one) prevents the crash (also in Tomcat).
    If you require the Tomcat and/or OC4J generated java-code to see what happens, please let me know. But it is rather large to paste it here.
    Thanks a lot for your time!
    Regards Martijn

Maybe you are looking for

  • Reader 9.3.2 does not remember last page visited for scanned pdfs

    Using an old school PPC Mac, OSX 10.4.11.  Reader 9.3.2 does not remember last page visited for scanned pdfs. It only remembers the last page visited for searchable pdfs, but not for scanned.  I have the box checked in "Preferences: Restore last view

  • Sun-cmp-mappings.xml exists but has invalid contents: getSchema() == null

    Can anyone help please! what this error means by invalid contents: getSchema() == null when I try to deploy or veryfy, this is what I get: deployment started : 0% Deploying application in domain failed; Error while running ejbc -- Fatal Error from EJ

  • How to get Current Year

    Dear Friends I am writing a fast formula for medical reimbursement. My fiscal year start will be 01-mar every year and end date will be 30apr every year. Every year I need the current start date and end date like Accruals. Can anyone please suggest m

  • Video chapter markers not showing in iTunes

    I used Metadata Hootenanny to add chapter markers in a movie. When I play the movie through Quicktime it shows the pop-up chapter selector, but when i import the movie into iTunes and play it through iTunes, the controls don't show the chapter marker

  • Need of JMF for getting Video Metadata

    Hi All I got a lot of videos here at a Helix Server. I get all rtsp URLs of them and just want to determine the length and size of each the videos by a Java Application running on a Tomcat. There is no need for streaming the contents or gettein just