ServletContext-Gentral Exceptrion

"hai All ,
          this exception some time occur and get hungs please help it out,
          thanks
          Thu Apr 11 14:45:28 CEST 2002:<E> <ServletContext-General> Servlet failed with Exception
          java.lang.RuntimeException: IOException occured
               at java.lang.Throwable.fillInStackTrace(Native Method)
               at java.lang.Throwable.fillInStackTrace(Compiled Code)
               at java.lang.Throwable.<init>(Compiled Code)
               at java.lang.Exception.<init>(Compiled Code)
               at java.lang.RuntimeException.<init>(Compiled Code)
               at weblogic.servlet.internal.ServletOutputStreamImpl.write(Compiled Code)
               at weblogic.servlet.internal.WLOutputStreamWriter.flushBuffer(Compiled Code)
               at weblogic.servlet.internal.WLOutputStreamWriter.write(Compiled Code)
               at weblogic.servlet.internal.WLOutputStreamWriter.write(Compiled Code)
               at java.io.Writer.write(Compiled Code)
               at weblogic.servlet.jsp.JspWriterImpl.print(Compiled Code)
               at jsp_servlet._jsp.__WEB07J5._jspService(Compiled Code)
               at weblogic.servlet.jsp.JspBase.service(Compiled Code)
               at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
               at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
               at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled Code)
               at weblogic.servlet.internal.ServletContextManager.invokeServlet(Compiled Code)
               at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
               at weblogic.socket.MuxableSock
          

          You have to provide more details. Which version of WLS server and what service pack
          are you on?
          sreekanth <[email protected]> wrote:
          >"hai All ,
          >
          > this exception some time occur and get hungs please help it out,
          >thanks
          >
          >
          >Thu Apr 11 14:45:28 CEST 2002:<E> <ServletContext-General> Servlet failed
          >with Exception
          >java.lang.RuntimeException: IOException occured
          >     at java.lang.Throwable.fillInStackTrace(Native Method)
          >     at java.lang.Throwable.fillInStackTrace(Compiled Code)
          >     at java.lang.Throwable.<init>(Compiled Code)
          >     at java.lang.Exception.<init>(Compiled Code)
          >     at java.lang.RuntimeException.<init>(Compiled Code)
          >     at weblogic.servlet.internal.ServletOutputStreamImpl.write(Compiled Code)
          >     at weblogic.servlet.internal.WLOutputStreamWriter.flushBuffer(Compiled
          >Code)
          >     at weblogic.servlet.internal.WLOutputStreamWriter.write(Compiled Code)
          >     at weblogic.servlet.internal.WLOutputStreamWriter.write(Compiled Code)
          >     at java.io.Writer.write(Compiled Code)
          >     at weblogic.servlet.jsp.JspWriterImpl.print(Compiled Code)
          >     at jsp_servlet._jsp.__WEB07J5._jspService(Compiled Code)
          >     at weblogic.servlet.jsp.JspBase.service(Compiled Code)
          >     at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Compiled Code)
          >     at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
          >Code)
          >     at weblogic.servlet.internal.ServletContextImpl.invokeServlet(Compiled
          >Code)
          >     at weblogic.servlet.internal.ServletContextManager.invokeServlet(Compiled
          >Code)
          >     at weblogic.socket.MuxableSocketHTTP.invokeServlet(Compiled Code)
          >     at weblogic.socket.MuxableSock
          

