Initiating servlet Tomcat 4.0

Hi,
I have servlet that worked fine when I was
using tomcat 3.2.2 and 3.2.3 but now when
I upgraded to tomcat 4.0 the entire server crashes
while initiating my servlet.
The servlet throws an exception when I call
getServletConfig or getServletContext.
Anybody had similar problems ?
I am runninng Tomcat 4.0 on Windows 2000 with java 1.3.
/guha

Correction, the server does not crash, but the servlet throws an exception
while executing the init section of the servlet. the error message from
this exception is null. My init looks like this,
the exception is thrown while executing the first two lines
in the init method
try
props = new ServletProperties(getServletConfig());
ServletContext context = this.getServletContext();
errorHandler = new ErrorHandler(context,props);
dbConn = new DBStateHolder(errorHandler,props);
dbConn.createConnectionCache();
catch (Exception ex)
System.err.print("Error initiating servlet: " + ex.getMessage());

Similar Messages

  • How do I set the initial servlet pool size in WL 5.1

              In WL 4.5, I can set the initial servlet pool size using the
              weblogic.httpd.servlet.SingleThreadedModelPoolSize. I tried to set this property in WL 5.1, and get an "Found undeclared property..." message when booting WL. Is this feature still supported in WL 5.1? If so, how do I set it?
              Thankx
              

    It appears that pool size of 5 is hardcoded somewhere - no matter where you specify
              weblogic.httpd.servlet.SingleThreadedModelPoolSize, the following test servlet:
              import javax.servlet.*;
              import javax.servlet.http.*;
              public class SingleT extends HttpServlet implements SingleThreadModel {
              static int instanceCount = 0;
              public SingleT() {
              super();
              System.out.println("Instance " + (++instanceCount) + " created");
              always produces:
              Instance 1 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Instance 2 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Instance 3 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Instance 4 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Instance 5 created
              Wed Nov 01 11:15:36 PST 2000:<I> <ServletContext-General> SingleT: init
              Joe Trung <[email protected]> wrote:
              > Hi Huy,
              > There are lot of 'undeclared' stuffes if you move from 451 to 51.
              > However, if you run WLS with
              > '-Dweblogic.httpd.servlet.SingleThreadedModelPoolSize=10'
              > You will get what you want. I think BEA has moved this option to the <System props>, no more in its <config>
              > Joe
              > "Huy Pham" <[email protected]> wrote:
              >>
              >>In WL 4.5, I can set the initial servlet pool size using the
              >>weblogic.httpd.servlet.SingleThreadedModelPoolSize. I tried to set this property in WL 5.1, and get an "Found undeclared property..." message when booting WL. Is this feature still supported in WL 5.1? If so, how do I set it?
              >>
              >>Thankx
              Dimitri
              

  • Error Initializing Servlet

    We are getting this error on our Requisite Catalog server Error Initializing Servlet when trying to access our requisite URL.  Any ideas?

    Hi
    Please go through the pointers below ->
    Error writing to servlet
    Bugseye quick search does not function
    Re: CSV-File with eclass 4.1 oder 5.x
    Regards
    - Atul

  • Servlet + Tomcat NoClassDefFoundError

    Hi,
    I am developing a servlet which takes data from Amazon's Web services (in XML format) and then outputs a RSS feed. I use xerces for parsing the XML and then use Rome to output the RSS feed. When I run the servlet then I get the following error.
    However when I run the same code over the commandline, it runs fine, however running it as a servlet, it shows the NoClassDefFoundError . I am also sending the code , it contains the commented out System.out statements which I use when I am running it over the command line
    Thanks
    Gaurav
    javax.servlet.ServletException: Invoker service() exception
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:524)
         at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         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 filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         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 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
         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:2416)
         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:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.NoClassDefFoundError
         at form_input.doPost(form_input.java:84)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:466)
         at org.apache.catalina.servlets.InvokerServlet.doPost(InvokerServlet.java:216)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         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 filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         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 org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
         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:2416)
         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:223)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:601)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
         at java.lang.Thread.run(Thread.java:536)
    The Code:
    //JAXP 1.1
    import org.w3c.dom.*;
    import org.w3c.dom.Document;
    import javax.xml.parsers.*;
    import org.apache.xerces.dom.DocumentImpl;
    import org.apache.xerces.dom.DOMImplementationImpl;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.net.*;
    import java.util.Vector;
    import org.apache.xerces.jaxp.*;
    import org.apache.xerces.*;
    import org.apache.xerces.dom.*;
    import org.apache.xerces.parsers.*;
    //import org.apache.xml.serialize.*;
    import org.xml.sax.*;
    import com.sun.syndication.feed.synd.*;
    import com.sun.syndication.io.SyndFeedOutput;
    import com.sun.syndication.io.FeedException;
    import java.io.IOException;
    import java.text.ParseException;
    import java.io.FileWriter;
    import java.io.Writer;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.List;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class form_input extends HttpServlet
    private static final DateFormat DATE_PARSER = new SimpleDateFormat("yyyy-MM-dd");
         public void doGet(HttpServletRequest request, HttpServletResponse response)
                             throws IOException, ServletException
              doPost(request,response);
         public void doPost(HttpServletRequest request, HttpServletResponse response)
                             throws IOException, ServletException
    response.setContentType("text/xml");
              PrintWriter out = response.getWriter();
              URL data = new URL("http://xml.amazon.com/onca/xml3?t=myWebsite-20&dev-t=1RX5WFR818MJJAEN8A02&KeywordSearch=dogs&mode=books&type=lite&page=1&f=xml");
              URLConnection connection = data.openConnection();
              connection.setUseCaches(false);
    Document doc= null;
              NodeList DetailList = null;
              NodeList DetailChildren = null;
              Node Detail = null;
              Node DetailChild = null;
              Node ChildValue = null;
              DOMParser dparsers = new DOMParser();
              List entries = new ArrayList();
              SyndFeed feed = new SyndFeedImpl();
              SyndEntry entry;
              SyndContent description;
              SyndFeedOutput output = new SyndFeedOutput();
              try
                   feed.setFeedType("rss_1.0");
                   feed.setTitle("Amazon search for dog");
    feed.setLink("http://www.amazon.com");
    feed.setDescription("Amazon search results for dogs");
                   dparsers.parse(new InputSource(connection.getInputStream()));
                   doc = dparsers.getDocument();
                   DetailList = doc.getElementsByTagName("Details");
                   for( int i=0; i<DetailList.getLength(); i++)
                        Detail = DetailList.item(i);
                        DetailChildren = Detail.getChildNodes();
                        entry = new SyndEntryImpl();
                        for( int j=0; j<DetailChildren.getLength(); j++)
                             //Iterate through each of the children and start filling out the RSS thingie
                             //Gotta extract Asin, ProductName, ReleaseDate, Manufacturer, Authors -> Author
                             DetailChild = DetailChildren.item(j);
                             if(DetailChild.getNodeName().equals("Asin"))
                                  //if(DetailChild.hasChildNodes())
                                  //     System.out.println(DetailChild.getNodeName() + " has child nodes");
                                  ChildValue = DetailChild.getFirstChild();
                                  //System.out.println(DetailChild.getNodeName()+ " type = "+DetailChild.getNodeType()+" value="+ChildValue.getNodeValue());
                                  entry.setLink("http://www.amazon.com/exec/obidos/ASIN/"+ChildValue.getNodeValue());
                                  //System.out.println("Match found for Asin");
                             else if(DetailChild.getNodeName().equals("ProductName"))
                                  ChildValue = DetailChild.getFirstChild();
                                  //System.out.println(DetailChild.getNodeName()+ " type = "+DetailChild.getNodeType()+" value="+ChildValue.getNodeValue().length());
                                  if(ChildValue.getNodeValue().length() > 100 )
                                       entry.setTitle(ChildValue.getNodeValue().substring(0,100));
                                  else
                                       entry.setTitle(ChildValue.getNodeValue());
                                  //System.out.println("Match found for ProductName");
                             else if(DetailChild.getNodeName().equals("ReleaseDate"))
                                  ChildValue = DetailChild.getFirstChild();
                                  //System.out.println(DetailChild.getNodeName()+ " type = "+DetailChild.getNodeType()+" value="+ChildValue.getNodeValue());
                                  //System.out.println("ReleaseDate: "+DetailChild.getNodeValue());
                                  //entry.setPublishedDate(DATE_PARSER.parse(DetailChild.getNodeValue()));
                                  entry.setPublishedDate(DATE_PARSER.parse("2004-07-07"));
                                  //System.out.println("Match found for ReleaseDate");
                             else if(DetailChild.getNodeName().equals("Manufacturer"))
                                  ChildValue = DetailChild.getFirstChild();
                                  //System.out.println(DetailChild.getNodeName()+ " type = "+DetailChild.getNodeType()+" value="+ChildValue.getNodeValue());
                                  description = new SyndContentImpl();
                                  description.setType("text/plain");
                                  description.setValue("Initial release of Rome");
                                  entry.setDescription(description);
                        entries.add(entry);
                   feed.setEntries(entries);
                   String fxml = output.outputString(feed);
                   out.println(fxml);
              catch (ParseException ex) {
    // IT CANNOT HAPPEN WITH THIS SAMPLE
    ex.printStackTrace();
    out.println("ERROR: "+ex.getMessage());
              catch( SAXException se)
                   se.printStackTrace();
    out.println("ERROR: "+se.getMessage());
              catch (Exception ex) {
    ex.printStackTrace();
    out.println("ERROR: "+ex.getMessage());

    Hi,
    I am building the servlet for now in
    $TOMCAT_HOME/webapps/examples/WEB-INF/classes ,
    however there is no 'lib' directory in
    $TOMCAT_HOME/webapps/examples/WEB-INF . I created one
    and put the jar files there, but still I get the same
    error. Infact when I start the server, I do not see
    the jar file in CLASSPATH
    Thanks
    GauravYou shouldn't be putting your app in the examples directory.
    You should create a directory under TOMCAT_HOME/webapps for YOUR individual apps. Each one should have a WEB-INF directory under that, and /classes and /lib under that. Your web.xml belongs in the WEB-INF directory. Your .class files, and their package directories, belong under WEB-INF/classes. 3rd party JARs, like JDBC drivers, belong in WEB-INF/lib.
    The problem is that you don't know how to deploy a Web app properly on Tomcat.

  • Error (Unsupported major.minor version 49.0)  in Servlet - Tomcat 4.1

    Hello,
    I have got below error when i have run web application with JSP,Servlet,beans:
    I have used Tomacat 4.1, 5.0 and 5.9.No change ???
    I am using j2sdk1.4.2_03 and j2re1.4.2_03.
    This is the complete project i want to run in my PC
    when i extract .war file and run on my PC it's generate below error :
    This is urgent For me . PLEASE HELP
    ERROR :
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Error allocating a servlet instance
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:672)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
         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:2422)
         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:163)
         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:199)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:536)
    root cause
    java.lang.UnsupportedClassVersionError: com/innovapark/soar/jsp/index_jsp (Unsupported major.minor version 49.0)
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1679)
         at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:968)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1409)
         at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1289)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:885)
         at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
         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:2422)
         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:163)
         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:199)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
         at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
         at java.lang.Thread.run(Thread.java:536)
    Apache Tomcat/4.1.30
    Thank You
    Neon

    Solved
    Just do these things.... If you initially complied your classes in jdk1.5 and if u r trying to run the same in 1.4.2 or other.. The already compiled classes will be expecting jdk 1.5 JRE for their runtime execution. So what u have to do is......
    1.stop ur sever
    2.delete the work directory in tomcat
    3.Delete the work directory in your projects web-app Folder
    4.Now cleann the project... Build... and Run Again ... . It should work...
    if still it dont , i prefer use only jdk1.4.2 on system.. set enviorment variebles for it...Reinstall tomcat .. and do above mentioned steps ,,, This should solve the problem...
    Message was edited by:
    sunildm4u

  • Error (Unsupported major.minor version 49.0) in Servlet - Tomcat 5.0.19

    Hello,
    I am completely new to developing java web applications and I dealing with some very strange behavior. I am simply trying to run tomcat through a tomcat plugin for debugging purposes. When I start tomcat via the command line my application runs fine. When I start tomcat via the eclipse plugin, the server starts without any errors, however when I try to access certain pages via web browser I receive the error
    javax.servlet.ServletException: com/sun/tools/javac/Main (Unsupported major.minor version 49.0)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:256)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
         org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254)
         org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    root cause
    java.lang.UnsupportedClassVersionError: com/sun/tools/javac/Main (Unsupported major.minor version 49.0)
         java.lang.ClassLoader.defineClass0(Native Method)
         java.lang.ClassLoader.defineClass(Unknown Source)
         java.security.SecureClassLoader.defineClass(Unknown Source)
         java.net.URLClassLoader.defineClass(Unknown Source)
         java.net.URLClassLoader.access$100(Unknown Source)
         java.net.URLClassLoader$1.run(Unknown Source)
         java.security.AccessController.doPrivileged(Native Method)
         java.net.URLClassLoader.findClass(Unknown Source)
         org.apache.catalina.loader.StandardClassLoader.findClass(StandardClassLoader.java:520)
         org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:857)
         org.apache.catalina.loader.StandardClassLoader.loadClass(StandardClassLoader.java:756)
         java.lang.ClassLoader.loadClassInternal(Unknown Source)
         java.lang.Class.forName0(Native Method)
         java.lang.Class.forName(Unknown Source)
         org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.doesModernCompilerExist(CompilerAdapterFactory.java:174)
         org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:132)
         org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:969)
         org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:799)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:390)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
         org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
         org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:254)
         org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309)
         org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    I realize this is occurring due to java version issues however I cannot understand why simply running tomcat via the eclipse plugin causes this since the jvm settings all appear to be correct

    I'm seeing exactly the same thing with Tomcat 4.1 ---also new to Java, no idea how to go about fixing this.
    However, since you posted this in August and nobody has responded, it's not clear that this forum is going to be much use.
    Sigh

  • Problem with instaling servlet -Tomcat 4.01 -Win98

    Problem is in web.xml fajl
    I use
    <servlet>
    <servlet-name>name</servlet-name>
    <servlet-class>package.name</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>name</servlet-name>
    <url-pattern>/*</url-pattern>
    </servlet-mapping>
    Fajl are in webapps/xxx folder Then I start aplication it's work but there is no pictures. (I put them in webapps/xxx/pictures folder, and call them in servlet with img src=\"/xxx/pictures/picture1.gif"\)
    Thanks

    Hi,
    if I understand, you generate img tag from your servlet.
    But the img tag is evaluate by client (navigator), so the path must be relative to the servlet root :
    img src="pictures/xxx.jpg"
    if don't work, try ./pictures/xxx.jpg, but I think it work for Websphere, the first path should work under tomCat.
    Regards.

  • Servlet, Tomcat 3.3, IIS virtual directory access denied

    Hello people,
    I've set up Tomcat to run as a service with a domain log on usr/pswd. IIS works fine redirecting servlet requests to Tomcat via ISAPI redirector. All on Windows 2000 Server.
    The problem:
    The java application creates and reads files from a location which corresponds to an IIS virtual directory and is also a local directory with respect to the Tomcat and IIS installation. The application is denied access to this directory when submitting a network path (\\server/drive/directory/) where to store and read files, but is happy when a local path is given instead (E:/) Why? The domain user should have complete access to this. Is it Tomcat, IIS, or java restrictions?
    I appreciate any suggestion on this
    Thanks

    The problem would be with the logon that you have Tomcat running under. Writing to a file accessed by network share (\\server\share) is not a problem under Java as long as the logon has appropriate privileges. If you are writing to something of the form \\server\c$\directory, as it sounds like you might be, the logon may need administrator access to the box (in order to see \\server\c$).

  • Servlet/Tomcat using HTTPsUrlConnection error

    Hello all,
    I am fairly new to java/tomcat and am attempting to develop an SSO connection. When I get to the following line of code in my servlet
    HttpsURLConnection httpConn = (HttpsURLConnection)sso.openConnection();
    I receive the following error:
    SingleSignOn threw exception
    java.lang.ClassCastException: sun.net.www.protocol.http.HttpURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection
    Any help is much appreciated.
    Regards,
    --Omar
    Edited by: user7041419 on Nov 17, 2010 3:26 PM

    Yes that is one of the issues I have. Thanks for the assistance.

  • Servlet tomcat

    I create a subfolder of webapps named ANDREA and three subfolders of this with suorces files. down WEB-INF I put the folder class with other subfolders with the .class files, and the web.xml. I put a tag context into server.xml:
    I start file index.jsp and all is ok when I call my servlet HelloWorld.class , the result is
    Apache Tomcat/4.0.6 - HTTP Status 500 - Internal Server Error
    type Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Error allocating a servlet instance
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:659)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 214)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    a t org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.jav a:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:17 4)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:102 7)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125) at java.lang.Thread.run(Thread.java:479)
    root cause
    java.lang.NoClassDefFoundError: servlet/IndexServlet (wrong name: IndexServlet)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoade r.java:1643)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:9 37)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1 372)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1 254)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:867)& lt; BR> at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:655)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java: 214)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java: 190)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
    a t org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.jav a:170)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:17 4)
    at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
    at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:102 7)
    at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125) at java.lang.Thread.run(Thread.java:479)
    help me please
    sorry for my english but i'm Italian......Forza Roma

    there is a conflict here, 404 is an HTTP error , and should be returned to the user when the resource(request url) is not found on the server , this is not related to Java or any server technology , just HTTP.
    In java servers , any error occures during processing (inside JVM) , an internal server error is returned .
    a servlet class doesnot correpsond to a url

  • Running HelloWorld Servlet--Tomcat 4.1

    Dear Sir,
    With most humble submission I would like to inform you that I have recently downloaded Tomcat 4.1 from http://jakarta.apache.org/ and installed it on Windows 98. I am using jdk1.3
    I am an amateur for Java Servlets. I am following the instructions given in the book "Java Servlet Programming" by O'reilly and according to this book I have to store my class files(I tried with HelloWorld.class) in the dir server_root/webapps/root/web-inf/classes dir. but when i called it from microsoft internet explorer 5.0(the browser i am using currently) using the URL http://localhost:8080/servlet/HelloWorld
    I get the 404 error.
    I also tried to call a static file (.html) by storing it in the dir server_root/webapps/root(according to the book) and i get the proper output but not in case of .class file. Even the example codes provided with the server do not run.
    Please help me to fix out my problem.
    Thanking you in anticipation,
    Yours sincerely
    roopesh

    Hi:
    1)You need set classpath
    2) do you open your Tomcat?
    Thank

  • Jsp   /   servlet   /   tomcat

    hi,
    I am using tomcat server. The servlet uses Process class of java.
    i.e.
    Runtime.getRuntime.exec...
    Now what happens is that, when many clients are using the system at the same time the output they receive gets mixed up.
    e.g.
    user1: print - "this is user one" , receive - "this is user two"
    user2: print - "this is user two" , receive - "this is user one"
    Since tomcat takes care of multi-threading and so there should not be any overlap. Is it possible that it is the that the process created may be causing such a mixup?
    I am really confused about this please help.

    thank you for the reply
    "You need to do copying the output and timing out on separate threads. I would probably farm out the copying process to a thread."
    any idea how to do that?
    This program was handed down to me by someone.... there are many errors in it... and the cause of some which has been mysterious to me so far.
    I have started doing the unit testing... and the first problem i have found where the system outs seem to repeat (i.e. the userids repeat) is the compilation part... i dont know how to solve it
    //servlet
                if(lang.equals("C") || lang.equals("P")){
                    C_Interpreter c_interpreter = new C_Interpreter();
                    c_interpreter.JudgeEngine(lang, countFileUploaded, inputUserInfo.getModfBy(), submInfo.getCourCode(), submInfo.getProbNum(), probInfo.getNumTCTesting(), Integer.parseInt(probInfo.getExpRunTime()), "T");
    //c_interpreter
        public void JudgeEngine(String lang, int intNFU, String CurrentUserID, String CourCode, String ProbNum, int testcase, int expRunTime, String testingMode){
            String compileError = Compilation(lang, intNFU, CurrentUserID, CourCode, ProbNum, testcase, expRunTime, testingMode);
        public String Compilation(String lang, int intNFU, String CurrentUserID, String CourCode, String ProbNum, int testcase, int expRunTime, String testingMode){
            try{
                Runtime rt = Runtime.getRuntime();
                Config config1 = new Config();
                String tempProgStore = "";
                String sampleOutputStore = config1.readKeyValue("online.storagepath")  + "\\" + CourCode + "\\" + ProbNum;
                if(testingMode.equals("T")){ //T is the testing mode being used
                    tempProgStore = sampleOutputStore + "\\" + CurrentUserID + "\\temp";
                }else if(testingMode.equals("S")){
                    tempProgStore = sampleOutputStore + "\\" + CurrentUserID;
                File dir = new File(tempProgStore + "\\");
                String compPath = config1.readKeyValue("onlinejudge.cppCompPath");  //Java Compile Path --- nmake
                Process rd_mak = null;
                Process compileProcess = null;
                rd_mak = rt.exec("cmd /c dir /b " + tempProgStore + "\\*.mak > " + tempProgStore + "\\makname.txt");
                fo.WaitOper(rd_mak);
                LinkedList fileNameList_mak = fo.createFileList(tempProgStore + "\\makname.txt");
                String mak_file = "";
                    for(int i=0; i<fileNameList_mak.size(); i++){
                        mak_file = fileNameList_mak.get(i).toString();
                   compileProcess = rt.exec("cmd /c " + compPath + " " + mak_file + " > error_message.txt ", null, dir);
                   fo.WaitOper(compileProcess);
            }catch(Exception e){System.out.println("Error : "+e.getMessage());
            // i have done modifications here because after this part its just file reading and writing
    --------------------

  • Midlet & Servlet(Tomcat) Connection

    I have built up a midlet that need to connect to the servlet which is hosted using Tomcat ...
    When i click the submit button in the mobile emulator ... i received the following message in the console of Java Wireless ToolKit .... What is the problem actually ? .... Can anyone give me some guides ?
    Any Helps will be appreciated
    "<html><head><title>Apache Tomcat/5.0.12 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Servlet RequestServlet is not available</h1><HR size="1" noshade><p><b>type</b> Status report</p><p><b>message</b> <u>Servlet RequestServlet is not available</u></p><p><b>description</b> <u>The requested resource (Servlet RequestServlet is not available) is not available.</u></p><HR size="1" noshade><h3>Apache Tomcat/5.0.12</h3></body></html>"
    The following is my midlet :
    public class SecondMidletServlet extends MIDlet implements CommandListener, Runnable {
    Display display = null;
    List menu = null;
    TextBox input = null;
    String user = null;
    String url = "http://pup.no-ip.net:8001/Servlet/RequestServlet";
    static final Command backCommand = new Command("Back", Command.BACK, 0);
    static final Command submitCommand = new Command("Submit", Command.OK, 2);
    static final Command exitCommand = new Command("Exit", Command.STOP, 3);
         StringBuffer b = new StringBuffer();
    String currentMenu = null;
         Thread thread;
    public SecondMidletServlet() {
    public void startApp() throws MIDletStateChangeException {
    display = Display.getDisplay(this);
    menu = new List("Invoke Servlet", Choice.IMPLICIT);
    menu.append("Add a user", null);
    menu.addCommand(exitCommand);
    menu.setCommandListener(this);
    mainMenu();
    public void pauseApp() {
    public void destroyApp(boolean unconditional) {
    notifyDestroyed();
    void mainMenu() {
    display.setCurrent(menu);
    public void addName() {
    input = new TextBox("Enter first name:", "", 5, TextField.ANY);
    input.addCommand(submitCommand);
    input.addCommand(backCommand);
    input.setCommandListener(this);
    input.setString("");
    display.setCurrent(input);
    void invokeServlet(String url) throws IOException {
    HttpConnection c = null;
    InputStream is = null;
    OutputStream os = null;
    //StringBuffer b = new StringBuffer();
    TextBox t = null;
    try {
    c = (HttpConnection)Connector.open(url);
                   if(c == null)
                        System.out.println("PKPK");
                   else
                        System.out.println("PSPS");
    c.setRequestMethod(HttpConnection.POST);
    c.setRequestProperty("IF-Modified-Since", "20 Jan 2001 16:19:14 GMT");
    c.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0");
    c.setRequestProperty("Content-Language", "en-CA");
    os = c.openOutputStream();
    String str = "name="+user;
    byte postmsg[] = str.getBytes();
    System.out.println("Length: "+str.getBytes());
    for(int i=0;i<postmsg.length;i++) {
    os.write(postmsg);
    // or you can easily do:
    // os.write(("name="+user).getBytes());
    os.flush();
    is = c.openDataInputStream();
    int ch;
    while ((ch = is.read()) != -1) {
    b.append((char) ch);
    System.out.print((char)ch);
    } finally {
    if(is!= null) {
    is.close();
    if(os != null) {
    os.close();
    if(c != null) {
    c.close();
    //display.setCurrent(t);
         public void run()
              try
                   invokeServlet(url);
                   TextBox t = new TextBox("Second Servlet", b.toString(), 1024, 0);
                   t.addCommand(backCommand);
                   t.setCommandListener(this);
                   display.setCurrent(t);
              catch(Exception ex){}     
         public void refreshScreen(StringBuffer b)
              TextBox t = new TextBox("Second Servlet", b.toString(), 1024, 0);
              t.addCommand(backCommand);
              t.setCommandListener(this);
              display.setCurrent(t);
    public void commandAction(Command c, Displayable d)
    String label = c.getLabel();
    if (label.equals("Exit")) {
    destroyApp(true);
         else if (label.equals("Back")) {
    mainMenu();
         else if (label.equals("Submit"))
    user = input.getString();
    // try {
    //invokeServlet(url);
              thread = new Thread(this);
              thread.start();
              // catch(IOException e) {}
         else {
    addName();
    //Servlet side
    public class RequestServlet extends HttpServlet {
    public void doPost(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException
    response.setContentType("text/plain");
    PrintWriter out = response.getWriter();
    BufferedReader br = request.getReader();
    String buf = br.readLine();
              System.out.println("LSLS");
    out.print("Rec: "+buf);

    Hi,
    Since you use POST Method for the request, you have to implement the doPost(...) Method in the servlet, right? Do a simple implementation of the doGet(...) Method and call the Servlet using a browser. So you can easily check, whether the Servlet is available or not. You got the Error 404 which means, that the Servlet cant be found on the Tomcat. Make sure, that it is deployed correctly and your URL in the MIDlet is also correct.
    hth
    Kay

  • Web.xml configuration for initial servlet load

    Hi all,
    I have heard of entering some tag into web.xml file (deployement descriptor) if we need some servlets to be loaded wheneve the app server starts or restarts. can some body help me regarding what to write in web.xml.
    thanks in advance

    I am having some problems with the same issue although specifying the load-on-startup param is not working for.
    Here is snipet of the web.xml:
    <servlet id="Servlet_1206024889339">
    <servlet-name>ContentServer</servlet-name>
    <servlet-class>COM.FutureTense.Servlet.SContentServer</servlet-class>
    <init-param id="InitParam_1206024988781">
    <param-name>inipath</param-name>
    <param-value>/data/WebSphere/ContentServer</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    This however doesn't init the contentServer servlet. Is there anythign else i need to check? I am using websphere5-1.
    I saw somewhere you might have to specify a loadonstartup=true? Where is this set?
    I know the app is reading the right web.xml because i put in a bad value and saw the error being outputted in the startup log.
    There are some servlets being initialised on startup but not the ones I want. These servlets don't seem to be in the web.xml.
    [10/10/08 11:53:30:265 IST] 1e06de8 WebContainer A SRVE0169I: Loading Web Module: cs.war.
    [10/10/08 11:53:33:330 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: JSP 1.2 Processor: init
    [10/10/08 11:53:34:098 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: SimpleFileServlet: init
    [10/10/08 11:53:34:117 IST] 1e06de8 WebGroup I SRVE0180I: [cs.war] [servlet] [Servlet.LOG]: DirectoryBrowsingServlet: init

  • Initializing servlets in webapp

    I've read in the Weblogic 5.1 docs that the <load-on-startup> tag is
              unsupported. However, I really
              need to be able to initialize my servlets (read in some properties and set
              some context values) Is there any way to work around this. Using the
              weblogic.properties method of weblogic.system.startupClass etc.. doesn't
              seem to work as it's only affecting the default web application. Has anyone
              worked around this problem?
              

    The problem is to know when server startup is complete, because trigger executes right away:
              import javax.naming.*;
              import weblogic.time.common.*;
              import weblogic.common.*;
              public class TestStartup implements Schedulable, Triggerable {
              boolean done = false;
              public void trigger(Schedulable sched) {
              System.out.println("Triggered");
                   done = true;
              public long schedule(long time) {
                   return done ? 0 : time;
              public static void main(String[] args) {
              try {
              TestStartup test = new TestStartup();
              T3ServicesDef t3 = (T3ServicesDef)(new InitialContext()).lookup("weblogic.common.T3Services");
                   ScheduledTriggerDef std = t3.time().getScheduledTrigger(test, test);
                   std.schedule();
              System.out.println("Scheduled");
              Thread.sleep(60 * 1000); // simulate some other time-consuming startup tasks
              System.out.println("Startup done");
              } catch(Exception whatever) {
              whatever.printStackTrace();
              works like this:
              Mon Nov 27 22:36:40 PST 2000:<I> <WebLogicServer> Invoking main-style startup teststartup TestStartup
              Triggered
              Scheduled
              Startup done
              Mon Nov 27 22:37:41 PST 2000:<I> <ListenThread> Listening on port: 7001
              Mon Nov 27 22:37:41 PST 2000:<I> <SSLListenThread> Listening on port: 7002
              Cameron Purdy <[email protected]> wrote:
              > Hi Brian,
              > If your startup class schedules itself to be called after the server
              > completes its startup, then you are fine ;-) From a reply I sent:
              >>Have your startup class implement Schedulable and Triggerable and
              > StartupDef
              >>(or whatever the names are) and have it schedule itself when it gets
              > started
              >>up.
              > BTW - I've never done a URLConnection to "localhost" like that but it should
              > work fine since it resolves to 127.0.0.1 on most machines.
              > p.s. Thanks
              > --
              > Cameron Purdy
              > Tangosol, Inc.
              > http://www.tangosol.com
              > +1.617.623.5782
              > WebLogic Consulting Available
              > "Brian Murray" <[email protected]> wrote in message
              > news:[email protected]...
              >> Isn't it funny how the same day you want to do something you see a post on
              >> how to do it? At least that's how I thought it was going to be when I saw
              >> this reply on my way out the door for vacation. Now that I'm back, I
              > can't
              >> seem to make this work.
              >>
              >> We've created a startup class (our first, btw), implementing T3StartupDef.
              >> In the startup method, we try to "poke" the servlet URL:
              >>
              >> URL url = new URL(http://localhost:7001/xxxx/controller);
              >> InputStream is = url.openStream();
              >>
              >> Unfortunately, this results in connection exception "Connection refused:
              > no
              >> further information". It's as if we're trying to access the URL, before
              > the
              >> HTTP listener is ready to respond.
              >>
              >> Could anyone provide a working code sample, or some tips to make this
              >> technique work?
              >>
              >> P.S. Congrats on your mentor recognition Cameron, you earned it.
              >>
              >>
              >> "Cameron Purdy" <[email protected]> wrote in message
              >> news:[email protected]...
              >> > Generally, accomplish this in the init call.
              >> >
              >> > To force on startup, write a WebLogic startup class that pokes
              >> > http://localhost:7001/whateverapp/yourservlet
              >> >
              >> > (java.net.Url open connection)
              >> > --
              >> >
              >> >
              >> > "TK" <[email protected]> wrote in message
              >> > news:[email protected]...
              >> > > I've read in the Weblogic 5.1 docs that the <load-on-startup> tag is
              >> > > unsupported. However, I really
              >> > > need to be able to initialize my servlets (read in some properties and
              >> set
              >> > > some context values) Is there any way to work around this. Using the
              >> > > weblogic.properties method of weblogic.system.startupClass etc..
              > doesn't
              >> > > seem to work as it's only affecting the default web application. Has
              >> > anyone
              >> > > worked around this problem?
              >> > >
              >>
              >>
              >>
              Dimitri
              

Maybe you are looking for