Lost servlets

The BASIS team restarted our PI system.  The system came up seemingly okay.  However, we found that messages were not processing.  When trying to log into NWA we would get this message:
com.sap.engine.services.servlets_jsp.server.exceptions.ServletNotFoundException: Requested resource [MessagingSystem/servlet/MessagingServlet]
not found.
The final solution was to redeploy this servlet and the messaging servlet (sap.com/com.sap.aii.af.ms.ap). 
SAP Global Support also had us check in Visual Admin for the status of the following services:       
- sap.com/com.sap.aii*   including (sap.com/com.sap.aii.af.ms.app)
- sap.com/com.sap.lcr*                                           
- sap.com/com.sap.xi*                                            
The system was running perfectly prior to the system restart.  The need to redeploy servlets has happened three times and we still do not know what is causing this to happen.  Any information or ideas on what we should do would be helpful.
-Jim

That depends on how your organisation assign's responsibility.
Normally it would be expected that the DBA and the SysAdmin are responsible for backups in production databases.
However, if it is a Development database, the definition of "backup" itself may vary.
Probably, the DBA is not expected to backup Development databases -- it really depends on how the responsibilities are defined.
(eg if a Development database is in NOARCHIVELOG mode, the DBA can only do Export backups or Cold Backups, not Hot Backups -- either of such backups may well be determined as AdHoc backups, based on request from the development team).

