Servlet running problem

I am not able run my servlet program in browser.
It is showing that page cannot be displayed.
Whether i need to change any settings on my browser ?
What shall i do ?
Plz tell me.....................

Check these features:
1. Is your Tomcat server started?
2. If it is started, can you see Tomcat homepage after typing http://localhost:8080 in the address bar?
3. If you cannot see the Tomcat homepage, then there must be something wrong with your Tomcat settings. You have to set the JAVA_HOME and CATALINA_HOME correctly, then run catalina.bat to start your Tomcat. If you use Tomcat 5.0.25, install and run it by "jakarta-tomcat-5.0.25.exe", you can see the Tomcat homepage, but JAVA_HOME and CATALINA_HOME are not set correctly. So, I suggest you set these 2 variable and run Tomcat manually.
4. If you already completed these steps, then pls post your source code onto our forum.
Good luck.

Similar Messages

  • Servlet run problem..plz help

    hi
    i have made a simple servlet..compile it and put the .class file into web INF's classes folder..set the classpath to servlet. jar file ..the servlets java code is in root folder..i had also put jar file into web inf's lib folder..all the enviroment variables are setted ok.. but still when i am running it, it gives error 404..the url ,i am using for browser is ..http://localhost:8080/servlet/HelloServlet..
    please help me to resolve this problem.
    thanx
    gyan

    web xml file is..
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    - <!-- Copyright 2004 The Apache Software Foundation
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
    -->
    - <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
    <display-name>Welcome to Tomcat</display-name>
    <description>Welcome to Tomcat</description>
    - <!-- JSPC servlet mappings start
    -->
    - <servlet>
    <servlet-name>org.apache.jsp.index_jsp</servlet-name>
    <servlet-class>org.apache.jsp.index_jsp</servlet-class>
    </servlet>
    - <servlet-mapping>
    <servlet-name>org.apache.jsp.index_jsp</servlet-name>
    <url-pattern>/index.jsp</url-pattern>
    </servlet-mapping>
    - <!-- JSPC servlet mappings end
    -->
    </web-app>

  • Servlet runs twice at PDF Stream

    I made a servlet that post a PDF file. I see the servlet run twice when I invok it just once.
    That happens only on pdf files, I try wdith gif an jpeg files and runs fine.
    tanks
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    InputStream in = null;
    OutputStream out = null;
    try {
    System.out.println("get PDF file");
    response.reset();
    out = response.getOutputStream();
    response.setContentType("application/pdf");
    in = new BufferedInputStream( new FileInputStream("file.pdf"));
    int ch;
    while ( (ch = in.read()) != -1 ) {
    out.write( (char)ch );
    catch (Exception e) {
    e.printStackTrace();
    finally {
    if( in != null ) {
    in.close();
    if( out != null ) {
    out.flush();
    out.close();
    }

    I ran across this problem last month. The problem only occurs in Internet Explorer. Netscape runs fine. It used to be that Internet Explorer sent three separate requests in order to receive an in-line pdf. I ended up just having to code around it.

  • Servlet Compilation Problem !

    Hi,
    I am just starting to learn servlets and I got problem in compiling them. I got compilation error in
    import javax.servlet.*;statement. Seems that the compiler cannot find the servlet package. I got J2EE 1.4 beta installed on my machine but there is no servlet.jar package. I am using J2SDK 1.4.1_02, J2EE 1.4 beta and Tomcat 4.1.24.
    Can anyone help me with my servlet compilation problem?
    Thanks in advance!
    Josh

    servlet.jar is here :
    <tomcatdir>\common\lib
    add it to your compiler classpath

  • Keep servlet running after closing telnet

    I'm writing a chat application. I need to be able to have the servlet running all of the time, but it currently kills the process after I close telnet.
    I've tried running it normally and with an '&', but both result in the process dying after telnet closes. On my dev box, I can run it from the console, but my live box is out of state so I need to be able to do everything via telnet or ssh.
    I'm running RedHat 7.1 and jdk1.3.1.
    Thanks,
    Azkul

    Quote from smiths: Can you say more about the operating environment? What is the OS? What kind of permissions do you have? When you stay logged in, do the clients connect and run properly?
    When I'm logged in to telnet, everything works fine. The moment I close telnet, the server program dies.
    I'm using RedHat 7.1 & jdk1.3.1. For my development machine, I have root access (I have tried it both with a user I call webuser and su - both have the same outcome.) For my production machine, I'm using a hosting company so I don't have root access.
    I'd like to find a way that doesn't require altering the rc.local file because I don't have access to this on my live box (and I don't want to reboot the server everytime I want to restart the server class file).

  • Servlet chaining problem..

    import java.io.*;
        import javax.servlet.*;
        import javax.servlet.http.*;
        public class Deblink extends HttpServlet {
          public void doGet(HttpServletRequest req, HttpServletResponse res)
                                       throws ServletException, IOException {
            String contentType = req.getContentType();  // get the incoming type
            if (contentType == null) return;  // nothing incoming, nothing to do
            res.setContentType(contentType);  // set outgoing type to be incoming type
            PrintWriter out = res.getWriter();
            BufferedReader in = req.getReader();
            String line = null;
            while ((line = in.readLine()) != null) {
              line = replace(line, "<BLINK>", "");
              line = replace(line, "</BLINK>", "");
              out.println(line);
          public void doPost(HttpServletRequest req, HttpServletResponse res)
                                        throws ServletException, IOException {
            doGet(req, res);
          private String replace(String line, String oldString, String newString) {
            int index = 0;
            while ((index = line.indexOf(oldString, index)) >= 0) {
              // Replace the old string with the new string (inefficiently)
              line = line.substring(0, index) +
                     newString +
                     line.substring(index + oldString.length());
              index += newString.length();
            return line;
    What is pre request fo above code to work.
    I had tried this many time but it is not working, what will be calling servlet look like

    And can you explain why your title is "Servlet chaining problem"?

  • 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.

  • For CF Server 9 developer win 64bit has the same running problems like 32bit, or more

    CFWACK8 reader:
    Better install CF Server stand alone - so no need  Apache? For CF Server 9 developer windows 64bit has the same running  problems like 32bit, or more?
    I have installed  http://www.apachefriends.org/en/xampp-windows.html ..WAMPP, well Mysql  may used by this CF Server 9 developer, although book use Apache Derby  embedded to cf server?
    CFEclipse plugin may installed either in my (separate) Flash Builder 4 or Eclipse Helios, or only to latter?

    CF 9 64-bit will generally be your best choice on a 64-bit platform, unless you specifically require something that's not available in 64-bit, like COM.
    For development, the built-in web server is fine. But if you want to learn how to manage a web server, it's good to install Apache and configure CF to use that.
    You may use any SQL engine for which there are JDBC drivers, including MySQL. Apache Derby is used for demos, etc, because it's bundled with CF. You don't want to use it for real projects, though.
    You can install CF Builder in any modern Eclipse, including Helios or Flash Builder. This is largely a matter of personal preference. I've encountered some features that don't work properly unless you let CF Builder install its own bundled Eclipse, but these are features that I don't use much anyway.
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Applet running problem in ie 6.0 under Windows XP

    Applet running problem in ie 6.0 under Windows XP
    I have a PC running Iternet Explorer 6.0 running under Windows XP. I have developed an applet using JDK 1.3 which is running fine with applet viewer , but it is not running in ie. I have installed Netscape navigator and Opera 5. the applet is running fine in both of these browsers but somehow it is not running in IE.
    Later on I upgraded my JDK to 1.4. It also displays use Java2 (V1.4.1) for <applet> (requires restart) tck marked in Advance section under Tools-Options menu of IE.
    I have also tried and set various options in my Control Panel�s Java Plug-in but all in vain. I have searched the sites for this solution but no one answers specifically.
    I know it�s a small problem due to discarded JVM in IE under Windows XP but give me solution for that.
    Thanks in Advance
    [email protected]

    Dear I have the same problem .
    Applet running problem in 6.0 . Enen I have installed the latest Jre 1.5.
    What should I do. I am fedup with this problem.

  • Can not make XSQL servlet running under Jrun 3.1! need help

    Hi,
    I tried to run Oracle XSQL servlet under JRun 3.1,I did servlet mapping, such as
    <servlet-name>oracle-xsql-servlet</servlet-name>
    <servlet-class>oracle.xml.xsql.XSQLServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>oracle-xsql-servlet</servlet-name>
    <url-pattern>*.xsql</url-pattern>
    </servlet-mapping>
    I set classpath for XSQL related library such as oraclexsql.jar, xmlparserv2.jar,etc, I believe everything is setup correctly, however when I invoke .xsql page, I did not get data instead of getting sql text!, here is my xsql file content:
    <?xml version="1.0"?>
    <!-- reports.xsql: List of reports by user id -->
    <?xml-stylesheet type="text/xsl" href="Filter.xsl"?>
    <page connection="reports_8i" xmlns:xsql="urn:oracle-xsql">
         <dataform target="reportFilter.jsp" submit="Go">
    <xsql:set-session-param name="userid" value="{@userid}" ignore-empty-value="no"/>
         <xsql:include-param name="userid"/>
         <xsql:set-session-param name="bu_id" value="{@bu_id}" ignore-empty-value="no"/>
         <xsql:include-param name="bu_id"/>
         <xsql:set-session-param name="client_id" value="{@client_id}" ignore-empty-value="no"/>
         <xsql:include-param name="client_id"/>
         <item type="list" name="targetPage" label="Available Reports">
         <xsql:ref-cursor-function bind-params="userid">
                   reports_generation.getReportList(?)
              </xsql:ref-cursor-function>
              </item>
         </dataform>
    </page>
    What I got when I invoked this page is reports_generation.getReportList(?)!!
    It seems that JRun 3.1 did not understand xsql syntax, it means it can not find XSQL servlet related libraries, come on, I did set classpath.
    Does anyone has this experience to help me out? Highly appreicate you in advance.
    Thanks.

    i think i solved this problem by specifying the full path to javac...
    what must i do to avoid this?

  • Report server run problem (urgent plz)

    i am using developer9i, xp opereting system but i am not able to run report server . infact i dont know where report server reside and how configure report server. otn discussion forum gave me below instructions but i need step by step detail to run report server.
    pls help me.
    i want to see (Please reffer to Note:204538.1 on
    Metalink ) but i could not access metalink.
    registration does not alow me. i have no country on
    country list and no Support Identifier (CSI, SAC,
    Access Code etc.) . but i need access.
    please help me. access with path
    thanks
    mostafizDear see this information this is metalink information
    Note:204538.1
    Subject: Common Reasons & Troubleshooting: "Unable to communicate with the Reports Server"
    Type: BULLETIN
    Status: PUBLISHED
    Content Type: TEXT/X-HTML
    Creation Date: 22-JUL-2002
    Last Revision Date: 08-MAR-2005
    PURPOSE
    ========
    The main purpose of this document is to list the known causes of the "Unable to
    communicate with the Reports Server" error. The terms Reports Server, CGI,
    Reports Servlet are also described briefly for a better explanation of this error scenario.
    This document includes the following sections :
    I. Brief summary on the architecture of Reports Server, CGI and Reports
    Servlet
    II. Sources of errors encountered when running a report with Reports Server
    III. How the CGI (or the Reports Servlet) communicates with the Reports
    Server
    IV. Possible reasons which lead to "Unable to communicate with the Reports
    Server" error.
    1) Reports Server is up and running
    2) tnsnames.ora and sqlnet.ora problems
    3) Effect of parameter "ORACLE_HOME"
    4) Effect of parameter "maxconnect"
    5) Passing very large parameters to reports server
    6) A case specific to OAS 4.0.8.2
    7) A case specific to WEBDB version 2.1.0.9.3
    V. References
    I. Brief summary on the architecture of Reports Server, CGI and Reports Servlet
    =================================================================================
    In order to understand the causes of the error "Unable to communicate with the
    Reports Server", let's first briefly review the Reports Runtime Engines, Reports
    Server, the Reports CGI, and Reports Servlet architecture.
    There are 4 important layers in Reports Server architecture which should be
    understood in order to clearly understand the error "Unable to communicate with
    the Reports Server" :
    1) The Runtime Engines : This is the main layer where the reports are actually
    executed. On unix systems there are "rwrun60" and on NT systems there are
    "rwrun60.exe" processes.
    2) The Reports Server : The Reports Server recieves the job request and queues
    it. When one of its runtime engines becomes available, it sends the
    command line to that runtime engine for execution. On Unix systems it is
    the "rwmts60" executable and on NT systems it is "rwmts60.exe".
    3) The Reports CGI : The Reports Web CGI passes the request to the Reports Server.
    The Reports CGI or Servlet converts the request to a command line that can be executed by the Reports Server and
    submits it to the specified Reports Server. On Unix platforms this executable
    is "rwcgi60" and on NTs it is "rwcgi60.exe.
    4) The Reports Servlet : Its functionality and function is just the same as "Reports CGI", but it is
    a program written in Java as difference to the CGI program (which is
    written in C programming language).
    The Reports Server may be running on the same server with the CGI program (or
    servlet) OR may reside totally on another machine which does not necessarily have
    the same Operating System. For instance CGI may reside in a Windows NT machine
    while the Reports server may reside on a Unix box, or any other combination with
    Unix-Linux-NT-2000, etc.
    The reports are called with a URL similar to below with the CGI :
    http://fully.qualified.server.name:PORT/dev60cgi/rwcgi60.exe?server=<REPSERVER>&other_parameters=...........
    where fully.qualified.server.name is the name of the server where the Reports CGI
    reside, and <REPSERVER> is the name of the server.
    II. Sources of errors encountered when running a report with Reports Server
    ============================================================================
    The Reports Web CGI (or the Reports Servlet) makes a call to the Reports Server
    and asks it to place the output into some destination (defined by DESTYPE and
    DESNAME parameters), then gives back the necessary response to the calling
    program. For example if the DESTYPE is "cache", then the Reports server generates
    the report to a file in a temporary place and gives it back to CGI and the CGI gives
    it back to the calling program. Otherwise, if the DESTYPE is "file", the Reports Server
    generates the report output to the requested file and the CGI replies back the
    following message : "Report output was successfully written to requested
    destination.".
    If there is any error in this process, the related error message is returned. The
    possible sources of errors can be categorized as follows :
    1) The errors that are returned from Reports Server; like the Reports Server can
    not find the requested RDF file or the report may be run to file and the
    directory where the reports output is asked to be placed does not occur or
    similar errors. (Usually the REP-XXXX errors)
    2) Another possible cause of error is the errors returned by the RDBMS to the
    Reports Server, for example a table not found error or things like that. Of
    course from the CGI point of view these errors are again transmitted from the
    Reports Server but in fact the error originates from the RDBMS. (Usually the
    ORA-XXXX errors)
    3) Another possible cause of errors is the CGI itself, for example when the CGI
    executable can not connect to the requested Reports Server, then we get the
    famous "Unable to communicate with the Reports Server". In this document we will
    diagnose the common reasons of this last error.
    III. How the CGI (or the Reports Servlet) communicates with the Reports Server
    ===============================================================================
    Having said that "Oracle Reports Server CGI - Unable to communicate with the
    Reports Server." error is returned back from the CGI itself, let's discuss the
    issue of how the Reports CGI connect to the Reports Server. The name of the
    Reports Server given in the URL with "server=....." parameter is, in fact, just
    a special tnsnames alias, similar to aliases for database connect strings. As it is
    important for the CGI to resolve the alias, the CGI needs to know the HOST name (or the
    IP) of the machine where the Reports Server is running and the port on which the
    Reports Server is listening. So a typical Reports Server alias is defined as follows :
    REP60_<MACHINE>=(ADDRESS = (PROTOCOL = tcp)(HOST = <MACHINE>)(PORT = <PORT>))
    This is defined in tnsnames.ora file, and the sqlnet.ora file is also used in
    the name resolving operation.
    IV. Possible reasons which lead to "Unable to communicate with the Reports Server" error.
    ==========================================================================================
    The possible reasons for the "Unable to communicate with the Reports Server" error :
    1) Reports Server is up and running :
    Make sure that the Reports Server is really running on the specified server
    and listening on the specified port. For details have a look at above
    explanations for tnsnames alias of the reports server. And because of this the
    CGI could not establish a connection to the Reports Server.
    2) tnsnames.ora and sqlnet.ora problems :
    As described above, the CGI resolves the details for the reports server using
    the "tnsnames.ora" and "sqlnet.ora" files. There may be a problem with them,
    here are the possible configuration problems :
    a) There is no alias in the tnsnames.ora file for this Reports Server
    b) The CGI looks into the wrong directory for the "tnsnames.ora" and "sqlnet.ora"
    files. By default the CGI checks the $ORACLE_HOME/net80/admin directory for
    these scripts, where the $ORACLE_HOME is the home of the Forms & Reports
    installation. Please note that in a typical 9iAS 1.0.X installation there
    are two ORACLE_HOME's, one is for the iAS and the other is for the tools,
    usually the home for the tools is a directory with name "806" on NT and
    "6iserver" on unix systems. By defining TNS_ADMIN in the environment, one
    can override the search path for these two files.
    The TNS_ADMIN variable can be defined in one of the following places :
    i) In the environment : On MS Windows platforms check the "Settings
    --> Control Panel --> System". On NTs check the environment TAB and in
    Win2K systems check the "Environment Variables" button on Advanced tab.
    ii) In "6iserver.conf" file. Details are as follows : The main configuration
    file for Apache server is "httpd.conf" file which resides in
    $IAS_HOME/Apache/Apache/conf directory. In this file there is a line to
    include "oracle_apache.conf" and in this "oracle_apache.conf" file
    there is a line to include "$ORACLE_HOME/conf/6iserver.conf" file. And
    in this file the TNS_ADMIN variable could be defined as follows :
    SetEnvIf Request_URI "rwcgi60" TNS_ADMIN=c:\orant\network\ADMIN
    Please note that by defining it this way, the TNS_ADMIN will only be defined
    for "rwcgi60" calls, so the other parts of the 9iAS will not be affected by
    this setting.
    c) In sqlnet.ora the "names.default_domain" is set but in tnsnames.ora the
    domain is not defined in the alias description. For example if the
    "names.default_domain=world" is present and active in "sqlnet.ora" file
    then in the "tnsnames.ora" the alias of the reports server should also have
    the ".world" extension appended at the end. And another cause is of course
    the vice versa for this. If there is no "names.default_domain" is defined
    in the "sqlnet.ora" then the alias in "tnsnames.ora" should not have the
    domain extension.
    Another important point that should be checked is, if TNS_ADMIN is defined
    as described above then the search path is as follows, first the directory
    defined by TNS_ADMIN is searched, if the "tnsnames.ora" file is not found in
    this directory then $ORACLE_HOME/net80/admin is checked. (And on unix systems
    /var/opt/oracle is also checked). These directories are only checked if the file
    is not present, so if the "tnsnames.ora" file is present in TNS_ADMIN directory
    but the alias is not present, then the other directories are not checked at all.
    Let us assume that the tnsnames.ora file is present in the TNS_ADMIN directory but
    there is no "sqlnet.ora" files here, then the sqlnet.ora file is checked in
    $ORACLE_HOME/net80/admin directory, which could cause the same problem if the
    "names.default_domain" is defined in this file.
    All the above will result in, CGI to unable to resolve the alias in tnsnames.ora
    file so it will not be able to establish a connection to the Reports Server.
    3) Wrong "ORACLE_HOME" setting :
    Wrong ORACLE_HOME setting. This is usually the case for Reports Servlet,
    because the environment settings are defined in "jserv.properties" file for the
    servlets and the setting here will effect both the Reports Servlet and the
    setting for Oracle JSP and other servlets. So the other servlets or Oracle JSP
    may need to set ORACLE_HOME to home of HTTP server while the reports server needs
    it to be set to the TOOLS_HOME directory. In this case the best alternative is
    not to set ORACLE_HOME in this directory and leave it to registry or defined the
    ORACLE_HOME in "6iserver.conf" file just like the TNS_ADMIN defined above. For
    details please have a look at the following document :
    Note 179609.1 "Getting an error Unable to communicate with the Reports Server
    using RWSERVLET"
    4) Effect of parameter "maxconnect" :
    Another common case for this error is that the CGI request reaches the Reports Server but
    the Reports Server refuses connection. The main cause for this case is, that the Reports Server
    configuration parameter "maxconnect" is defined too low, there are long running reports on the
    server or the server is too busy at that time. Usually a second try some
    later time results in a successful connection. If this is the case, the end user
    may think that the problem is occasional. For details on this case please
    have a look at the following document :
    Note 125265.1 "Unable to communicate with the Reports Server"
    5) Passing very large parameters to reports server :
    Another known reason for this error is, if you are passing large parameters
    to the Reports Server which exceeds sqlnet transmission blocks then the request may
    end up with this error. To test it try with small parameter values. If you hit
    this case, the solution is to increase the SDU (Session data unit size) and the TDU
    (Transport unit data size) parameters in tnsnames.ora file, for details please
    have a look at the following document :
    Note 197358.1 "Passing large parameters to Reports show up a Reports Server
    error"
    6) A case specific to OAS 4.0.8.2 :
    If you are using OAS instead of iAS, and the error appeared after
    upgrading to 4.0.8.2 then this is caused because the 4.0.8.2 is using RSF
    (Required Support Files) version 8.1.6 and the Reports 6i is using 8.0.6 and the
    two could not reside in the same ORACLE_HOME directory. So the solution for this
    problem is to create a new batch file and use it from which the actual CGI
    executable is called. For details please see the following document :
    Note 116754.1 "After applying OAS 4.0.8.2 CGI and Cartridge cannot communicate
    to report server"
    7) A case specific to WEBDB version 2.1.0.9.3 :
    Another known case for this error is with WEBDB version 2.1.0.9.3 or less.
    If you are using these old versions of WEBDB as HTTP listener, please have a
    look at the following document :
    Note 95426.1 "URL Not Found When Calling Oracle Developer Report from WebDB Site"

    On Windows you can create a Report Services:
    rwserver -install server=repserverYou have to choose different names for all servers, like your collegue cannot create a server with the same name. You can start/stop this Report server in Services (control panel). Configuration files can be found under $ORACLE_HOME/reports/conf
    Martin

  • Applet-Servlet Communication problem EOFException

    Hi! i´ve been searching and searching through forums because it seems this problem is very common, but none of the solutions i´ve seen so far suits me, so i´m here looking for some help because i´ve been stuck one week with this. First of all sorry if my english isn´t the best... i´m a bit rusty...
    Well, i had some code that worked perfectly, but i needed to perform some changes because i needed the servlet to send more info to the applet, and here started the problems, when i made the changes it started to throw EOFException when i was trying to read the InputStream, and furthermore when i came back to the original code it started to throw the exception in the same place too
    So here i am... don´t know what to do now and i entrust to you to give me some tips.
    Here comes some code. This is the original code, the one that runned but it doesn´t run right now
    Applet:
    public ListasComponentesSeleccionables cargarListasComponentes( ) throws IOException, ClassNotFoundException {
              String serv = "/Desaladora/cargarListasComponentesApplet.do";
              String host = Principal.documentBase.getHost( );
              URL direccion = new URL( "http", host, 8080, serv );
              // Create conection
              URLConnection connection = direccion.openConnection( );
              connection.setDoInput( true ); 
              connection.setDoOutput( true );
              connection.setUseCaches( false );
              connection.setRequestProperty( "Content-Type", "application/x-java-serialized-object" );
              ObjectOutputStream output;
              output = new ObjectOutputStream( connection.getOutputStream( ) );
              output.writeObject( new Boolean(true) );
              output.flush( );
              output.close( );
              ObjectInputStream input = new ObjectInputStream( connection.getInputStream( ) ); //<-- Here is the problem
              ListasComponentesSeleccionables response = new ListasComponentesSeleccionables( );
              response = ( ListasComponentesSeleccionables ) input.readObject( );
              return response;
         }Servlet:
    ublic class CargarListasComponentesAppletAction extends Action {
    public ActionForward execute(     ActionMapping mapping,
                                                     ActionForm form,
                                                     HttpServletRequest request,
                                                     HttpServletResponse response )
                            throws ServletException, IOException, Exception  {
              InitialContext context = new InitialContext();
              SensorManagerService sensor_service;
              ActuatorManagerService actuator_service;
              Globals.LOGGER_SECURITY.debug( "Entering ACTION 'CargarListasComponentesAppletAction'" );
              response.setContentType("application/x-java-serialized-object");
              try
                   ObjectInputStream bufferentrada = new ObjectInputStream(request.getInputStream());
                   Boolean peticionOK = (Boolean)bufferentrada.readObject();
                   ObjectOutputStream buffersalida = new ObjectOutputStream(response.getOutputStream());
                   sensor_service = ( SensorManagerService ) context.lookup( "desaladora/SensorManagerServiceBean/local" );
                   ArrayList<AlarmConnectedSensorDTO> sensorList = sensor_service.findAllSensorsToAlarms();
                   actuator_service = ( ActuatorManagerService ) context.lookup( "desaladora/ActuatorManagerServiceBean/local" );
                   ArrayList<AlarmConnectedActuatorDTO> actuatorList = actuator_service.findAllActuatorsToAlarms();
                   buffersalida.writeObject( crearListasSeleccionables(sensorList, actuatorList) );
                   buffersalida.flush();
              catch(Exception e)
                   System.out.println("Error en la trasmision de datos");
              return null;
         private ListasComponentesSeleccionables crearListasSeleccionables(ArrayList<AlarmConnectedSensorDTO> sensorList,
                    ArrayList<AlarmConnectedActuatorDTO> actuatorList) {
              Vector<Integer> vectorSensores = new Vector<Integer>();
              Vector<Integer> vectorActuadores = new Vector<Integer>();
              for(AlarmConnectedSensorDTO sensor : sensorList) {
                   vectorSensores.add(sensor.getIdSensor( ));
              for(AlarmConnectedActuatorDTO actuator : actuatorList) {
                   vectorActuadores.add(actuator.getIdActuator( ));
              ListasComponentesSeleccionables listasComponentesSeleccionables =
                                  new ListasComponentesSeleccionables(vectorSensores, vectorActuadores);
              return listasComponentesSeleccionables;
    }i´ve been running some test in another computer, and this code simply works, but it doesn´t work in the machine i usually work.
    Maybe someway the stream get corrupt? the info i´ve been trying to send and started throwing the exception may still be in the stream? I don´t know what to think right now.
    Hope someone has any idea, thankyou.

    I dont see the problem. However, I suggest you change this;
    System.out.println("Error en la trasmision de datos"); t
    to e.printStackTrace() to see what it is doing when it stops working.
    I also suggest peppering your code with System.out.println() statements to see what it is doing just before stopping.
    Also, try your code with a brand new file with only a few characters in it. If it works, add to it some of your originial file content until it stops working. This way, you can determine if its the file size that is causing the crash or something in the file content. If all else fails, study java I/O and try some other way to read/write the file. You can also try a different browser. If it works, its the browser. Still having problems? Create a new project with a simple applet and file read/write program and get that working. That way, all the other stuff in your original project isn't in the way.

  • Servlet side problem

    hi there,
    i have managed to get my mipd program talking 2 a tomcat server, but i have run into the following problem:
    the servlet has at initiation a buffer called int l = 0; and increment the l value by 1 , this is fine but when i get another phone 2 connect to the server, i want the value of l to increment to 2, instead the value resets to 0 and then increments by 1 giving me the final value of 1 yet again on the second phone
    here is the code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class testing3 extends HttpServlet{
    int l;
    public testing3(){ l=0;}
    public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException{
    InputStream in = req.getInputStream();
    PrintWriter out = res.getWriter();
    String rankstring = "sent by server";
    int requestlength = req.getContentLength();
    if(l==0){
    if(requestlength > 0 ){
    for(int i=0;i<requestlength;i++){
    int c = in.read();
    if(c==-1)break;
    l++;
    else if(l==2)
    out.write(rankstring);
    System.out.println("l value is" + l);
    public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException,ServletException{
    doPost(req,res);
    how do i get around this problem?advice will be greatly appreciated
    regards

    i think you want to number of hits kind of value...
    make that variable static
    you should get the value that you want
    [email protected]

  • Servlet Execution Problem

    I have installed Apache Tomcat/6.0.10. Can you please tell me what is the process for running servlet in it. There is no any problem in the compilation of servlet.
    Rakesh Kumar

    see this thread
    Don't just re-post the question because you didn't like the answer you got before. Looks like a perfectly acceptable answer to me

  • Servlet/jsp problem

    hello i am using netbeans to create a simple login system using a servlet and a jsp. the jsp has the following code:
    <form action="login" method="get">
    <br>UserID <input type="text" name="userID" size="20" maxlength="20">
    <br>Password <input type="password" name="password" size="20" maxlength="20">
    <br><input type="submit" value="Login">
    </form>
    the servlet name is login and located under src/java/login.java
    however when i run it its just giving me this msg that it cannot find the servlet:
    type Status report
    message Servlet login is not available
    description The requested resource (Servlet login is not available) is not available.
    does anyone know what the problem might be?

    How have you defined this servlet in your web.xml ?
    For example it should be something like this:
        <servlet>
            <servlet-name>SomeServletAlias</servlet-name>
            <servlet-class>servletpackagename.ServletClassName</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>SomeServletAlias</servlet-name>
            <url-pattern>/servleturlpattern</url-pattern>
        </servlet-mapping>If you have the URL Pattern as: /servleturlpattern , then in your form's action put action="/servleturlpattern" and not action="servleturlpattern"
    Where ever you reference the servlet, the URL for the servlet should match exactly as you specify it in the URL-Pattern. Otherwise it wont work.

Maybe you are looking for

  • WEBUTILS CLIENT_HOST

    I am using the webutil client_host functionality. The following command calls the program correctly but the tabs have been ignored or replaced by spaces. CLIENT_HOST('creditcarddonations.exe '||:global.connum||CHR(9)||v_name||CHR(9)||RTRIM(v_address,

  • How can I stop my phone from going into the lock screen while talking on it? (New issue with ios 6)

    Prior to ios 6, I could talk on my phone and have the mute button available. Now it goes into lock mode while speaking on the phone. This is terribly annoying when on conference calls and you want to mute/unmute, or just hang up a call. I now have to

  • Dynamic Programming : Bind table

    Hello to all, I intend to bind a table dynamically for which i am following these steps: 1. Created the context node dynamically in WDINIT. 2. Filled the context node (made a select query and then using bind_table) 3. In WDDOModify, used the followin

  • Why do we bother?

    I've had it now. I spent hours fiddling the network and making sure all computer are on the same segment etc. I took the trouble to read all the supplied docs on how to do multi-host distributed rendering: Setting up service nodes (Qmaster pref pane)

  • Read / Write Security from Query and Display Templates

    When you assign a role to the READ access of the Security tab of either the Query or Display template, this means the user can only view the report on the screen. My question is... When you assign a role to the WRITE access of the Security tab of eit