Similar Messages

  • Problem with getRealPath in the class ServletContext

    this is a bug in tomcat 4.1
    ServletContext scon=getServletConfig().getServletContext();
    String path = scon.getRealPath("index.html");
    this lines return the path of the archive index.html but with a caracater of espace example:
    C:\Archivos de programa\Apache Group\Tomcat 4.1\webapps\prueba \index.html
    ----------------------------------------------------------------------------------------------^

    i don't think this is a bug...
    if you're using a MS OS (Windows) your java environment will normally return a files path using the backslash character instead of the normal slash.

  • How to get the ServletContext when writing a class

    Morning,
    I've got a project using al least 4 jsp documents that try to manipulate a mysql database
    To access the database and get a connection, i've put this syntax at the start of each document
    <%! Connection con; %>
    <%     
    String url =  (String)application.getInitParameter("databaseUrl");
                   String username = application.getInitParameter("username");
                   String password = application.getInitParameter("password");
                   Class.forName("com.mysql.jdbc.Driver").newInstance();
               con = DriverManager.getConnection(url, username, password);
                   %>Those documents also use classes that I create, what I want to do is keep the code I've written above in one place instead of 4 different places, Is there a way I can use the application variable, which belongs to ServletContext in a class (not a servlet)
    Message was edited by:
    Octavian

    This syntax reference JSP 2.0 : http://java.sun.com/products/jsp/syntax/2.0/syntaxref20.html
    covers JSP actions such as jsp:useBean , jsp:getProperty and jsp:setProperty.
    The API for JSTL is pretty intuitive:
    http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html
    But if you need more details on a particular JSTL tag you can refer to the JSTL 1.1 Specification - it's a PDF document.
    JSTL also uses EL (Expression Language) which is also covered by the JSTL specification and by the above JSP 2.0 syntax reference.
    There are many JSTL tutorials and articles too, but most of them are old so they contain JSTL 1.0 code.
    To get yourself started you need jstl.jar and standard.jar which come with the latest JSTL 1.1 distribution found here:
    http://jakarta.apache.org/taglibs/doc/standard-doc/intro.html
    Standard-1.1 (JSTL 1.1) requires a JSP container that supports the Java Servlet 2.4 and JavaServer Pages 2.0 specifications. Jakarta Tomcat 5 supports the new specifications. The Standard-1.1 taglib has been tested with Tomcat 5.0.3.
    After you have set up your environment you can test it with a small sample of JSTL code like this:
    inside sample.jsp
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <c:set var="someVariable" value="Hello World!"/>
    <c:out value="${someVariable}/>
    null

  • How to get ServletContext from HttpServletRequest when there is no session?

    Does anyone know of a way to be able to pull the ServletContext from an HttpServletRequest if there is not a session available?

    You could always just do:
    request.getSession(true).getServletContext()The true argument to getSession() creates a session if there isn't one. Alternatively, you can store the ServletConfig object you receive in the Servlet's init() method, and get the ServletContext through that.
    Brian

  • How to access ServletContext object of a webapp on remote server?

    Hi!
    I have a webapp, runs on tomcat, loads information from local db server, keeps them in servlet context, and publish these datas to web via jsp pages.
    I make run the same webapp on different location, different webserver and db server with different datas.
    Is it possible to link both ServletContext to each other, or access one from the another?
    What is the right solution, if I want to access all stored Objects of these independent webapplications, summarize and show them in one browser page, in one jsp?
    sorry for my poor english
    and thanks for any help,
    kind regards,
    henpanta

    It is not possible to access another servletcontext glueless using HTTP or any transfer protocol. Would be a potential security hole too. If you want to let communicate 2 webapps on different servers with each other, consider webservices.

  • Accessing the ServletContext from a class that is not a Servlet?

    Is there any way of accessing the ServletContext from a class that is not a
              Servlet? The class is being used as part of a Web Application.
              Thanks.
              

    http://www.mozilla.org/mirrors.html
    Mozilla has download mirrors around the globe. If it is on the list, it is trustworthy.

  • Problem in web.xml  -- servletcontext

    Pls look at the code and web.xml file for invoking servlet.
    index.html
    <html>
    <head>
    <title>Servlet Context Example</title>
    </head>
    <body>
    <form method="get" action="callservlet">
    <input type="submit" value="Submit">
    </form>
    </body>
    </html>ServletConExample.java
    package com.servletcontext;
    import java.io.IOException;
    import javax.servlet.ServletContext;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class ServletConExample extends HttpServlet {
         private static final long serialVersionUID = 1L;
         ServletContext con;
         public void init()
              con = getServletContext();
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException
              con.setAttribute("logname", "shobhit");
              response.sendRedirect("./com.servletcontext.TestServCon");
    }TestServCon.java
    package com.servletcontext;
    import java.io.IOException;
    import javax.servlet.ServletContext;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class TestServCon extends HttpServlet {
         private static final long serialVersionUID = 1L;
         ServletContext con;
         public void init()
              con = getServletContext();
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException
              String str = (String)con.getAttribute("logname");
              response.getWriter().println("value of attribute logname is "+str);
    }web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app>
         <servlet>
              <servlet-name>servletcontext</servlet-name>
              <servlet-class>com.servletcontext.ServletConExample</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>servletcontext</servlet-name>
              <url-pattern>/callservlet</url-pattern>
         </servlet-mapping>
         <Welcome-file-list>
              <Welcome-file>index.html</Welcome-file>
         </Welcome-file-list>
    </web-app>Error Page:
    HTTP Status 404 - /ServletContext/com.servletcontext.TestServCon
    type Status report
    message /ServletContext/com.servletcontext.TestServCon
    description The requested resource (/ServletContext/com.servletcontext.TestServCon) is not available.
    Apache Tomcat/5.5.26 I think problem is in web.xml file. Can any help me to resolve this problem.
    Thanks,
    Shobhit

    You must declare TestServCon.java on web.xml as you did for the first servlet
    and in the sendRedirect use the following code :
    response.sendRedirect("TestServCon");//   TestServCon is the servlet mapping you declared in web.xml
    //or this
    response.sendRedirect("./TestServCon");

  • Why does the Java method ServletContext.getResourceAsStream return null with a know good path to an xsl file?

    iPLANET ISSUE
    Why does the Java method ServletContext.getResourceAsStream return null with a know good path to an xsl file?
    CODE
    ServletContext context = mpiCfg.getServletConfig().getServletContext();
    // Debugging
    out.print(context.getServerInfo());     // Get server info
    out.print(&#8220;getRealPath = &#8221; + context.getRealPath("WEB-INF/xsl/RedirectToAcs.xsl"));
    String strXslName = "RedirectToAcs.xsl";
    InputStream is = context.getResourceAsStream("WEB-INF/xsl/"+ strXslName);
    TRACE FROM THE LOG
    [26/Jul/2002:08:23:15] info ( 2868): [0][][ClearCommerceCcpaMpi][]getServerInfo() = iPlanet-WebServer-Enterprise/6.0, getRealPath() = C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl\RedirectToAcs.xsl
    [26/Jul/2002:08:23:15] info ( 2868): [0][][ClearCommerceCcpaMpi][]strXslName = RedirectToAcs.xsl, is = null
    [26/Jul/2002:08:23:15] info ( 2868): [1][][ClearCommerceCcpaMpi][16]ResourceAsStream is null
    [26/Jul/2002:08:23:15] info ( 2868): [1][][ClearCommerceCcpaMpi][30]Problem reading XSL file.
    DIRECTORY DUMP
    C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl>dir
    Volume in drive C has no label.
    Volume Serial Number is 9457-EBF4
    Directory of C:\iPlanet\Servers\web-apps\ccpa\WEB-INF\xsl
    07/22/2002 05:54p <DIR> .
    07/22/2002 05:54p <DIR> ..
    07/22/2002 05:54p 3,086 RedirectToAcs.xsl
    07/22/2002 05:54p 3,088 Response.xsl
    2 File(s) 6,174 bytes
    2 Dir(s) 1,797,405,696 bytes free

    I think there's supposed to be a forward slash before WEB-INF.
    InputStream is = context.getResourceAsStream("/WEB-INF/xsl/"+ strXslName);

  • Passing Objects: ServletContext versus JNDI

    I am currently developing a Web application that uses a variation of the (often recommended) model-view-controller architecture. Specifically, I have a single Front Controller Servlet that identifies what the request is for, and then delegates processing to an appropriate RequestHandler object. As implied by the name, the RequestHandler object has access to the original HttpServletRequest object.
    In its init() method, the Front Controller Servlet prepares a pool of database connections. Each RequestHandler will obtain a connection through a DataSource object (in accordance with "best practices" for using the JDBC 2.0 Optional Extension). Then, the RequestHandler will retrieve data from the database, instantiate a Java Bean, and pass the Bean on to a corresponding JSP page for display.
    Here is my dilemma: what is the best way to make the DataSource available to the RequestHandler objects?
    Most sources suggest registering the DataSource with JNDI, but - as far as I can tell - this seems to require "administrative" access to the Web application server. For example, performing this action with Tomcat 4.0 requires modification of the server.xml file (as described at http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html).
    I would prefer to just stuff the DataSource into the ServletContext so that it is accessible throughout my Web application. (Then my DataSource would not be accessible, via JNDI, to other applications on the same server - such as in a shared hosting environment.) However, the problem is that my helper classes - the RequestHandlers - are not Servlets or JSPs (just regular classes), and therefore do not have access to a ServletConfig and, consequently, cannot access the ServletContext. Of course, I could stuff a reference to the ServletContext in every HttpServletRequest before passing it on to the helpers, but that doesn't seem "clean."
    So, to summarize this lengthy inquiry,
    (1) How can helper classes (i.e., not Servlets) access the Web application context (ServletContext)?
    (2) What are the advantages/disadvantages to using JNDI to expose resources, versus simply storing objects in the ServletContext object, when trying to make resources available throughout a single Web application?
    Thanks!
    - Scott
    [email protected]

    Right you deal two problems:
    1 The passing of servletcontext to helper classes. You can avoid this by creating a web application and storing it in a war file. You place all your servlets/jsp/helper classes in the war file according to a given structure. Each war file has a web.xml file. The web.xml file has all mappings between names in the program and the references to the objects. The web.xml can also have references between jndi names and references using the <env-entry> tag. There is only one servletcontext per web application. You can place all the information that both helper classes and servlets use e.g. jndi references into the web.xml. It is possible for the servletcontext and helper classes to refer to the same web.xml.So you have no need to exchange a servletContext reference around. See information on servletcontext interface:
    http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletContext.html
    Second the question of isolating Datasources between applications. Could you not password protect the datasources so that access is only permissible if you have the correct password? Hence you can control the use of the datasource.
    There are a number of tools to create a war application and to add jndi references to a war file.
    You can use the graphical deployment tool from Sun's J2EE implementation.
    All details for creating a war file are: http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/WebComponents3.html
    There are facilites to register environment variables like DataSources using the tool - look in the J2EE tutorial under configuring web clients.
    Or you can use the packager tool found in Sun's J2EE application:
    http://java.sun.com/j2ee/j2sdkee/techdocs/guides/ejb/html/Tools7.html
    You can then port these war files onto tomcat to be hosted.
    You will need to download the J2EE implementation.
    For information on how to structure your web application and create a war file see: http://java.sun.com/j2ee/j2sdkee/techdocs/guides/ejb/html/Tools7.html
    All information to create J2EE components:
    http://developer.java.sun.com/developer/onlineTraining/J2EE/Intro/
    Hope this helps.

  • Execution stops after retrieving the factory from the ServletContext while

    Hi,
    I just started working with Quartz, so I am clueless as to why I am getting this error. This is my first time tying to integrate Quartz 1.6.0 in a web app. I am using the JSF Framework. Although I have added the necessary jars I am still getting the error above: servlet.jar not loaded. If you follow the java code and server output you can see that after retrieving the factory from the ServletContext there is no further execution . Following is the definition of the class used for scheduling:
    Quartz Version: 1.6.0
    IDE : Netbeans 5.0
    AppServer: Tomcat 5.5
    *************************************** JAVA CODE *************************************
    * BirthdayScheduler.java
    * Created on May 20, 2008, 5:24 PM
    package com.csg.cs.cscomwebdev.servlet.timer;
    import java.io.*;
    import java.net.*;
    import java.util.Date;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import org.quartz.JobDetail;
    import org.quartz.SchedulerException;
    import org.quartz.SimpleTrigger;
    import org.quartz.impl.StdSchedulerFactory;
    import org.quartz.Scheduler;
    * @author Arijit Datta
    * @version
    public class BirthdayScheduler extends HttpServlet {
    /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
    * @param request servlet request
    * @param response servlet response
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    out.close();
    /** Handles the HTTP <code>GET</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    /** Handles the HTTP <code>POST</code> method.
    * @param request servlet request
    * @param response servlet response
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    public void init()
    System.out.println(" ------------ STARTTING JOB --------------");
    // Retrieve the ServletContext
    ServletContext theApplicationsServletContext = this.getServletContext();
    // Retrieve the factory from the ServletContext
    StdSchedulerFactory factory =(StdSchedulerFactory)theApplicationsServletContext.getAttribute("QuartzFactory Servlet.QUARTZ_FACTORY_KEY");
    System.out.println(" ------------ FACTORY GOT --------------");
    try {
    // Retrieve the scheduler from the factory
    Scheduler scheduler = factory.getScheduler();
    System.out.println(" ------------ SCHEDULER GOT --------------");
    // Start the scheduler
    scheduler.start();
    System.out.println(" ------------ SCHEDULER STARTED --------------");
    //Creating a job
    JobDetail birthdayJobDetail = new JobDetail("birthdayReminderJob", scheduler.DEFAULT_GROUP, BirthdayReminderJob.class );
    System.out.println(" ------------ JOB CREATED --------------");
    //Creating a trigger
    SimpleTrigger birthdayJobtrigger = new SimpleTrigger("birthdayReminderTrigger",scheduler.DEFAULT_GROUP, new Date(),null,SimpleTrigger.REPEAT_INDEFINITELY, 60L * 1000L);
    System.out.println(" ------------ TRIGGER CREATED --------------");
    //Scheduling the job
    scheduler.scheduleJob(birthdayJobDetail,birthdayJobtrigger );
    System.out.println(" ------------ JOB SCHEDULED --------------");
    } catch (SchedulerException ex) {
    System.out.println(ex.getMessage());
    } ************************************* SECTION OF WEB.XML ************************
    <servlet>
    <description>Quartz Initializer Servlet</description>
    <servlet-name>QuartzInitializer</servlet-name>
    <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet -class>
    <init-param>
    <param-name>shutdown-on-unload</param-name>
    <param-value>true</param-value>
    </init-param>
    <init-param>
    <param-name>start-scheduler-on-load</param-name>
    <param-value>true</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>BirthdayScheduler</servlet-name>
    <servlet-class>com.csg.cs.cscomwebdev.servlet.timer.BirthdayScheduler< /servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet> *********************************** SERVER OUTPUT *******************************
    Using CATALINA_BASE: C:\Documents and Settings\165171\.netbeans\5.0\jakarta-tomcat-5.5.9_base
    Using CATALINA_HOME: D:\Program Files\netbeans-5.0\enterprise2\jakarta-tomcat-5.5.9
    Using CATALINA_TMPDIR: C:\Documents and Settings\165171\.netbeans\5.0\jakarta-tomcat-5.5.9_base\temp
    Using JAVA_HOME: C:\Program Files\Java\jdk1.5.0_02
    May 20, 2008 7:27:13 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8084
    May 20, 2008 7:27:13 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 766 ms
    May 20, 2008 7:27:13 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    May 20, 2008 7:27:13 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    May 20, 2008 7:27:13 PM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    May 20, 2008 7:27:14 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
    INFO: validateJarFile(D:\Java Programs\cs\CSCOMWEBDEV\build\web\WEB-INF\lib\servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
    log4j:WARN No appenders could be found for logger (org.apache.catalina.session.ManagerBase).
    log4j:WARN Please initialize the log4j system properly.
    ------------ STARTTING JOB --------------
    ------------ FACTORY GOT --------------
    May 20, 2008 7:27:15 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8084
    May 20, 2008 7:27:15 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8009
    May 20, 2008 7:27:15 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/32 config=null
    May 20, 2008 7:27:15 PM org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    May 20, 2008 7:27:16 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 2802 ms Can anybody please help out? Where exactly am I going wrong?
    Thanks a lot!
    AD

    Your stop condition is "continue if true". This means that, unless you press the button, the while loop will stop after one iteration.
    First, you should change the termination condition to "stop if true".
    Then you should make the stop button "latch when released" (right-click..mechanical action). Else you don't have a well defined state after the program stops.
    You should decide on a reasonable loop rate and enter it for the wait control. (beter use a diagram constant if the value is always the same).
    Why do you need to continue reading in a loop? Are you expecting the response to change over time?
    Do you want to keep appending to the string indicator or only show the latest characters received?
    Maybe you also need a wait between the writing and reading?
    Delete the ms timer value indicator, it is completely useless.
    Do you get any error codes?
    Don't use the run continous button. Use the plain run button.
    What device are you communicating with? Do you have documentation?
    LabVIEW Champion . Do more with less code and in less time .

  • ServletContext cannot be resolved to a type

    ServletContext cannot be resolved to a type error in Eclipse
    Hi,
    I keep getting the following error in my workspace:
    "ServletContext cannot be resolved to a type"
    The code seems to work fine in other JSP's but when I copy to some pages the error appears.
    Could someone please provide some advise on why the error occurs? And maybe were to look to find a solution?
    Thanks in advance.

    Hey,
    can you please explain me how you fixed your problem?
    I have a similar problem i think> i have a tomcat 6.0.2 and im trying to run a servlet, the serlvet/api.jar is included in the build path but it doesnt work, i get the following errors
    javax.servlet.ServletException: Error instantiating servlet class SimpleXSLTServlet
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
         java.lang.Thread.run(Unknown Source)
    java.lang.Error: Unresolved compilation problems:
         HttpServlet cannot be resolved to a type
         ServletConfig cannot be resolved to a type
         ServletException cannot be resolved to a type
         HttpServletRequest cannot be resolved to a type
         HttpServletResponse cannot be resolved to a type
         ServletException cannot be resolved to a type
         The method getServletContext() is undefined for the type SimpleXSLTServlet
         SimpleXSLTServlet.<init>(SimpleXSLTServlet.java:23)
         sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
         sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
         java.lang.reflect.Constructor.newInstance(Unknown Source)
         java.lang.Class.newInstance0(Unknown Source)
         java.lang.Class.newInstance(Unknown Source)
         org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
         org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
         org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
         org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
         java.lang.Thread.run(Unknown Source)
    Could you please help me, I think im just not seeing the point...
    Thanks a lot!!

  • Accessing ServletContext from Java class Data Control

    I'm writing some business service classes as plain old java classes that will be bound to a JSP using ADF and STRUTS. The business logic requires the real path of the servlet context to access a file. How do I call servletContext.getRealPath("/WEB-INF/test.xml")?
    I know this is mixing web tier code into model code, but I don't know any other way to do this.
    Thanks in advance...

    Ok, it looks like I'll have to define my own action class and pass the pathname on to the data control class.

  • Performance tuning: lite sessions and local ServletContext

    I have been doing some research on iPlanet performance tuning. In our
    current production environment (iAS6.0 SP1B, iWS4.1 SP2 on Solaris), since
    we don't use clustering there should be a couple of performance improvements
    we can make immediately:
    1. Use lite sessions (<session-impl>lite</session-impl> in ias-web.xml) - I
    believe that if you use lite sessions, the session data is stored in the kjs
    process space as opposed to the kxs process space. This, of course, means
    that if a kjs dies the user's on it will lose their session information but
    it will provide a performance improvement by reducing kxs/kjs communication.
    2. Use local ServletContexts (<distributable>false</distributable> in
    web.xml) - This should cause the ServletContext to only be stored in the
    originating JVM. So again, if a kjs dies, the user will lose their
    ServletContext but again we will get a performance improvement by reducing
    kxs/kjs communcation.
    What I want to understand is how our load balancing configuration will
    effect our production environment if we use this configuration. Right now
    we use sticky load balancing on all our servlets but we don't have our JSPs
    registered and therefore sticky load balancing cannot always be trusted to
    return users to the iAS they came from. We make up for this by using
    hardware load balancing that keeps the majority of our users sticky.
    However, using lite sessions and local ServletContexts will require that a
    user not only stick to an iAS, but to a specific kjs as well. Using sticky
    load balancing would ensure that, but since we also rely on our hardware
    load balancers, could they create a problem? If a user gets sent back to
    the iAS they came from by our hardware load balancers, will the kxs process
    be smart enough to return them to the kjs they came from? If so, then I
    think that means that we can safely switch to lite sessions and local
    ServletContexts, but if not, I think many users will lose their sessions.
    Thanks,
    Linc

    Please follow thru this link for your answers
    http://developer.iplanet.com/viewsource/char_tuningias/index.jsp
    Thanks
    Shital Patel
    Lincoln wrote:
    I have been doing some research on iPlanet performance tuning. In our
    current production environment (iAS6.0 SP1B, iWS4.1 SP2 on Solaris), since
    we don't use clustering there should be a couple of performance improvements
    we can make immediately:
    1. Use lite sessions (<session-impl>lite</session-impl> in ias-web.xml) - I
    believe that if you use lite sessions, the session data is stored in the kjs
    process space as opposed to the kxs process space. This, of course, means
    that if a kjs dies the user's on it will lose their session information but
    it will provide a performance improvement by reducing kxs/kjs communication.
    2. Use local ServletContexts (<distributable>false</distributable> in
    web.xml) - This should cause the ServletContext to only be stored in the
    originating JVM. So again, if a kjs dies, the user will lose their
    ServletContext but again we will get a performance improvement by reducing
    kxs/kjs communcation.
    What I want to understand is how our load balancing configuration will
    effect our production environment if we use this configuration. Right now
    we use sticky load balancing on all our servlets but we don't have our JSPs
    registered and therefore sticky load balancing cannot always be trusted to
    return users to the iAS they came from. We make up for this by using
    hardware load balancing that keeps the majority of our users sticky.
    However, using lite sessions and local ServletContexts will require that a
    user not only stick to an iAS, but to a specific kjs as well. Using sticky
    load balancing would ensure that, but since we also rely on our hardware
    load balancers, could they create a problem? If a user gets sent back to
    the iAS they came from by our hardware load balancers, will the kxs process
    be smart enough to return them to the kjs they came from? If so, then I
    think that means that we can safely switch to lite sessions and local
    ServletContexts, but if not, I think many users will lose their sessions.
    Thanks,
    Linc

  • Tracking session / servletcontext activity

    I'm trying to do a section in my code that will show in a webpage how many users are online, both "guests" and authenticated users.
    My user authentication is handled by simply supplying a username and password, check them against a database, and if good then their usernames get added to their httpsession as an attribute.
    I tried doing a httpsessionlistener, but i found out that as soon as the session gets created / destroyed, the listener takes over before the attributes are set, so i can't seem to use that.
    I thought that maybe a servletcontext listener is the way to go; as soon as the user logs in then the username can be saved in the servlet context and when logging out then remove the attribute.
    Is my thinking flawed, or do you know of a better way? I would appreciate your comments.

    Right now my sql_trace parameter has been set to true.If you have set this parameter at system level, then, you would probably killing database performance badly. If you set this parameter system level, each and every actions from users as well oracle background process action, records in the trace file.
    Make sure that you haven't set it system level.
    If you wanna set to a particular session, you do it either through the application or if you know the session id, you can set 10046 event for this session.
    Jaffar

  • Need information abt ServletContext and ServletConfig

    i want to know the information and difference b/w in ServletContext and ServletConfig pls help me.
    Thanks&Regards
    kishore

    ServletConfig serves a very specific purpose, a means to get configuration parameters from the web.xml INTO you servlet. AFAIK, it doesn't serve much purpose beyond that...
    ServletContext provides the mechanism for a Servlet to communication with the Container. You can get path information, use it to store application wide attributes and parameters, etc.
    The two really have absolutely nothing in common. So to answer your rather vague question:
    "The difference b/w ServletContext and ServletConfig: Everything."
    Do you have a more specific question? Is there a particular thing (like maybe the fact they both have methods named getInitParameter and getInitParmaterNames....) that is confusing you?

Maybe you are looking for