Native call in Servlet crashing tomcat

I can execute the class from the unix prompt (invoking the main) and it works fine, however when I invoke it withing a servlet or jsp, i get a core dump.
It seems to be a treading issue. I am including the tread dump of ONLY the thread that died.
Any advice on getting this going would be appreciated.
Derek
SIGSEGV 11* segmentation violation
si_signo [11]: SIGSEGV 11* segmentation violation
si_errno [0]:
si_code [2]: SEGV_ACCERR [addr: 0x0]
stackpointer=ba12a2d4
Full thread dump Classic VM (Caldera-UNIX-J2SE-1.3.0_02:*fixes-OU8*fixes-UW7*FCS-OSR5*:020322-03:47, native threads):
"Thread-9" (TID:0xbca3aa50, sys_thread_t:0x83e7738, state:R, native ID:0xe) prio=5
at JavaToCPageInterface.sendMessage(Native Method)
at doit_3._jspService(doit_3.java, Compiled Code)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at org.apache.tomcat.facade.ServletHandler.doService(ServletHandler.java, Compiled Code)
at org.apache.tomcat.core.Handler.invoke(Handler.java:322)
at org.apache.tomcat.core.Handler.service(Handler.java, Compiled Code)
at org.apache.tomcat.facade.ServletHandler.service(ServletHandler.java:485)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java, Compiled Code)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled Code)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java, Compiled Code)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java, Compiled Code)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java, Compiled Code)
at java.lang.Thread.run(Thread.java:484)

More Info:
j2sdk 1.3.1
Tomcat 3
The program executes fine as a stand-along app, however if it is called from withing a servlet or JSP, Tomcat core dumps.
Have tried -Xss10m as a parameter, however it does not work. I have also tried both green and native threads.
Thanks,
Derek