Similar Messages

  • Session lost after fail over. (I kill down the server during servlet invocation)

              I just tested the failover ability of our WebLogic
              cluster. We have two instances, first, I logged onto
              the web site and created a session, and then I called
              a servlet, in which there is a complicated computation
              which will take about 5 seconds, during the
              invocation, I issued the kill -9 to shut the server
              down at once. It did failover, but the http session
              was lost,So I got the session timeout page. But if I
              kill down that server after the invocation, then it
              can failover succesfully without loss of session.
              Could you tell me is there any difference between
              killing down server during and between invocations of
              servlet or JSP?
              The configuration:
              WLS5.1 with sp8. Solaris 5.8
              Using in memory replication.
              Thank you very much for your help.
              

              I just tested the failover ability of our WebLogic
              cluster. We have two instances, first, I logged onto
              the web site and created a session, and then I called
              a servlet, in which there is a complicated computation
              which will take about 5 seconds, during the
              invocation, I issued the kill -9 to shut the server
              down at once. It did failover, but the http session
              was lost,So I got the session timeout page. But if I
              kill down that server after the invocation, then it
              can failover succesfully without loss of session.
              Could you tell me is there any difference between
              killing down server during and between invocations of
              servlet or JSP?
              The configuration:
              WLS5.1 with sp8. Solaris 5.8
              Using in memory replication.
              Thank you very much for your help.
              

  • JSP form values lost upon servlet request (RequestDispatcher)

    Hello,
    I have a query screen (jsp) that calls a servlet and gets results. However, although the results or errors display just fine (I do a setAttribute for them), I lose the initial values in the query form (values that the user input - which are stored in the request object). Shouldn't those values be maintained and displayed, since I'm using the RequestDispatcher and thus, I should have the same request object? Thank you, C Turner
    *****My JSP (the related code)*****
    <jsp:useBean id="form" class="com.foo.ActivityBean" scope="session">
    <jsp:setProperty name="form" property="*"
    </jsp:useBean>
    <HTML>
    <BODY>
    <FORM ACTION="ActivityFormHandler" METHOD="POST">
    <P><B>From Date</B>
    <INPUT TYPE="TEXT" NAME="fromDate" SIZE="9" VALUE="<jsp:getProperty name="form" property="fromDate"/>">
    <P><B>To Date</B>
    <INPUT TYPE="TEXT" NAME="fromDate" SIZE="9" VALUE="<jsp:getProperty name="form" property="toDate"/>">
    *****Java from my HttpServlet, ActivityFormHandler (acting as a formhandler)*****
    if (errors.size() == 0) {
    ActivityBean myActivityBean = new ActivityBean();
    myActivityBean.setBeanQueryValues(acctNumber, department, fromDate, toDate);
    Vector resultsVector = null;
    try {
    resultsVector = myActivityBean.executeQuery();
    } catch (CreateException ce) {
    errors.add("There was a problem retrieving the requested data from the database.");
    request.setAttribute("results", resultsVector);
    } else {
    //Data is not okay.
    String[] errorArray = (String[])errors.toArray(new String[errors.size()]);
    request.setAttribute("errors", errorArray);
    RequestDispatcher rd;
    rd = getServletContext().getRequestDispatcher("/public_html/ActivityQuery.jsp");
    //rd.forward(request, response);
    rd.include(request, response);

    For those interested in my question, here's what I figured out.
    Instead of:
    <INPUT TYPE="TEXT" NAME="fromDate" SIZE="9" VALUE="<jsp:getProperty name="form" property="fromDate"/>">
    Use:
    <INPUT TYPE="TEXT" NAME="fromDate" SIZE="9" VALUE="<%out.print(request.getParameter("fromDate"));%>">
    This allows the input field to persist the query value instead of blanking it out when the results are displayed. -ct

  • Session is lost when going from a servlet to a jsp

    Any help would be greatly appreciated.
              I can sucessfully go from my jsp page to the Servlet. When in the servlet I have a service method where I place the information from my form on the jsp on a bean. Then I do a session.setAttribute("aBean", aBean) to place the bean in the session. Then do a req.sendRedirect("my.jsp"). Watching it in the debugger, when we leave the servlet our session is cleared and when we do a jsp:usebean to get the bean session from the session it creates a new bean so all the information is gone that was there before. here is my usebean tag where we are getting it from scope,
              <jsp:useBean id="aBean" scope="session" class="com.MyBean"></jsp:useBean>
              Thanks, Trucker

    <jsp:useBean name="helper" scope="session" class=".."/>
              <jsp:useBean name="helper" scope="session" type=".."/>
              ·class="package.class"
              Instantiates a bean from a class, using the new keyword and the class constructor. The class must not be abstract and must have a public, no-argument constructor. The package and class name are case sensitive.
              ·type="package.class"
              If the bean already exists in the scope, gives the bean a data type other than the class from which it was instantiated. The value of type must be a superclass of class or an interface implemented by class.
              If you use type without class or beanName, no bean is instantiate
              In your case you already instantiated the bean “com.MyBean” in servlet and you set bean in session scope. But you are not accessing that bean from servlet. Instead of that you are crating a new bean instance by using class attribute of <jsp: useBean>. So if you want to access the bean already created in servlet you should use type attribute instead of class in <jsp: useBean>. So you have to change your code as follows.
              <jsp:useBean id="aBean" scope="session" type="com.MyBean"></jsp:useBean>
              Then you will not lose the bean created in servlet.
              - Navaneeth

  • MVC Design Help, Single Servlet, How do I access the Model and DB

    Hi all. New here and looking for some help.
    I am currently writing a website that allows the creation of users, that may upload articles and post comments on articles. Im trying to develop using MVC. I have a single controller servlet that processes POST actions throughout the site (eg. InsertArticle, DeleteArticle, ModifyArticle, etc..)
    Now my problem is, just how do I retrieve the articles from the database? .. for example, if I load up a page http://localhost/articles.jsp which should display all the articles currently in the site.. I would have a function say getAllArticles() which should return a collection of all the articles. I can then iterate through the articles in the jsp page.
    I am trying to use <jsp:useBean...etc.> BUT.. my articles bean constructor takes a databaseconnection object as a parameter. If I use useBean I cant pass the databaseconnection object to the bean and I get an error because it cannot create the bean.
    Any help on this would be appreciated as well as any tutorial links. I also looked at the petstore blueprint program on the sun website, but that program has me completely lost with all the xml. I would prefer not to use custom tags or struts for now. I would like to keep it simple with snippets of java code in the jsp pages for data retrieval and display while keeping all the business logic in the beans of the model. I would also like to keep this relatively secure. I am developing using Oracle Jdeveloper 10g.
    Thanks
    Jazz

    Hey steve, thanks for that.. but thats exactly what i
    dont want to do. I also realize that ive been writing
    the ejb's incorrectly to begin with and have begun to
    rewrite them. However maybe I can make it easier..
    what im trying to do is precisely what is in this
    diagram..
    http://gsraj.tripod.com/jsp/jsp.html
    the problem im having is where it passes data back to
    the jsp page.. entity beans cant (or shouldnt?) be
    accessed directly from jsp pages.. which means i
    create a session bean which interacts with the entity
    bean and can return information to the jsp page.. i
    understand what i have to do.. i just dont know how to
    do it.. been searching for google for tutorials and
    etc.. this site is the closest ive come but .. as you
    can see it says "more to come" ..
    thanks again guys really appreciate itAhhh. EJBs. Enterprise Java Beans and JavaBeans are two completely different beasts. I know nothing about EJBs, except:
    1) They are much harder to use (and serve a different purpose I assume) then JavaBeans
    2) Tomcat (the server I use) doesn't support them.
    Sorry I can't be of more help.

  • Retrieving cell values from html in servlet - help!

    Dear all,
    I've got a table. I want to put links in each cell box. No problem. However I want to know when i've moved to my link what number cell the link came from. This is proving to be a big problem.
    Here is what i've tried:
    writer.println("<TR><TH bgcolor=\"brown\">Brown<TD id=1><li>
    <a href=BookingFromScreen>1</a></li></TD>" +
    "<TD name = \"id\" value = \"2\"><li><a href=BookingFromScreen>2</a></li></TD>".. etc...
    then picking the id's up in BookingFromScreen like this:
    String cell = request.getParameter("id");
    String cellNo= request.getParameter("value");
    System.out.println("this is the cell parameter: " +cell);
    System.out.println("this is the cell Number: " +cellNo);
    Object cell1 = request.getAttribute("id");
    String cell2 = (String)cell1;
    System.out.println("this may work: "+cell2);
    neither of these ways work, once link has been clicked all the information about that cell is lost, can anyone pleeeeeeeeeease tell me why this isn't working? both are in the doGet methods of their respective servlets if thats any help....
    thank you
    Jen C

    just use
    writer.println("<TR><TH bgcolor=\"brown\">Brown<TD id=1><li>
    <a href=BookingFromScreen?id=1>1</a></li></TD>" +
    "<TD name = \"id\" value = \"2\"><li><a href=BookingFromScreen?id=2>2</a></li></TD>"also you should be using a jsp for this

  • Print images created on the fly by a servlet

    Please, look at it... my tiff image doesn't print in my browser (IE6).
    Could somone tell me why !????
    // Method of a "Page" class
    public void write (OutputStream out) {
                // Reading of the tiff file (this.tempFile is a valid File)
         PlanarImage image    = JAI.create("fileload", this.tempFile.getCanonicalPath ());
                /*   // Test : the writed file is a valid tiff file --> the reading is OK !
                 *   File outFile = new File ("c:\\temp\\JLdsWeb\\Test.tif");
                 *   RenderedOp op = JAI.create("filestore", image, outFile.getCanonicalPath (), "tiff");
         // Writing of the tiff file in the received OutputStream
                JAI.create("encode", image, out, this.FORMAT_NAME, null);
    // my 1st JSP :page.jsp (to call the 2nd JSP witch have an other content type)
    <%@page
    contentType="text/html"
    language="java"
    errorPage="errorpage.jsp"
    import="com.damaris.ldsweb.*,com.damaris.data.*,com.damaris.page.*,java.util.*"
    %>
    <html>
    <head></head>
    <body>
    <IMG src=<%=request.getContextPath()%>image.jsp>
    </body>
    </html>
    // my 2nd JSP
    <%@page
    language="java"
    errorPage="errorpage.jsp"
    import="com.damaris.ldsweb.*,com.damaris.data.*,com.damaris.page.*,java.util.*"
    %>
    <html>
    <head>
    <%
        // pageToPrint is an instance of the class "Page" (getContentType ( ) give the String "image/tiff")
        response.setContentType(pageToPrint.getContentType ( ));
    %>
    </head>
    <body>
    <%
        ServletOutputStream bOut = response.getOutputStream();
        pageToPrint.write (bOut);
    %>
    </body>
    </html>

    You can get the Servlet to write an image out by changing the content type of the response object to "image/jpeg" and write the bytes of the image out down a ServletOutputStream you create from the response object.
    You must change the content type before you write anything to the response object. The servlet can only produce the image.
    I did it once but I've lost my code and am now trying to recreate it (I changed it to having a server app do the image processing and writing it to a socket which the servlet read the bytes from and wrote them to the ServletOutputStream but now want the servlet to do the processing).

  • TEXTAREA with servlets

    Hi,
    I am writing a servlet where I need to retain the text the user entered in an HTML TEXTAREA after a page refresh.
    Upon page refresh, I send the value of the TEXTAREA to the servlet via the URL. I then populate the TEXTAREA's default value with req.getParameter(<my textarea value>).
    My problem is this: carriage returns are lost. How can I retain them when I pass the value using only Javascript?
    Below is a bit of my code. ldifHeaders contains the value of the TEXTAREA captured via Javascript <field>.value.
    out.println("function refreshPage(mailPlatform)");
    out.println("{");
    out.println(" window.location.replace('"+sServletPath+"/MailSystemDetails?LDIFHeaders='+ldifHeaders);");
    out.println("}");

    Hi,
    Try using the escape sequence to translate the URL
    As far as I remember, the carriage return will be
    translated into "%0D"
    /SlashWould you know how to break up the value returned from the javascript <textarea>.value?
    If I can break this value up into tokens, I can manually build the URL like you mentioned. Thanks.

  • Javax.servlet.* package does not exit

    While compiling servlet followinng errors are coming
    C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:13: cannot find symbol
    symbol: class HttpServlet
    public class HelloServlet extends HttpServlet {
    C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:14: cannot find symbol
    symbol : class HttpServletRequest
    location: class HelloServlet
    public void doGet(HttpServletRequest request,
    C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:15: cannot find symbol
    symbol : class HttpServletResponse
    location: class HelloServlet
    HttpServletResponse response)
    C:\Servlets+JSP\HelloServlet\src\helloservlet\HelloServlet.java:16: cannot find symbol
    symbol : class ServletException
    location: class HelloServlet
    throws ServletException, IOException {
    Plz help me out for this problem.

    Hi There, I have recently got new pc and lost my development/test environment and have to setup tomcat/eclipse environment again. i installed Tomcat 5.5 and Java 1.5.0.22 version on my pc and also created local dev directory as C:\Java to compile and test sample .java files.
    here is the class path i set:
    CLASSPATH=.;C:\Java;"C:\Program Files\Apache\Tomcat 5.5\common\lib\servlet-api.jar";"C:\Program Files\Apache\Tomcat 5.5\common\lib\jsp-api.jar";"C:\Program Files\Apache\Tomcat 5.5\common\lib\jasper-runtime.jar";"C:\Documents and Settings\UserId\My Documents\ServletWork\workspace";..;..\..
    However when I try to compile sample HelloServlet.java file, i get following errors:
    C:\Java>javac HelloServlet.java
    HelloServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    HelloServlet.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    HelloServlet.java:13: cannot find symbol
    symbol: class HttpServlet
    public class HelloServlet extends HttpServlet {
    ^
    HelloServlet.java:14: cannot find symbol
    symbol : class HttpServletRequest
    location: class HelloServlet
    public void doGet(HttpServletRequest request,
    ^
    HelloServlet.java:15: cannot find symbol
    symbol : class HttpServletResponse
    location: class HelloServlet
    HttpServletResponse response)
    ^
    HelloServlet.java:16: cannot find symbol
    symbol : class ServletException
    location: class HelloServlet
    throws ServletException, IOException {
    ^
    6 errors
    Not sure if I missed anything. I would appreciate any help/hint to resolve this issue.
    Thanks,
    SunIT

  • Session getting lost

    Now issue related to session
    I am using tomcat 3.1
    In my login page my session value get lost frequently.I am using session.setAttribute("logon.isDone", name); in servlets and In every jsp's I am checking as <% if(session.getAttribute("logon.isDone")==null){
    response.sendRedirect("/iscap/report/relogin.jsp");}%>
    The value get lost in a very short time so user is sent to relogin .
    Now what I do here?
    payal sharma

    Hi
    try to set the maximum interval between requests
    eg:
    session.setMaxInactiveInterval(6000);
    vis

  • Unable to View PDF in Browser from a Servlet.

    Hi,
    I am facing a problem while trying to dynamically generate PDF from a Servlet and display it in the browser(IE 6.0 sp2)
    The scenario is as follows:
    i have a link which on clicking (using javascript) moves to a Servlet(say Dispatcher Servlet).This servlet forwards the control to another Servlet(say PDF Renderer Servlet) which generates the PDF and tries to display the results to the browser.
    The PDF does get generated.
    However in the pop-up i get a alert message to either open or save the PDF.But when i try to do so the message i get is that IE failed to communicate with the server.
    The code i am using to display the PDF is as follows
    ByteArrayOutputStream outfile = pdfTransformer.transform(xmlString,container);
    byte[] content = outfile.toByteArray();
    response.setContentType("application/pdf");
    response.setContentLength(content.length);
    response.setHeader("Content-Disposition", "inline; filename=\"" + pdfName + "\"");
    ServletOutputStream out= response.getOutputStream();
    out.write(content);
    out.flush();
    out.close();
    Any suggestions would be a great help.
    Thanks

    Hi,
    I have the same code as Viv above and I am generating pdf using fdf file format. the code works upto the point where it generates pdf. I am not setting the header to open the file in the same browser or new window:
    (not in my code)
    response.setHeader("Content-Disposition", "inline; filename=\"" + pdfName + "\"");it was working fine last week and now it starts to give a pop up box with only one option of saving the pdf file, there is no option to open it. when I save it the data in the file is lost, its just a fblank form. I am using IE 6.0.2900
    any suggestions?
    Ali

  • Using JSP/Servlet to write Word Document to BLOB

    Hi
    I need some help pls
    When I use a normal class with a main method, it loads the word document into a blob and I can read this 100%.Stunning.
    With a JSP/Servlet I cannot get the document out again. The "format" seems to be lost.
    Any ideas,help greatly appreciated:
    Here is the Main class that works:
    package mypackage1;
    import java.io.OutputStream;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.io.Writer;
    import java.sql.Connection;
    import oracle.jdbc.*;
    import oracle.jdbc.OracleResultSet;
    import oracle.sql.BLOB;
    import org.apache.log4j.Logger;
    import Util_Connect.DataBase;
    public class TestLOB
    //static final Logger logger = Logger.getLogger("test");
    public TestLOB()
    public static void main(String args[])
    TestLOB testLOB = new TestLOB();
    testLOB.TestLOBInsert("c:\\my_data\\callcenterpilot.doc");
    public void TestLOBInsert(String fileName)
    Connection conn = getConnection("wizard");
    BLOB blob = null;
    try
    conn.setAutoCommit(false);
    String cmd = "SELECT * FROM so_cs.testlob WHERE docno = 1 FOR UPDATE";
    PreparedStatement pstmt = conn.prepareStatement(cmd);
    ResultSet rset = pstmt.executeQuery(cmd);
    rset.next();
    blob = ((OracleResultSet)rset).getBLOB(2);
    File binaryFile = new File(fileName);
    System.out.println("Document length = " + binaryFile.length());
    FileInputStream instream = new FileInputStream(binaryFile);
    OutputStream outstream = blob.getBinaryOutputStream();
    int size = blob.getBufferSize();
    byte[] buffer = new byte[size];
    int length = -1;
    while ((length = instream.read(buffer)) != -1)
    outstream.write(buffer, 0, length);
    instream.close();
    outstream.close();
    conn.commit();
    closeConnection(conn);
    catch (Exception ex)
    System.out.println("Error =- > "+ex.toString());
    private Connection getConnection(String dataBase)
    Connection conn = null;
    try
    DriverManager.registerDriver(new OracleDriver());
    conn = DriverManager.getConnection("jdbc:oracle:thin:@oraclu5:1600:dwz110","so_cs","so_cs");
    catch (Exception ex)
    System.out.println("Error getting conn"+ex.toString());
    return conn;
    private void closeConnection(Connection conn)
    if (conn != null)
    try
    conn.close();
    catch (Exception se)
    System.out.println("Error closing connection in get last imei"+se.toString());
    Works fine:
    Here is the display servlet: Works when main class inserts file
    package mypackage1;
    import java.io.InputStream;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.io.Writer;
    import java.sql.Connection;
    import oracle.jdbc.*;
    import oracle.jdbc.OracleResultSet;
    import oracle.sql.BLOB;
    import org.apache.log4j.Logger;
    import Util_Connect.DataBase;
    public class DisplayLOB extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    static final Logger logger = Logger.getLogger(DisplayLOB.class);
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    //response.setContentType(CONTENT_TYPE);
    //PrintWriter out = response.getWriter();
    Connection conn = null;
    PreparedStatement pstmt = null;
    try
    conn = getConnection("wizard");
    //out.println("<html>");
    //out.println("<head><title>DisplayLOB</title></head>");
    //out.println("<body>");
    //out.println("<p>The servlet has received a POST. This is the reply.</p>");
    InputStream is=null;
    oracle.sql.BLOB blob=null;
    response.setContentType("application/msword");
    //response.setContentType("audio/mpeg");
    OutputStream os = response.getOutputStream();
    String term = "1";
    String query = "SELECT docdetail FROM testlob WHERE docno = 1";
    pstmt = conn.prepareStatement(query);
    ResultSet rs = pstmt.executeQuery();
    while (rs.next())
    blob=((OracleResultSet)rs).getBLOB(1);
    is=blob.getBinaryStream();
    int pos=0;
    int length=0;
    byte[] b = new byte[blob.getChunkSize()];
    while((length=is.read(b))!= -1)
    pos+=length;
    os.write(b);
    }//try
    catch (Exception se)
    se.printStackTrace();
    finally
    try
    pstmt.close();
    catch (Exception ex)
    System.out.println("Error closing pstmt "+ex.toString());
    //out.println("</body></html>");
    //out.close();
    private Connection getConnection(String dataBase)
    Connection conn = null;
    try
    conn = DataBase.getPoolConnection(dataBase);
    catch (Exception se)
    logger.fatal("Error getting connection: ",se);
    return conn;
    private void closeConnection(Connection conn)
    if (conn != null)
    try
    conn.close();
    catch (Exception se)
    logger.error("Error closing connection in get last imei",se);
    Here is JSP/Servlet
    <%@ page import="org.apache.log4j.*"%>
    <%@ page contentType="text/html; charset=ISO-8859-1" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>untitled</title>
    <title>Wizard SMS Interface</title>
    <link rel='stylesheet' type='text/css' href='main1.css'>
    <script language='JavaScript' src='copyright.js'></script>
    </head>
    <pre>
    <%
    //HTTP 1.1
    response.setHeader("Cache-Control","no-cache");
    //HTTP 1.0
    response.setHeader("Pragma","no-cache");
    //prevents caching at the proxy server
    response.setDateHeader ("Expires", 0);
    Logger logger = Logger.getLogger("co.za.mtn.wizard.administration.admin01.jsp");
    %>
    </pre>
    <body>
    <FORM ACTION="/WizardAdministration/uploadfile"
    METHOD="POST"
    ENCTYPE="multipart/form-data">
    <INPUT TYPE="FILE" NAME="example">
    <INPUT TYPE="SUBMIT" NAME="button" VALUE="Upload">
    </FORM>
    </body>
    </html>
    <font> <b>Copyright &copy;
    <script>
    var LMDate = new Date( document.lastModified );
    year = LMDate.getYear();
    document.write(display(year));
    </script>
    Mobile Telephone Networks.
    <p align="left"><i><b><font face="Georgia, Times New Roman, Times, serif" size="1"></font></b></i></p>
    package co.za.mtn.wizard.admin;
    import java.io.InputStream;
    import java.util.Enumeration;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.PrintWriter;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileReader;
    import java.io.FileNotFoundException;
    import java.io.Writer;
    import java.sql.Connection;
    import oracle.jdbc.OracleResultSet;
    import oracle.sql.BLOB;
    import org.apache.log4j.Logger;
    import Util_Connect.DataBase;
    public class UploadFile extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    //static final Logger logger = Logger.getLogger(UploadFile.class);
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
    String headerName = null;
    Enumeration en = request.getHeaderNames();
    try
    while ( en.hasMoreElements() )
    Object ob = en.nextElement();
    headerName = ob.toString();
    System.out.println("Value for headerNAme is >"+headerName+"<");
    String aaa = request.getHeader(headerName);
    System.out.println("Value for aa is >"+aaa+"<");
    catch (Exception ex)
    System.out.println("Error in extracting request headers"+ex.toString());
    Connection conn = getConnection("wizard");
    BLOB blob = null;
    try
    conn.setAutoCommit(false);
    String cmd = "SELECT * FROM so_cs.testlob WHERE docno = 1 FOR UPDATE";
    PreparedStatement pstmt = conn.prepareStatement(cmd);
    ResultSet rset = pstmt.executeQuery(cmd);
    rset.next();
    blob = ((OracleResultSet)rset).getBLOB(2);
    //File binaryFile = new File("h:\\callcenterpilot.doc");
    //System.out.println("Document length = " + binaryFile.length());
    //FileInputStream instream = new FileInputStream(binaryFile);
    response.setHeader("Content-Type","application/vnd.ms-word");
    String contentType = request.getContentType();
    System.out.println("Content type received in servlet is >"+contentType+"<");
    ServletInputStream instream = request.getInputStream();
    OutputStream outstream = blob.getBinaryOutputStream();
    int size = blob.getBufferSize();
    byte[] buffer = new byte[size];
    int length = -1;
    while ((length = instream.read(buffer)) != -1)
    outstream.write(buffer, 0, length);
    instream.close();
    outstream.close();
    conn.commit();
    closeConnection(conn);
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    catch (Exception ex)
    System.out.println("Error =- > "+ex.toString());
    //out.println("</body></html>");
    //out.close();
    private Connection getConnection(String dataBase)
    Connection conn = null;
    try
    conn = DataBase.getPoolConnection(dataBase);
    catch (Exception se)
    System.err.println("Error getting connection: "+se.toString());
    return conn;
    private void closeConnection(Connection conn)
    if (conn != null)
    try
    conn.close();
    catch (Exception se)
    System.err.println("Error closing connection in get last imei"+se.toString());
    This is what the display servlet is showing when the JSP/Servlet insert the document
    -----------------------------7d31422224030e
    Content-Disposition: form-data; name="example"; filename="H:\(your name) Skills Matrix.doc"
    Content-Type: application/msword
    �� ࡱ � > ��     � � ���� � � ���������������������
    Tks
    Andre

    hello,
    there are multiple documents out there, describing the oracle reports server setup. try doc.oracle.com for documentation.
    also it is part of the online-documentation.
    you need to install 9iAS enterprise edition. the server is pre-configured and will listen to the url http://yourserver/dev60cgi/rwcgi60.exe
    passing only this url you will get a help-screen, describing the syntax.
    regards,
    the oracle reports team

  • Servlets/JDBC vs. servlets/EJB performance comparison/benchmark

    I have a PHB who believes that EJB has no ___performance___ benefit
    against straightforward servlets/JSP/JDBC. Personally, I believe that
    using EJB is more scalable instead of using servlets/JDBC with
    connection pooling.
    However, I am at a lost on how to prove it. There is all the theory, but
    I would appreciate it if anyone has benchmarks or comparison of
    servlets/JSP/JDBC and servlets/JSP/EJB performance, assuming that they
    were tasked to do the same thing ( e.g. performance the same SQL
    statement, on the same set of tables, etc. ).
    Or some guide on how to setup such a benchmark and prove it internally.
    In other words, the PHB needs numbers, showing performance and
    scalability. In particular, I would like this to be in WLS 6.0.
    Any help appreciated.

    First off, whether you use servlets + JDBC or servlets + EJB, you'll
    most likely spend much of your time in the database.
    I would strongly suggest that you avoid the servlets + JDBC
    architecture. If you want to do straight JDBC code, then it's
    preferable to use a stateless session EJB between the presentation layer
    and the persistence layer.
    So, you should definitely consider an architecture where you have:
    servlets/jsp --> stateless session ejb --> JDBC code
    Your servlet / jsp layer handles presentation.
    The stateless session EJB layer abstracts the persistence layer and
    handles transaction demarcation.
    Modularity is important here. There's no reason that your presentation
    layer should be concerned with your persistence logic. Your application
    might be re-used or later enhanced with an Entity EJB, or JCA Connector,
    or a JMS queue providing the persistence layer.
    Also, you will usually have web or graphic designers who are modifying
    the web pages. Generally, they should not be exposed to transactions
    and jdbc code.
    We optimize the RMI calls so they are just local method calls. The
    stateless session ejb instances are pooled. You won't see much if any
    performance overhead.
    -- Rob
    jms wrote:
    >
    I have a PHB who believes that EJB has no ___performance___ benefit
    against straightforward servlets/JSP/JDBC. Personally, I believe that
    using EJB is more scalable instead of using servlets/JDBC with
    connection pooling.
    However, I am at a lost on how to prove it. There is all the theory, but
    I would appreciate it if anyone has benchmarks or comparison of
    servlets/JSP/JDBC and servlets/JSP/EJB performance, assuming that they
    were tasked to do the same thing ( e.g. performance the same SQL
    statement, on the same set of tables, etc. ).
    Or some guide on how to setup such a benchmark and prove it internally.
    In other words, the PHB needs numbers, showing performance and
    scalability. In particular, I would like this to be in WLS 6.0.
    Any help appreciated.--
    Coming Soon: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnweblogic.com

  • How to Compile Servlet Java Files

    hello ...
    i am a beginner at JSPs and java servlets ... i have been searchin' hopelessly for the past couple of days. Could someone please guide me on how to compile source files for servlets ... namely how can i include the packages javax.servlet.* since the compiler gives me an error that there is no class name ... I am using jdk1.3
    Do I need to get the java server development kit ... but i cant seem to find it any where on the sun's site ... and do i need to download the j2ee sdk too ...
    As you can gather that i am completely comfused and lost ... After doing programmin with asps and previous java experience, i had thought that the migration to a java platform on would be a breeze but the lack of any solid documentation which addresses the above questions is dampenin my spirits ... and the cryptic documentation with tomcat doesnt help either. :)
    pleaze reply soon ... i have to implement a project for my company ... otherwise i would have to put servlets and jsp back in the closet and return back to asp.

    Try http://java.sun.com/j2ee/docs.html specifically, the links on that page called Download Instructions, Installation Instructions, Java Servlets Tutorial and JavaServer Pages QuickStart Guide
    By the way, J2EE SDK's reference implementation is based on Tomcat itself but is more than a web container.

  • How can I test a Servlet?

    Hello!
    I want to test a small part of a servlet. That part connects to a database through a DataSource which is obtained in this manner:
    Context ctx = new InitialContext();
    ds = (DataSource) ctx.lookup(dsLookup);
    conn = ds.getConnection();Details about the servlet: runs on a WebSphere application server with db2 database. Runs on the local server in our intranet and I create a Java project in Eclipse with Create project from existing source: path to location on server.
    It's really annoying to start the browser, get to the page I'm interested, make the neccesary request and then see what happens in my code.
    What I've learned so far:
    I can't test it in a main function because I can't get the context. I tried setting the context's properties, still no go.
    I found this: http://www.ibm.com/developerworks/rational/library/08/0219_jadhav/
    but I got lost when it came to adding the resource reference to the project. How can one do that in Eclipse?
    Can anyone please, please, pretty please with sugar on top, explain to me how I can do this?
    Thank you very much for your time,
    Iulia

    Thank you for your prompt reply. I still have some questions:
    You say that configuration must go in the web.xml file. I don't have that file. In the tutorial example one application is a Java project the other is an application client and the other is an EAR of the application client. Neither of them have a web.xml file. So where do I set the resource?
    Do I have to have a WebSphere application server installed on my local machine?Where and how do I run the servlet?
    Thank you,
    Iulia

Maybe you are looking for

  • Purchase Requisition fields & table

    hi experts,                 I have a requirement to make Purchase Requisition report. Is there any standard report so i can copy and modify it. Or u guys have made some report of the same. its urgent. Or plz tell the table & field names of the follow

  • I have an IPOD Touch IOS 4.2.1 and would like to upgrade to 5.  How do I do that?

    I have an IPOD Touch IOS 4.2.1 and would like to upgrade to 5. How do I do that?  Can't download an app for audio books.

  • Just bought Harmon Kardon soundsticks III cannot get it to work on mac mini

    Hi Just purchased the Harmon Kardon soundsticks very nice looking but does not work with my mac mini.  Connected it up as per manual instructions plugged it in line in cable to line in but no sound.  Went into system preferences to check to see Input

  • A question on methods and parameters.

    Hey guys, it's my first time posting here. I'm very new to Java, and did a bit of C++ prior to Java. I had a question on methods and parameters. I don't quite understand methods; I know that they can be repeated when called, but thats almost about it

  • Brand new 2960X and 2960XR not responding to cli commands

    I have 2 brand new 2960X switches and neither are responding to cli commands via the RJ45 to DB9 cisco cable.  Text is displayed but when I hit enter on the keyboard nothing happens and the switches just sit at whatever the last boot ouput is. 2960-X