Similar Messages

  • Servlet crashes TOMCAT

    I am experimenting with buffered images in a servlet. This "Hello World" servlet crashes TOMCAT.
    java version "1.4.1"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1)
    Java HotSpot(TM) Client VM (build 1.4.1, mixed mode)
    JAVA_OPTS '-Xmx512m -Djava.awt.headless=true'
    ----servlet begins----
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.image.*;
    import Acme.JPM.Encoders.GifEncoder;
    public class MijnPollServlet extends HttpServlet
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    doPost(req,res);
    public void doPost(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    BufferedImage image=
    new BufferedImage(100,100, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = image.createGraphics();
    g2.setColor(Color.blue);
    g2.fillRect(25,25,50,50);
    g2.drawString("Hello World!", 10, 10);
    ServletOutputStream out = res.getOutputStream(); // binary output!
    res.setContentType("image/gif");
    GifEncoder encoder = new GifEncoder(image, out);
    encoder.encode();
    ----servlet ends----
    If I run the servlet with the "g2.drawString("Hello World!", 10, 10);"
    commented out there is no problem.
    Is there something I am missing here?
    Thank you,
    -William

    The whole Tomcat crashes, and no exception
    displayed.
    Do I have to write the log file, or it's kept by
    Tomcat itself?yes, tomcat writes a log file, you find it in the tomcat dir. but it's just very highlevel. Having a look in it could help.
    Is there a way to write a log file by myself?sure. you could get the log file from tomcat by getting it from the ServletContext:
    ServletContext = getServletContext();
    ServletContext.log("text to log");
    When I view the output window in Forte, it doesn't
    even write that Tomcat crashed.
    I use Tomcat that is installed with the last version
    of Forte(Sun 1 Studio, update 1), I guess it's the
    last version of Tomcat also.No. The lastest is 4.1.12 and i guess it's 4.0.4 with forte.
    Get Tomcat standalone from jakarta.apache.org and try to run your servlet with the standalone tomcat. this could help since i also expirenced problems sometimes with the forte-integrated tomcat.

  • Calling a servlet (in Tomcat) from a JSP Page (in Apache)

    I have a web form in my JSP Page, which upon submits, will send the params to a servlet. The servlet will then process the request and send the results back to the calling JSP Page.
    with that above senario, is there any way for me to reference a servlet (resides in Tomcat) from a JSP Page (resides in Apache HTTP Server)?
    Thanks!

    Apache HTTP server isn't a servlet/JSP engine.
    Your JSP runs on Tomcat, right where the servlet does. Apache just forwards the request.
    %

  • How to call jsp /servlets running in different web application in tomcat

    hello all,
    i have 2 web applications(Charts and Reports) in the same tomcat,i want to call jsp/servlets running in the Reports webapp from Charts webapp.how do i achieve this.
    thanx
    ravi

    You can also use getContext(String context) in the ServletContext class to get a request dispatcher.
    Using the above example it would be :
    // in a servlet in the charts webapp
    ServletContext context = getServletContext();
    ServletContext reportsContext = context.getContext("/reports");
    RequestDispatcher dispatcher = reportsContext.getRequestDispatcher("/path")
    dispatcher.forward(request, response);Just note, that depending on your server's configuration getContext(...) might return null.

  • Calling servlets in tomcat 4 (path-problem)

    Hi,
    I have copied the IsItWorking-Servlet in webapps/examples/Web-Inf/classes.
    To call the servlet through a browser I have to write:
    http://server-name:8080/examples/servlet/IsItWorking .
    This works fine. But ..unfortunately I have to call the servlets in the following way:
    http://server-name:8080/examples/IsItWorking.
    Which xml-File defines the parameter "servlet" ??

    Hi,
    edit the web.xml under the \examples\web-inf.
    add the following
    <servlet>
    <servlet-name>
    IsItWorking
    </servlet-name>
    <servlet-class>
    IsItWorkingServlet
    </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>
    IsItWorking
    </servlet-name>
    <url-pattern>
    /IsItWorking
    </url-pattern>
    </servlet-mapping>

  • How to configure applet/servlet in Tomcat?

    I'm building a web application which is going to be deployed in Tomcat. I have an applet(called MYAPPLET here) which "calls" a servlet(called MYSERVLET here). I cannot figure out how to configure the whole thing.
    /test is my docbase. In /test I made a directory "applet classes" and a directory "servlet". The applet tag I use in the HTML file looks like this:
    <applet
    code="MYAPPLET.class"
    codebase="http://localhost:8080/test/applet classes/"
    <!-- Tell the applet where its peer is located -->
    <param
    name="servlet"
    value="http://localhost:8080/test/servlet/MYSERVLET" />
    </applet>
    Now, when opening the page, the applet can be found but Tomcat gives an error 404 saying that it can not find the servlet. On the other hand, If I make an entry in my web.xml (with url mapping
    <url-pattern>/test </url-pattern> or <url-pattern>/test/servlet </url-pattern>, depending on where I put MYSERVLET)
    for the servlet mentioned above and I put the MYSERVLET in either the WEB-INF/classes directory or in /test/servlet Tomcat gives an error 403. It refuses to connect to the servlet!
    Please can anyone help me. THanx in advance
    debeumers

    You are configuring Tomcat and if you have further questions then post new questions in the forum "Java Servlet Technology".
    Given that your servlet url is "localhost:8080/test/servlet/MyServlet"
    This assumes -
    1) You have created a web application called "test". You have a directory called "test" under- $CATALINA_HOME/webapps
    2) Your html files, jsp files, and subdirectory "applet-classes" (Note - do Not use spaces when naming directories) exist in this top level directory of your web app. If you choose to place your applet classes in this subdir then the codebase can be "applet-classes" - omitting the "/" means this directory is located relative to the current directory of the html file. (No jar files? No archive param then..)
    3) You have a class file called "MyServlet" located - $CATALINA_HOME/webapps/test/WEB-INF/classes
    Some versions of Tomcat require you to uncomment out the area of the Mapping for the Invoker Servlet element in $CAT_HOME/conf/web.xml.
    <servlet-name>invoker</servlet-name>
    <url-mapping>/servlet/*</url-mapping>
    Once this is done, you need not create a directory called "servlet" anywhere in your structure. It is the url mapping.
    You will want to apply url-patterns and mappings to your application specific web.xml (This is located in - $C_H/webapps/test/WEB-INF) when it comes time to deploy the app, but that is not required for testing and development. You need not make changes to the app specific web.xml at this time just to get the servlet to run.
    And finally I suggest you read a book on this subject...

  • Run servlet in tomcat 4.1

    Hi ,
    could someone please help me.
    Iam trying to run servlet in tomcat4.1 but in vain.
    please help

    hi
    If you want run a servlet in tomcat4.1,First write one html file,and servlet file.
    finally you need to write web.xml.this file will be placed in web-inf folder.
    You need to write this tags to run a servlet in tomcat 4.1
    <servlet>
    <servlet-name> name of the servlet</servlet-name>
    <servlet-class>class name of the servlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>name of the servlet</servlet-name>
    <url-pattern>/the ref name which u want call servlet</url-pattern>
    <servlet-mapping>
    Here the servlet name sholud be same .
    The url pattern name must match with the action attribute value in html.
    now you place your html file in root folder.
    place your servlet class file in classes folder.
    start ur browser type this http://localhost:8080/htmlfilename.

  • Java servlets and Tomcat  server

    Hi friends
    i am using Sun One forte Community edition . i am trying to make a hello world servlet .
    there are 2 Files one is Index.html , HelloWorld.java (Servlet)
    I call this servlet from the index.html file.
    evertime i call it it gives me and error of Apache tomcat file not found .The tomcat server is inbuilt with the Sun One studio.
    the directory structure is
    -----HOME
    -------WEB_FOLDER
    ----------Index.html
    ----------WEB-INF
    -------------CLASSES
    -----------------myServlet (package)
    ---------------------HelloWorld.java
    -------------LIB
    The problem is I am not getting how to write the path of servlet in index.html to call the helloWorld servlet.

    Make this entry in your server.xml file located in tomcat_dir\conf.
    <Context path="/abc"
         docBase="webapps/abc"
         crossContext="true"
         debug="0"
         reloadable="true"
         trusted="false">
    </Context>
    Suppose i want to develop my servlets in another folder Let it be "XYZ".Then your package statement must be, 'package xyz;'. Place all your servlets in webapps/abc/WEB_INF/classes/xyz dir.
    Place all your Jsp(s) and Htmls in webapps/abc/pqrs dir.
    Now they all come under one context 'abc'.
    Sudha

  • Calling a servlet from java

    How to call a servlet from java?
    your help is greatly appreciated..

    Welcome to the forum
    You seem to be misunderstanding something. Do some googling to learn what you need about servlets. Simplified, servlets are java code that's hosted by a web container, such as Tomcat. When a servlet gets called as a consequence of someone requesting a url from the container, it takes in a request object and a response object. All the magic is then in creating an appropriate response (e.g. html) for the incoming request.

  • Newbie question about loading servlets on tomcat

    I have what is probably a very basic question about loading simple servlets on to tomcat to test its installation. I have followed instructions from numerous tutorials to the letter but still I can't get it to work.
    I have installed tomcat on win2k in c:\tomcat. I set up the jdk, environment vars (JAVA_HOME, CATALINA_HOME, TOMCAT_HOME) which all point at the correct dirs. I can compile a servlet without errors. I can also place a test jsp and html file into the root directory and they both work fine.
    However, now I am trying a test servlet and no matter what I do it gives me a 404. I have a servlet class file called "HelloServlet.class" which I placed into the %install_dir%\webapps\ROOT\WEB-INF\classes directory. I try to reference it using this url:
    http://localhost/servlet/HelloServlet
    Tomcat is configured to use port 80 and has been restarted after adding the servlet class file. Does anyone have a clue why this is not working for me?
    Many thanks
    Marc

    You have to add in the web.xml file that it is in the WEB-INF dir, the information about your servlet. An example:
    <web-app>
    <servlet>
    <servlet-name>HelloServlet</servlet-name>
    <servlet-class>HelloServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>/HelloServlet</url-pattern>
    </servlet-mapping>
    </web-app>

  • Calling a servlet in a HTML page

    hi evryone,
    I'm new to servlets so i'm trying to create some simple applications to understand how it all works. The thing i'm trying to do is calling a servlet in a HTML page. I've already installed a Tomcat web server and I've created a servlet called Hello.
    public class Hello extends HttpServlet{
         public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{
              res.setContentType("text/html");
              PrintWriter out = res.getWriter();
              String name = req.getParameter("name");
              out.println("<HTML>");
              out.println("<HEAD><TITLE>Hello, " + name + "</TITLE></HEAD>" );
              out.println("<BODY>");
              out.println("Hello, " + name);
              out.println("</BODY></HTML>");
         public String getServletInfo(){
              return "testing servlet OK";
    }In my HTML page I've written the follwing code:
    <HTML>
    <HEAD>
    <TITLE>Just say hello</TITLE>
    </HEAD>
    <BODY>
    <FORM METHOD=POST ACTION="../servlet/Hello">
    What's your name?
    <INPUT TYPE=TEXT NAME="name"><P>
    <INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>After running this HTML I get a text box and I thing I'm trying to do is, when I click on the button, the servlet will be loaded. However, the servlet can't be found and instead I get an error:
    type Status report
    message /servlet/Hello
    description The requested resource (/servlet/Hello) is not available.
    I suppose both file are in their approriate directories, but my class file still has the class extension. Do I need to change this? I hope that someone can help me.
    Thanks in advance!

    hi,
    the servlet wasn't in a package, so I changed that. It seems that I get an other error now:
    HTTP Status 503 - Servlet servlet/Hello is currently unavailable
    type Status report
    message Servlet servlet/Hello is currently unavailable
    description The requested service (Servlet servlet/Hello is currently unavailable) is not currently available.
    I still don't know what I may have forgotten, so i'm gonna resume what i have done till now.
    the servlet: (Hello.class)
    package servlet;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Hello extends HttpServlet{
         public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException{
              res.setContentType("text/html");
              PrintWriter out = res.getWriter();
              String name = req.getParameter("name");
              out.println("<HTML>");
              out.println("<HEAD><TITLE>Hello, " + name + "</TITLE></HEAD>" );
              out.println("<BODY>");
              out.println("Hello, " + name);
              out.println("</BODY></HTML>");
         public String getServletInfo(){
              return "test servlet OK.";
    }the HTML page (testServlet.html)
    <HTML>
    <HEAD>
    <TITLE>Just say hello</TITLE>
    </HEAD>
    <BODY>
    <FORM METHOD=GET ACTION="../servlet/Hello">
    What's yoir name?
    <INPUT TYPE=TEXT NAME="name"><P>
    <INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>the web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
      <display-name>Welcome to Tomcat</display-name>
      <description>
         Welcome to Tomcat
      </description>
    <servlet>
    <servlet-name>servlet/Hello</servlet-name>
    <servlet-class>servlet/Hello</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>servlet/Hello</servlet-name>
    <url-pattern>/servlet/Hello</url-pattern>
    </servlet-mapping>
    </web-app>paths of these files:
    - Hello.class => D:\Tomcat 4.1\webapps\ROOT\servlet
    - testServlet.html => D:\Tomcat 4.1\webapps\ROOT\more
    ( - web.xml => D:\Tomcat 4.1\webapps\ROOT\WEB-INF)
    Thanks for your help!!!

  • Launching a native debugger when VM crashes

    Is there any way to get the JVM (on Windows - no core dump file) to launch the Windows native debugger (e.g. VC++) when it crashes on an error in the native code? The hs_err_pidXXX.log file is not adequate - I'd like to at least find out the native call stack at the time of the crash.
    This is a sporadic crash that moves around from build to build, so it seems hard to catch other ways. If one can't get the JVM to launch a native debugger, does anyone have any other ideas?
    TIA
    doug

    How can JVM detect its own sudden, non-graceful death and do anything? You'd need some wrapper that monitors the JVM, like what the browser does for script errors. Even then, with this arrangement, you'd still lose the memory dump, because the wrapper is by definition external.
    Your best bet probably lies with Microsoft tools rather than Java, since the OS has the memory info. Try MSDN.

  • How to run servlets in tomcat

    Hi ,
    How to run servlets in tomcat server. I created two files html and servlet file.
    Html file
    callservlet.html
    <html>
    <body>
    <form method=post action="servletcalled.class">
    <input type=submit value="submit">
    </form>
    <body>
    </html>
    servlet file
    servletcalled.java contains
    public void doPost(HttpServletRequest req,HttpServletResponse res ){
    java.io.PrintWriter out = req.getWriter();
    out.println("Hi, executed");
    i put the callservlet.html in webapps/examples/ and servletcalled.class was in webapps/examples/Web-inf/classes/
    After starting the tomcat and running the program html file is getting exceuted but when i click on the submit button this error is prompted
    type Status report
    message servletcalled.class
    description The requested resource (servletcalled.class) is not available.
    Thanks in advance

    Thanks,
    I created a new directory in webapps
    s "webapps/test".
    Test directory contains
    1. callservlet.html file
    2. another directory Web-inf (i.e,
    webapps/test/Web-inf)
    Web-inf directory contains
    1. web.xml file
    2. another directory classes (i.e,
    webapps/test/Web-inf/calsses)
    classes directory contains
    1. servletcalled.class file
    web.xml file contains
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web
    Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    <servlet>
    <servlet-name>Example</servlet-name>
    <servlet-class>Example</servlet-class>
    </servlet>
    </web-app>
    -->should be: <servlet-class>servletcalled</servlet-called>
    then in the <web-app> scope define this:
    <servlet-mapping>
    <servlet-name>Example</servlet-name>
    <url-pattern>/servlets/Example</url-pattern>
    </servlet-mapping>
    >
    thanks in advance i am working hard on that but
    notable to get the solutionbtw by reading the documentation of tomcat and tutorials of jave on the java site (here), you would have known this!

  • Installing and calling a servlet on the web

    I have developed a servlet wich communicates with my client software.
    I'm using Jbuilder and Tomcat and I have no problem with runnin & debugging the code, but I can't get over this problem:
    How do I install the servlet on my web host (wich supports java servlet)?
    How do I 'init' the servlet?
    Wich address do I have to use for calling it from my client?
    Thank you

    How do I install the servlet on my web host (wich
    supports java servlet)?Download Tomcat from jakarta Apache site. The download will have thre required servlet.jar in "lib" folder under your downloaded folder.
    How do I 'init' the servlet?When you call the servlet for the first time, it gets loaded inside the servletcontainer of your server and gets initialized.
    Wich address do I have to use for calling it from my
    client?simply "http://<web-server-name>/servlet/<servlet-class-name>
    Does this help?
    >
    Thank you

  • Execute a servlet in tomcat

    hai friends,
    I am trying to execute a simple servlet in tomcat but I couldn't..
    please help me

    Can you execute the default Servlets in Tomcat which are found in the "Examples" folder ? http://localhost:<PORT NO>/examples/
    If yes then try deploying your servlet in the examples folder and find out a file called "servlet.jar " in your server and set its classpath.
    I hope that will work.
    Shashi

Maybe you are looking for